summaryrefslogtreecommitdiff
path: root/security/ssh/patches/patch-la
blob: 5e2bfb9bfa4fbb321e3bef57f6a0adc1a198e6e4 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
$NetBSD: patch-la,v 1.2 2000/10/19 02:02:58 hubertf Exp $

--- userfile.c.orig	Wed May 12 13:19:29 1999
+++ userfile.c
@@ -180,7 +180,7 @@
 #endif
 
 
-#if defined (__FreeBSD__) && defined(HAVE_LOGIN_CAP_H)
+#if (defined (__FreeBSD__) || defined(__NetBSD__)) && defined(HAVE_LOGIN_CAP_H)
 #include <login_cap.h>
 #endif
 
@@ -644,9 +644,13 @@
   /* Child.  We will start serving request. */
   if (uid != geteuid() || uid != getuid())
     {
-#if defined (__FreeBSD__) && defined(HAVE_LOGIN_CAP_H)
+#if (defined (__FreeBSD__) || defined(__NetBSD__)) && defined(HAVE_LOGIN_CAP_H) && defined(LOGIN_SETENV)
       struct passwd * pw = getpwuid(uid);
+#if defined(__NetBSD__)
+      login_cap_t * lc = login_getpwclass(pw);
+#else
       login_cap_t * lc = login_getuserclass(pw);
+#endif
       if (setusercontext(lc, pw, uid,
                          LOGIN_SETALL & ~(LOGIN_SETLOGIN | LOGIN_SETPATH |
                                           LOGIN_SETENV)) < 0)