Source-Changes-HG archive

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

[src/netbsd-1-4]: src/usr.bin/su Pull up revision 1.34 (requested by kim):



details:   https://anonhg.NetBSD.org/src/rev/f49ee7d0f8b3
branches:  netbsd-1-4
changeset: 469993:f49ee7d0f8b3
user:      he <he%NetBSD.org@localhost>
date:      Sat Jan 08 18:34:50 2000 +0000

description:
Pull up revision 1.34 (requested by kim):
  Allow the make variable SUROOTAUTH to be set to a group where the
  members can use their own password to authenticate to su to root.
  By default this is not set, retaining the traditional behaviour.

diffstat:

 usr.bin/su/su.c |  42 +++++++++++++++++++++---------------------
 1 files changed, 21 insertions(+), 21 deletions(-)

diffs (70 lines):

diff -r 23bda7756fb1 -r f49ee7d0f8b3 usr.bin/su/su.c
--- a/usr.bin/su/su.c   Sat Jan 08 18:23:49 2000 +0000
+++ b/usr.bin/su/su.c   Sat Jan 08 18:34:50 2000 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: su.c,v 1.33.2.1 1999/08/29 11:25:05 he Exp $   */
+/*     $NetBSD: su.c,v 1.33.2.2 2000/01/08 18:34:50 he Exp $   */
 
 /*
  * Copyright (c) 1988 The Regents of the University of California.
@@ -44,7 +44,7 @@
 #if 0
 static char sccsid[] = "@(#)su.c       8.3 (Berkeley) 4/2/94";*/
 #else
-__RCSID("$NetBSD: su.c,v 1.33.2.1 1999/08/29 11:25:05 he Exp $");
+__RCSID("$NetBSD: su.c,v 1.33.2.2 2000/01/08 18:34:50 he Exp $");
 #endif
 #endif /* not lint */
 
@@ -188,6 +188,25 @@
                int ok = pwd->pw_uid != 0;
                char **g;
 
+#ifdef ROOTAUTH
+               /*
+                * Allow those in group rootauth to su to root, by supplying
+                * their own password.
+                */
+               if (!ok && (gr = getgrnam(ROOTAUTH)))
+                       for (g = gr->gr_mem;; ++g) {
+                               if (!*g) {
+                                       ok = 0;
+                                       break;
+                               }
+                               if (!strcmp(username, *g)) {
+                                       pass = userpass;
+                                       user = username;
+                                       ok = 1;
+                                       break;
+                               }
+                       }
+#endif
                /*
                 * Only allow those in group SUGROUP to su to root,
                 * but only if that group has any members.
@@ -208,25 +227,6 @@
                                        }
                                }
                }
-#ifdef ROOTAUTH
-               /*
-                * Allow those in group rootauth to su to root, by supplying
-                * their own password.
-                */
-               if (!ok && (gr = getgrnam(ROOTAUTH)))
-                       for (g = gr->gr_mem;; ++g) {
-                               if (!*g) {
-                                       ok = 0;
-                                       break;
-                               }
-                               if (!strcmp(username, *g)) {
-                                       pass = userpass;
-                                       user = username;
-                                       ok = 1;
-                                       break;
-                               }
-                       }
-#endif
                if (!ok)
                        errx(1,
            "you are not listed in the correct secondary group (%s) to su %s.",



Home | Main Index | Thread Index | Old Index