summaryrefslogtreecommitdiff
path: root/security/ssh2/files/patch-lib::sshapputil::sshuserfile.c
blob: 9886bee1a3ca8b052505707474e69e37c2b77230 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
--- lib/sshapputil/sshuserfile.c.orig	Wed Dec  3 14:17:21 2003
+++ lib/sshapputil/sshuserfile.c	Mon Dec 29 20:58:27 2003
@@ -742,12 +742,13 @@
   if (uid != geteuid() || uid != getuid())
     {
 #if defined (__FreeBSD__) && defined(HAVE_LOGIN_CAP_H)
-      struct passwd * pw = getpwuid(uid);
-      login_cap_t * lc = login_getuserclass(pw);
-      if (setusercontext(lc, pw, uid,
+      struct passwd *pw;
+
+      pw = getpwuid(uid);
+      if (setusercontext(NULL, pw, uid,
                          LOGIN_SETALL & ~(LOGIN_SETLOGIN | LOGIN_SETPATH |
                                           LOGIN_SETENV)) < 0)
-        ssh_fatal("setusercontext: %s", strerror(errno));
+        ssh_fatal("setusercontext: unable to set user context");
 #else /* ! (__FreeBSD && HAVE_LOGIN_CAP_H) */
       if (setgid(gid) < 0)
         ssh_fatal("setgid: %s", strerror(errno));