$NetBSD: patch-la,v 1.1 2000/03/20 02:25:44 itojun Exp $

--- userfile.c.orig	Mon Mar  6 15:18:17 2000
+++ userfile.c	Mon Mar  6 15:18:25 2000
@@ -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)
       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)