=================================================================== RCS file: /cvsrepo/anoncvs/cvs/src/usr.bin/passwd/local_passwd.c,v retrieving revision 1.35 retrieving revision 1.36 diff -c -r1.35 -r1.36 *** src/usr.bin/passwd/local_passwd.c 2004/09/18 19:34:29 1.35 --- src/usr.bin/passwd/local_passwd.c 2004/12/20 15:05:59 1.36 *************** *** 1,4 **** ! /* $OpenBSD: local_passwd.c,v 1.35 2004/09/18 19:34:29 deraadt Exp $ */ /*- * Copyright (c) 1990 The Regents of the University of California. --- 1,4 ---- ! /* $OpenBSD: local_passwd.c,v 1.36 2004/12/20 15:05:59 moritz Exp $ */ /*- * Copyright (c) 1990 The Regents of the University of California. *************** *** 31,37 **** #ifndef lint /*static const char sccsid[] = "from: @(#)local_passwd.c 5.5 (Berkeley) 5/6/91";*/ ! static const char rcsid[] = "$OpenBSD: local_passwd.c,v 1.35 2004/09/18 19:34:29 deraadt Exp $"; #endif /* not lint */ #include --- 31,37 ---- #ifndef lint /*static const char sccsid[] = "from: @(#)local_passwd.c 5.5 (Berkeley) 5/6/91";*/ ! static const char rcsid[] = "$OpenBSD: local_passwd.c,v 1.36 2004/12/20 15:05:59 moritz Exp $"; #endif /* not lint */ #include *************** *** 84,95 **** --- 84,97 ---- } if ((lc = login_getclass(pw->pw_class)) == NULL) { warnx("unable to get login class for user %s.", uname); + free(opw); return(1); } uid = authenticated ? pw->pw_uid : getuid(); if (uid && uid != pw->pw_uid) { warnx("login/uid mismatch, username argument required."); + free(opw); return(1); } *************** *** 133,139 **** if (i >= 4) fputc('\n', stderr); pfd = open(_PATH_MASTERPASSWD, O_RDONLY, 0); ! if (pfd < 0 || fcntl(pfd, F_SETFD, 1) == -1) pw_error(_PATH_MASTERPASSWD, 1, 1); /* Update master.passwd file and rebuild spwd.db. */ --- 135,141 ---- if (i >= 4) fputc('\n', stderr); pfd = open(_PATH_MASTERPASSWD, O_RDONLY, 0); ! if (pfd < 0 || fcntl(pfd, F_SETFD, FD_CLOEXEC) == -1) pw_error(_PATH_MASTERPASSWD, 1, 1); /* Update master.passwd file and rebuild spwd.db. */