* src/login.c: Re-indent.
This commit is contained in:
parent
1e3f19ad89
commit
54a0762bbb
@ -2,6 +2,7 @@
|
|||||||
|
|
||||||
* src/login.c: Add missing closing }. This was probably never
|
* src/login.c: Add missing closing }. This was probably never
|
||||||
noticed because UT_ADDR is never defined.
|
noticed because UT_ADDR is never defined.
|
||||||
|
* src/login.c: Re-indent.
|
||||||
|
|
||||||
2008-09-20 Nicolas François <nicolas.francois@centraliens.net>
|
2008-09-20 Nicolas François <nicolas.francois@centraliens.net>
|
||||||
|
|
||||||
|
22
src/login.c
22
src/login.c
@ -487,12 +487,10 @@ int main (int argc, char **argv)
|
|||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
#ifdef UT_HOST
|
#ifdef UT_HOST
|
||||||
strncpy (utent.ut_host, hostname,
|
strncpy (utent.ut_host, hostname, sizeof (utent.ut_host));
|
||||||
sizeof (utent.ut_host));
|
|
||||||
#endif
|
#endif
|
||||||
#if HAVE_UTMPX_H
|
#if HAVE_UTMPX_H
|
||||||
strncpy (utxent.ut_host, hostname,
|
strncpy (utxent.ut_host, hostname, sizeof (utxent.ut_host));
|
||||||
sizeof (utxent.ut_host));
|
|
||||||
#endif
|
#endif
|
||||||
/*
|
/*
|
||||||
* Add remote hostname to the environment. I think
|
* Add remote hostname to the environment. I think
|
||||||
@ -666,14 +664,12 @@ int main (int argc, char **argv)
|
|||||||
sizeof (loginprompt), _("login: "));
|
sizeof (loginprompt), _("login: "));
|
||||||
}
|
}
|
||||||
|
|
||||||
retcode =
|
retcode = pam_set_item (pamh, PAM_USER_PROMPT, loginprompt);
|
||||||
pam_set_item (pamh, PAM_USER_PROMPT, loginprompt);
|
|
||||||
PAM_FAIL_CHECK;
|
PAM_FAIL_CHECK;
|
||||||
|
|
||||||
/* if we didn't get a user on the command line,
|
/* if we didn't get a user on the command line,
|
||||||
set it to NULL */
|
set it to NULL */
|
||||||
pam_get_item (pamh, PAM_USER,
|
pam_get_item (pamh, PAM_USER, (const void **)ptr_pam_user);
|
||||||
(const void **)ptr_pam_user);
|
|
||||||
if (pam_user[0] == '\0') {
|
if (pam_user[0] == '\0') {
|
||||||
pam_set_item (pamh, PAM_USER, NULL);
|
pam_set_item (pamh, PAM_USER, NULL);
|
||||||
}
|
}
|
||||||
@ -773,9 +769,7 @@ int main (int argc, char **argv)
|
|||||||
retcode = pam_acct_mgmt (pamh, 0);
|
retcode = pam_acct_mgmt (pamh, 0);
|
||||||
|
|
||||||
if (retcode == PAM_NEW_AUTHTOK_REQD) {
|
if (retcode == PAM_NEW_AUTHTOK_REQD) {
|
||||||
retcode =
|
retcode = pam_chauthtok (pamh, PAM_CHANGE_EXPIRED_AUTHTOK);
|
||||||
pam_chauthtok (pamh,
|
|
||||||
PAM_CHANGE_EXPIRED_AUTHTOK);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
PAM_FAIL_CHECK;
|
PAM_FAIL_CHECK;
|
||||||
@ -784,8 +778,7 @@ int main (int argc, char **argv)
|
|||||||
/* Grab the user information out of the password file for future usage
|
/* Grab the user information out of the password file for future usage
|
||||||
First get the username that we are actually using, though.
|
First get the username that we are actually using, though.
|
||||||
*/
|
*/
|
||||||
retcode =
|
retcode = pam_get_item (pamh, PAM_USER, (const void **)ptr_pam_user);
|
||||||
pam_get_item (pamh, PAM_USER, (const void **)ptr_pam_user);
|
|
||||||
pwd = xgetpwnam (pam_user);
|
pwd = xgetpwnam (pam_user);
|
||||||
if (NULL == pwd) {
|
if (NULL == pwd) {
|
||||||
SYSLOG ((LOG_ERR, "xgetpwnam(%s) failed",
|
SYSLOG ((LOG_ERR, "xgetpwnam(%s) failed",
|
||||||
@ -808,8 +801,7 @@ int main (int argc, char **argv)
|
|||||||
retcode = pam_setcred (pamh, PAM_ESTABLISH_CRED);
|
retcode = pam_setcred (pamh, PAM_ESTABLISH_CRED);
|
||||||
PAM_FAIL_CHECK;
|
PAM_FAIL_CHECK;
|
||||||
|
|
||||||
retcode = pam_open_session (pamh,
|
retcode = pam_open_session (pamh, hushed (&pwent) ? PAM_SILENT : 0);
|
||||||
hushed (&pwent) ? PAM_SILENT : 0);
|
|
||||||
PAM_FAIL_CHECK;
|
PAM_FAIL_CHECK;
|
||||||
|
|
||||||
pwd = xgetpwnam (pam_user);
|
pwd = xgetpwnam (pam_user);
|
||||||
|
Loading…
Reference in New Issue
Block a user