diff options
author | Jay Sorg <jay.sorg@gmail.com> | 2014-10-20 13:39:38 -0700 |
---|---|---|
committer | Jay Sorg <jay.sorg@gmail.com> | 2014-10-20 13:39:38 -0700 |
commit | 29ebab2ce5684214f5352405471285c64d960275 (patch) | |
tree | acc92ad62327f68ecc54f7dca034c5cf412f6747 | |
parent | a3e017cd580f5a45af742b330cb453152e131e21 (diff) | |
download | xrdp-proprietary-29ebab2ce5684214f5352405471285c64d960275.tar.gz xrdp-proprietary-29ebab2ce5684214f5352405471285c64d960275.zip |
sesman: hand merge #176 from v0.6 branch, indent changes
-rw-r--r-- | sesman/verify_user_pam.c | 28 |
1 files changed, 19 insertions, 9 deletions
diff --git a/sesman/verify_user_pam.c b/sesman/verify_user_pam.c index eec12c66..a2b3f93a 100644 --- a/sesman/verify_user_pam.c +++ b/sesman/verify_user_pam.c @@ -118,22 +118,31 @@ auth_userpass(char *user, char *pass, int *errorcode) if (error != PAM_SUCCESS) { - if(errorcode!=NULL){ - *errorcode = error ; - } + if (errorcode != NULL) + { + *errorcode = error; + } g_printf("pam_start failed: %s\r\n", pam_strerror(auth_info->ph, error)); pam_end(auth_info->ph, error); g_free(auth_info); return 0; } + error = pam_set_item(auth_info->ph, PAM_TTY, service_name); + if (error != PAM_SUCCESS) + { + g_printf("pam_set_item failed: %s\r\n", + pam_strerror(auth_info->ph, error)); + } + error = pam_authenticate(auth_info->ph, 0); if (error != PAM_SUCCESS) { - if(errorcode!=NULL){ - *errorcode = error ; - } + if (errorcode != NULL) + { + *errorcode = error; + } g_printf("pam_authenticate failed: %s\r\n", pam_strerror(auth_info->ph, error)); pam_end(auth_info->ph, error); @@ -150,9 +159,10 @@ auth_userpass(char *user, char *pass, int *errorcode) if (error != PAM_SUCCESS) { - if(errorcode!=NULL){ - *errorcode = error ; - } + if (errorcode != NULL) + { + *errorcode = error; + } g_printf("pam_acct_mgmt failed: %s\r\n", pam_strerror(auth_info->ph, error)); pam_end(auth_info->ph, error); |