=================================================================== RCS file: /cvsrepo/anoncvs/cvs/src/usr.bin/chpass/field.c,v retrieving revision 1.9 retrieving revision 1.10 diff -u -r1.9 -r1.10 --- src/usr.bin/chpass/field.c 2006/03/31 00:29:13 1.9 +++ src/usr.bin/chpass/field.c 2009/03/05 20:53:13 1.10 @@ -1,4 +1,4 @@ -/* $OpenBSD: field.c,v 1.9 2006/03/31 00:29:13 deraadt Exp $ */ +/* $OpenBSD: field.c,v 1.10 2009/03/05 20:53:13 millert Exp $ */ /* $NetBSD: field.c,v 1.3 1995/03/26 04:55:28 glass Exp $ */ /* @@ -34,7 +34,7 @@ #if 0 static char sccsid[] = "@(#)field.c 8.4 (Berkeley) 4/2/94"; #else -static char rcsid[] = "$OpenBSD: field.c,v 1.9 2006/03/31 00:29:13 deraadt Exp $"; +static char rcsid[] = "$OpenBSD: field.c,v 1.10 2009/03/05 20:53:13 millert Exp $"; #endif #endif /* not lint */ @@ -220,18 +220,17 @@ return (0); } /* only admin can change from or to "restricted" shells */ - if (uid && pw->pw_shell && !ok_shell(pw->pw_shell)) { + if (uid && pw->pw_shell && !ok_shell(pw->pw_shell, NULL)) { warnx("%s: current shell non-standard", pw->pw_shell); return (1); } - if (!(t = ok_shell(p))) { + if (!ok_shell(p, &t)) { if (uid) { warnx("%s: non-standard shell", p); return (1); } - } else - p = t; - if (!(pw->pw_shell = strdup(p))) { + } + if (!(pw->pw_shell = t)) { warnx("can't save entry"); return (1); }