loginsh is a global variable, use newshell for the update_shell()'s parameter.

This commit is contained in:
nekral-guest 2008-01-05 13:54:39 +00:00
parent f11bbd3b70
commit bbb9470661
2 changed files with 4 additions and 2 deletions

View File

@ -23,6 +23,8 @@
declaration. (add void) declaration. (add void)
* src/login.c: login_prompt is the name of a function, use * src/login.c: login_prompt is the name of a function, use
loginprompt for the internal variable. loginprompt for the internal variable.
* src/chsh.c: loginsh is a global variable, use newshell for the
update_shell()'s parameter.
2008-01-01 Nicolas François <nicolas.francois@centraliens.net> 2008-01-01 Nicolas François <nicolas.francois@centraliens.net>

View File

@ -331,7 +331,7 @@ static void check_perms (const struct passwd *pw)
* *
* It will not return in case of error. * It will not return in case of error.
*/ */
static void update_shell (const char *user, char *loginsh) static void update_shell (const char *user, char *newshell)
{ {
const struct passwd *pw; /* Password entry from /etc/passwd */ const struct passwd *pw; /* Password entry from /etc/passwd */
struct passwd pwent; /* New password entry */ struct passwd pwent; /* New password entry */
@ -389,7 +389,7 @@ static void update_shell (const char *user, char *loginsh)
* fields remain unchanged. * fields remain unchanged.
*/ */
pwent = *pw; pwent = *pw;
pwent.pw_shell = loginsh; pwent.pw_shell = newshell;
/* /*
* Update the passwd file entry. If there is a DBM file, update * Update the passwd file entry. If there is a DBM file, update