From: provos Date: Tue, 18 Feb 1997 23:38:58 +0000 (+0000) Subject: open master.passwd before doing pw_copy X-Git-Url: http://artulab.com/gitweb/?a=commitdiff_plain;h=d1161f6e65493448d4b2935a0eb69ebdeaea8f3f;p=openbsd open master.passwd before doing pw_copy --- diff --git a/libexec/rpc.yppasswdd/yppasswdd_mkpw.c b/libexec/rpc.yppasswdd/yppasswdd_mkpw.c index 2c2846d359e..fdcb84d082f 100644 --- a/libexec/rpc.yppasswdd/yppasswdd_mkpw.c +++ b/libexec/rpc.yppasswdd/yppasswdd_mkpw.c @@ -30,12 +30,13 @@ */ #ifndef LINT -static char rcsid[] = "$Id: yppasswdd_mkpw.c,v 1.11 1997/02/18 22:44:49 provos Exp $"; +static char rcsid[] = "$Id: yppasswdd_mkpw.c,v 1.12 1997/02/18 23:38:58 provos Exp $"; #endif #include #include #include +#include #include #include #include @@ -117,6 +118,10 @@ make_passwd(argp) return (1); } + pfd = open(_PATH_MASTERPASSWD, O_RDONLY, 0); + if (pfd < 0) + pw_error(_PATH_MASTERPASSWD, 1, 1); + pw_init(); tfd = pw_lock(0);