goto fmt;
p = pw->pw_shell;
- if (root && *p) /* empty == /bin/sh */
+ if (root && *p) { /* empty == /bin/sh */
for (setusershell();;) {
if (!(sh = getusershell())) {
if (flags & _PWSCAN_WARN)
if (!strcmp(p, sh))
break;
}
+ endusershell();
+ }
if (p[0])
pw->pw_fields |= _PWF_SHELL;