[Pkg-shadow-commits] r2219 - in upstream/trunk: . src
nekral-guest at alioth.debian.org
nekral-guest at alioth.debian.org
Sun Jul 27 01:41:08 UTC 2008
Author: nekral-guest
Date: 2008-07-27 01:41:07 +0000 (Sun, 27 Jul 2008)
New Revision: 2219
Modified:
upstream/trunk/ChangeLog
upstream/trunk/src/groupmems.c
Log:
* src/groupmems.c (check_perms): Simplify. Always call pam_end()
at the end of the authentication.
Modified: upstream/trunk/ChangeLog
===================================================================
--- upstream/trunk/ChangeLog 2008-07-27 01:35:08 UTC (rev 2218)
+++ upstream/trunk/ChangeLog 2008-07-27 01:41:07 UTC (rev 2219)
@@ -1,5 +1,10 @@
2008-07-27 Nicolas François <nicolas.francois at centraliens.net>
+ * src/groupmems.c (check_perms): Simplify. Always call pam_end()
+ at the end of the authentication.
+
+2008-07-27 Nicolas François <nicolas.francois at centraliens.net>
+
* src/groupmems.c: Add fail_exit() to remove the group lock file
in case of failure. Replace the calls to exit() by fail_exit().
Modified: upstream/trunk/src/groupmems.c
===================================================================
--- upstream/trunk/src/groupmems.c 2008-07-27 01:35:08 UTC (rev 2218)
+++ upstream/trunk/src/groupmems.c 2008-07-27 01:41:07 UTC (rev 2219)
@@ -170,47 +170,32 @@
{
#ifdef USE_PAM
pam_handle_t *pamh = NULL;
- int retval;
-#endif
+ int retval = PAM_SUCCESS;
+ struct passwd *pampw;
-#ifdef USE_PAM
- retval = PAM_SUCCESS;
+ pampw = getpwuid (getuid ()); /* local, no need for xgetpwuid */
+ if (pampw == NULL) {
+ retval = PAM_USER_UNKNOWN;
+ }
- {
- struct passwd *pampw;
- pampw = getpwuid (getuid ()); /* local, no need for xgetpwuid */
- if (pampw == NULL) {
- retval = PAM_USER_UNKNOWN;
- }
-
- if (retval == PAM_SUCCESS) {
- retval = pam_start ("groupmod", pampw->pw_name,
- &conv, &pamh);
- }
+ if (retval == PAM_SUCCESS) {
+ retval = pam_start ("groupmod", pampw->pw_name,
+ &conv, &pamh);
}
if (retval == PAM_SUCCESS) {
retval = pam_authenticate (pamh, 0);
- if (retval != PAM_SUCCESS) {
- (void) pam_end (pamh, retval);
- }
}
if (retval == PAM_SUCCESS) {
retval = pam_acct_mgmt (pamh, 0);
- if (retval != PAM_SUCCESS) {
- (void) pam_end (pamh, retval);
- }
}
+ (void) pam_end (pamh, retval);
if (retval != PAM_SUCCESS) {
fprintf (stderr, _("%s: PAM authentication failed\n"), Prog);
fail_exit (1);
}
-
- if (retval == PAM_SUCCESS) {
- (void) pam_end (pamh, PAM_SUCCESS);
- }
#endif
}
More information about the Pkg-shadow-commits
mailing list