bug-cvs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Compile error in current CVS, src/server.c:5500


From: Brian Murphy
Subject: Re: Compile error in current CVS, src/server.c:5500
Date: Thu, 24 Jul 2003 22:48:00 +0200
User-agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.4) Gecko/20030529

Hi,
Here is the updated patch - I have checked that the appropriate messages are output when the various stages fail, it feels much better from an MMI point of view.

/Brian
Index: src/server.c
===================================================================
RCS file: /cvs/ccvs/src/server.c,v
retrieving revision 1.307
diff -u -r1.307 server.c
--- src/server.c        24 Jul 2003 12:32:38 -0000      1.307
+++ src/server.c        24 Jul 2003 20:45:00 -0000
@@ -5326,22 +5326,31 @@
 check_system_password( char *username, char *password )
 {
     pam_handle_t *pamh = NULL;
-    int retval;
+    int retval, err;
     struct cvs_pam_userinfo ui = { username, password };
     struct pam_conv conv = { cvs_pam_conv, (void *)&ui };
+    char *pam_stage = "start";
 
     retval = pam_start(PAM_SERVICE_NAME, username, &conv, &pamh);
 
-    if (retval == PAM_SUCCESS)
+    if (retval == PAM_SUCCESS) {
+       pam_stage = "authenticate";
        retval = pam_authenticate(pamh, 0);
+    }
 
-    if (retval == PAM_SUCCESS)
+    if (retval == PAM_SUCCESS) {
+       pam_stage = "account";
        retval = pam_acct_mgmt(pamh, 0);
+    }
 
-    if (pam_end(pamh,retval) != PAM_SUCCESS)
+    if (retval != PAM_SUCCESS)
+       printf("E PAM %s error: %s\n", pam_stage, pam_strerror(pamh, retval));
+
+    if ((err = pam_end(pamh, retval)) != PAM_SUCCESS)
     {
        printf("E Fatal error, aborting.\n"
-              "pam failed to release authenticator\n");
+               "pam failed to release authenticator\n"
+               "PAM error %s\n", pam_strerror(NULL, err));
        error_exit ();
     }
 

reply via email to

[Prev in Thread] Current Thread [Next in Thread]