Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/usr.bin/passwd Wrap login.conf database access in ifdef LOGI...



details:   https://anonhg.NetBSD.org/src/rev/81de46f8b4a5
branches:  trunk
changeset: 480419:81de46f8b4a5
user:      mjl <mjl%NetBSD.org@localhost>
date:      Wed Jan 12 05:13:32 2000 +0000

description:
Wrap login.conf database access in ifdef LOGIN_CAP.

diffstat:

 usr.bin/passwd/Makefile       |  4 ++--
 usr.bin/passwd/local_passwd.c |  8 ++++++--
 2 files changed, 8 insertions(+), 4 deletions(-)

diffs (60 lines):

diff -r 4985ae44d806 -r 81de46f8b4a5 usr.bin/passwd/Makefile
--- a/usr.bin/passwd/Makefile   Wed Jan 12 05:04:41 2000 +0000
+++ b/usr.bin/passwd/Makefile   Wed Jan 12 05:13:32 2000 +0000
@@ -1,4 +1,4 @@
-#      $NetBSD: Makefile,v 1.23 1999/12/23 01:02:52 mjl Exp $
+#      $NetBSD: Makefile,v 1.24 2000/01/12 05:13:32 mjl Exp $
 #      from: @(#)Makefile    8.3 (Berkeley) 4/2/94
 
 SRCTOP=        ../..
@@ -8,7 +8,7 @@
 SRCS=  local_passwd.c yp_passwd.c passwd.c
 DPADD+= ${LIBRPCSVC} ${LIBCRYPT} ${LIBUTIL}
 LDADD+= -lrpcsvc -lcrypt -lutil
-CPPFLAGS+=-I${.CURDIR} -DYP
+CPPFLAGS+=-I${.CURDIR} -DYP -DLOGIN_CAP
 
 LINKS= ${BINDIR}/passwd ${BINDIR}/yppasswd
 MLINKS=        passwd.1 yppasswd.1
diff -r 4985ae44d806 -r 81de46f8b4a5 usr.bin/passwd/local_passwd.c
--- a/usr.bin/passwd/local_passwd.c     Wed Jan 12 05:04:41 2000 +0000
+++ b/usr.bin/passwd/local_passwd.c     Wed Jan 12 05:13:32 2000 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: local_passwd.c,v 1.17 2000/01/12 05:04:41 mjl Exp $    */
+/*     $NetBSD: local_passwd.c,v 1.18 2000/01/12 05:13:32 mjl Exp $    */
 
 /*-
  * Copyright (c) 1990, 1993, 1994
@@ -38,7 +38,7 @@
 #if 0
 static char sccsid[] = "from: @(#)local_passwd.c    8.3 (Berkeley) 4/2/94";
 #else
-__RCSID("$NetBSD: local_passwd.c,v 1.17 2000/01/12 05:04:41 mjl Exp $");
+__RCSID("$NetBSD: local_passwd.c,v 1.18 2000/01/12 05:13:32 mjl Exp $");
 #endif
 #endif /* not lint */
 
@@ -147,7 +147,9 @@
        int pfd, tfd;
        int min_pw_len = 0;
        int pw_expiry  = 0;
+#ifdef LOGIN_CAP
        login_cap_t *lc;
+#endif
        
        if (!(pw = getpwnam(uname))) {
                warnx("unknown user %s", uname);
@@ -166,11 +168,13 @@
        /*
         * Get class restrictions for this user, then get the new password. 
         */
+#ifdef LOGIN_CAP
        if((lc = login_getclass(pw->pw_class))) {
                min_pw_len = (int) login_getcapnum(lc, "minpasswordlen", 0, 0);
                pw_expiry  = (int) login_getcaptime(lc, "passwordtime", 0, 0);
                login_close(lc);
        }
+#endif
 
        pw->pw_passwd = getnewpasswd(pw, min_pw_len);
        pw->pw_change = pw_expiry ? pw_expiry + time(NULL) : 0;



Home | Main Index | Thread Index | Old Index