sesman: hand merge #176 from v0.6 branch, indent changes

This commit is contained in:
Jay Sorg 2014-10-20 13:39:38 -07:00
parent a3e017cd58
commit 29ebab2ce5
1 changed files with 19 additions and 9 deletions

View File

@ -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);