Source-Changes-HG archive

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

[src/netbsd-3]: src/lib/libpam/modules/pam_group Pull up revision 1.7 (reques...



details:   https://anonhg.NetBSD.org/src/rev/1588cd294c15
branches:  netbsd-3
changeset: 576546:1588cd294c15
user:      tron <tron%NetBSD.org@localhost>
date:      Mon Jul 11 11:18:33 2005 +0000

description:
Pull up revision 1.7 (requested by lukem in ticket #539):
Don't print an error if we are doing authentication.

diffstat:

 lib/libpam/modules/pam_group/pam_group.c |  23 ++++++++++++++---------
 1 files changed, 14 insertions(+), 9 deletions(-)

diffs (60 lines):

diff -r 9a05da8374d8 -r 1588cd294c15 lib/libpam/modules/pam_group/pam_group.c
--- a/lib/libpam/modules/pam_group/pam_group.c  Mon Jul 11 11:14:02 2005 +0000
+++ b/lib/libpam/modules/pam_group/pam_group.c  Mon Jul 11 11:18:33 2005 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: pam_group.c,v 1.5.2.1 2005/04/04 17:55:29 tron Exp $   */
+/*     $NetBSD: pam_group.c,v 1.5.2.2 2005/07/11 11:18:33 tron Exp $   */
 
 /*-
  * Copyright (c) 2003 Networks Associates Technology, Inc.
@@ -38,7 +38,7 @@
 #ifdef __FreeBSD__
 __FBSDID("$FreeBSD: src/lib/libpam/modules/pam_group/pam_group.c,v 1.4 2003/12/11 13:55:15 des Exp $");
 #else
-__RCSID("$NetBSD: pam_group.c,v 1.5.2.1 2005/04/04 17:55:29 tron Exp $");
+__RCSID("$NetBSD: pam_group.c,v 1.5.2.2 2005/07/11 11:18:33 tron Exp $");
 #endif
 
 #include <sys/types.h>
@@ -71,7 +71,7 @@
        char *const *list;
        struct passwd *pwd, pwres;
        struct group *grp;
-       int pam_err;
+       int pam_err, auth;
        char *promptresp = NULL;
        char pwbuf[1024];
 
@@ -88,6 +88,8 @@
            || ruser == NULL || (pwd = getpwnam(ruser)) == NULL)
                return (PAM_AUTH_ERR);
 
+       auth = openpam_get_option(pamh, "authenticate") != NULL;
+
        /* get regulating group */
        if ((group = openpam_get_option(pamh, "group")) == NULL)
                group = "wheel";
@@ -108,14 +110,17 @@
  not_found:
        if (openpam_get_option(pamh, "deny"))
                return (PAM_SUCCESS);
-       pam_err = pam_prompt(pamh, PAM_ERROR_MSG, &promptresp,
-           "%s: You are not listed in the correct secondary group"
-           " (%s) to %s %s.", getprogname(), group, getprogname(), user);
-       if (pam_err == PAM_SUCCESS && promptresp)
-               free(promptresp);
+       if (!auth) {
+               pam_err = pam_prompt(pamh, PAM_ERROR_MSG, &promptresp,
+                   "%s: You are not listed in the correct secondary group"
+                   " (%s) to %s %s.", getprogname(), group, getprogname(),
+                   user);
+               if (pam_err == PAM_SUCCESS && promptresp)
+                       free(promptresp);
+       }
        return (PAM_AUTH_ERR);
  found:
-       if (openpam_get_option(pamh, "authenticate"))
+       if (auth)
                if ((pam_err = authenticate(pamh, pwd, flags)) != PAM_SUCCESS)
                        return pam_err;
 



Home | Main Index | Thread Index | Old Index