From 4b9294447c1d5b7df5b35473e6a89c37de0ba538 Mon Sep 17 00:00:00 2001 From: mjl Date: Wed, 12 Jan 2000 05:13:32 +0000 Subject: [PATCH] Wrap login.conf database access in ifdef LOGIN_CAP. --- usr.bin/passwd/Makefile | 4 ++-- usr.bin/passwd/local_passwd.c | 8 ++++++-- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/usr.bin/passwd/Makefile b/usr.bin/passwd/Makefile index f2cc318cec02..3e1e75027154 100644 --- a/usr.bin/passwd/Makefile +++ b/usr.bin/passwd/Makefile @@ -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 @@ PROG= passwd 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 --git a/usr.bin/passwd/local_passwd.c b/usr.bin/passwd/local_passwd.c index e64f451ef680..b781bdb3795a 100644 --- a/usr.bin/passwd/local_passwd.c +++ b/usr.bin/passwd/local_passwd.c @@ -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 @@ local_passwd(uname) 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 @@ local_passwd(uname) /* * 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;