summaryrefslogtreecommitdiff
path: root/security/ssh/patches/patch-ai
diff options
context:
space:
mode:
authorhubertf <hubertf>1997-12-14 16:17:14 +0000
committerhubertf <hubertf>1997-12-14 16:17:14 +0000
commit80956e3e0b20ef2c1f0154d4ad853722247d111a (patch)
tree382869867dbf6faa175f20f1f3cfddd1c93bded3 /security/ssh/patches/patch-ai
parentac13a97706de36acc3e1738333867c2cbfebbae3 (diff)
downloadpkgsrc-80956e3e0b20ef2c1f0154d4ad853722247d111a.tar.gz
Secure Shell package; Originally taken from FreeBSD, hacked by agc and
finished by me.
Diffstat (limited to 'security/ssh/patches/patch-ai')
-rw-r--r--security/ssh/patches/patch-ai40
1 files changed, 40 insertions, 0 deletions
diff --git a/security/ssh/patches/patch-ai b/security/ssh/patches/patch-ai
new file mode 100644
index 00000000000..241dbf31f7d
--- /dev/null
+++ b/security/ssh/patches/patch-ai
@@ -0,0 +1,40 @@
+*** userfile.c.orig Thu Mar 27 09:04:13 1997
+--- userfile.c Sat Mar 29 01:16:51 1997
+***************
+*** 166,171 ****
+--- 166,175 ----
+ #endif
+
+
++ #ifdef HAVE_LOGIN_CAP_H
++ #include <login_cap.h>
++ #endif
++
+ /* Protocol message types. */
+ #define USERFILE_OPEN 1
+ #define USERFILE_OPEN_REPLY 2
+***************
+*** 626,631 ****
+--- 630,641 ----
+ /* Child. We will start serving request. */
+ if (uid != geteuid() || uid != getuid())
+ {
++ #ifdef HAVE_LOGIN_CAP_H
++ struct passwd * pw = getpwuid(uid);
++ login_cap_t * lc = login_getuserclass(pw);
++ if (setusercontext(lc, pw, uid, LOGIN_SETALL&~(LOGIN_SETLOGIN|LOGIN_SETPATH|LOGIN_SETENV)) < 0)
++ fatal("setusercontext: %s", strerror(errno));
++ #else
+ if (setgid(gid) < 0)
+ fatal("setgid: %s", strerror(errno));
+
+***************
+*** 636,641 ****
+--- 646,652 ----
+
+ if (setuid(uid) < 0)
+ fatal("setuid: %s", strerror(errno));
++ #endif /* HAVE_LOGIN_CAP_H */
+ }
+
+ /* Enter the server main loop. */