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: Derek Robert Price
Subject: Re: Compile error in current CVS, src/server.c:5500
Date: Mon, 21 Jul 2003 15:13:13 -0400
User-agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.4) Gecko/20030624 Netscape/7.1

Brian Murphy wrote:

    if (retval == PAM_SUCCESS)
        retval = pam_authenticate(pamh, 0);
+    else
+       printf("E PAM Error: %s\n", pam_strerror(NULL, retval));

    if (retval == PAM_SUCCESS)
        retval = pam_acct_mgmt(pamh, 0);
+    else
+       printf("E PAM Error: %s\n", pam_strerror(pamh, retval));


You'll need to nest the conditionals or set some sort of "skip to end" variable. Perhaps "goto error_exit;" or the like would be more appropriate. The way you have things set up in this patch, an error in pam_start will cascade through to print two error messages. After this, pam_end will be called, perhaps with a NULL or undefined pointer, though perhaps that is the correct usage since pam_end will spot a bad retval?

I'd also like to see a "CVS report" of what it was trying to do when the PAM_* error was received. Something along the lines of "PAM returned an error during authentication: %s\n", pam_strerror(...). Ditto for pam_start. Ditto for pam_acct_mgmt, which I notice you are not printing the pam_strerror for - it's conditional is printing out the error message, if any, for the call to pam_authenticate.

-    if (pam_end(pamh,retval) != PAM_SUCCESS)
+    if ((err = pam_end(pamh, retval)) != PAM_SUCCESS)
    {
-       printf("E Fatal error, aborting.\n
-               pam failed to release authenticator\n");
+       printf("E Fatal error, aborting.\n\
+error 0 pam failed to release authenticator\n\
+PAM error number %d: %s\n", err, pam_strerror(NULL, err));
        error_exit ();
}

What exactly is the "error 0" you cite? I'd rather CVS not start outputting arbitrary error numbers without good reason. Also, if pam_strerror is called on the output of pam_end, I don't think printing the actual error number matters much. It shouldn't matter to an end user and likely not even to us with a good text message. Then again, and please feel free to correct me on this one, maybe we should leave the error number in there through the experimental stage, until we discover that the text messages in error reports are satisfying?

Derek

--
               *8^)

Email: address@hidden

Get CVS support at <http://ximbiot.com>!
--
"You use a Windows machine and the golden rule is: Save, and save often.
It's scary how people have grown used to the idea that computers are
unreliable when it is not the computer at all - it's the operating system
that just doesn't cut it."
-- Linus Torvalds





reply via email to

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