Allow comments and blank lines as advertised in passwd(5).
PR: 12828 Submitted by: Yasuhiro Fukuma <yasuf@big.or.jp>
This commit is contained in:
parent
773e954047
commit
e4268c5913
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=49218
@ -1,7 +1,7 @@
|
||||
# @(#)Makefile 8.2 (Berkeley) 4/2/94
|
||||
|
||||
PROG= chpass
|
||||
CFLAGS+=-Wall
|
||||
CFLAGS+=-Wall -DPASSWD_IGNORE_COMMENTS
|
||||
SRCS= chpass.c edit.c field.c pw_copy.c pw_scan.c pw_util.c pw_yp.c \
|
||||
table.c util.c ypxfr_misc.c ${GENSRCS}
|
||||
GENSRCS=yp.h yp_clnt.c yppasswd.h yppasswd_clnt.c yppasswd_private.h \
|
||||
|
@ -85,6 +85,17 @@ pw_copy(ffd, tfd, pw)
|
||||
goto err;
|
||||
continue;
|
||||
}
|
||||
#ifdef PASSWD_IGNORE_COMMENTS
|
||||
for (p = buf; *p != '\n'; p++)
|
||||
if (*p != ' ' && *p != '\t')
|
||||
break;
|
||||
if (*p == '#' || *p == '\n') {
|
||||
(void)fprintf(to, "%s", buf);
|
||||
if (ferror(to))
|
||||
goto err;
|
||||
continue;
|
||||
}
|
||||
#endif
|
||||
if (!(p = strchr(buf, ':'))) {
|
||||
warnx("%s: corrupted entry", _PATH_MASTERPASSWD);
|
||||
pw_error(NULL, 0, 1);
|
||||
|
@ -1,12 +1,12 @@
|
||||
# From: @(#)Makefile 8.3 (Berkeley) 4/2/94
|
||||
# $Id: Makefile,v 1.30 1998/09/19 22:42:04 obrien Exp $
|
||||
# $Id: Makefile,v 1.31 1999/02/14 13:56:15 des Exp $
|
||||
|
||||
PROG= passwd
|
||||
SRCS= local_passwd.c passwd.c pw_copy.c pw_util.c pw_yp.c \
|
||||
yp_passwd.c ypxfr_misc.c ${GENSRCS}
|
||||
GENSRCS=yp.h yp_clnt.c yppasswd.h yppasswd_clnt.c \
|
||||
yppasswd_private.h yppasswd_private_clnt.c yppasswd_private_xdr.c
|
||||
CFLAGS+=-Wall
|
||||
CFLAGS+=-Wall -DPASSWD_IGNORE_COMMENTS
|
||||
|
||||
DPADD= ${LIBCRYPT} ${LIBRPCSVC} ${LIBUTIL}
|
||||
LDADD= -lcrypt -lrpcsvc -lutil
|
||||
|
Loading…
Reference in New Issue
Block a user