diff options
| author | kim <kim@NetBSD.org> | 1999-07-11 23:41:10 +0000 |
|---|---|---|
| committer | kim <kim@NetBSD.org> | 1999-07-11 23:41:10 +0000 |
| commit | bfb603392a40955d64beb2bd7d3c2baa4d22df76 (patch) | |
| tree | b3b7500f05527c6362a414f843a8d7192e5f9357 /usr.bin/su/su.c | |
| parent | a8000e244c8efa3604d865c6c5a6ce2f90f5a2db (diff) | |
Allow people in group wheel to use the ROOTAUTH group.
Pick up SUROOTAUTH (presumably from /etc/mk.conf).
Diffstat (limited to 'usr.bin/su/su.c')
| -rw-r--r-- | usr.bin/su/su.c | 42 |
1 files changed, 21 insertions, 21 deletions
diff --git a/usr.bin/su/su.c b/usr.bin/su/su.c index ff0efb376d5..76cf008e18e 100644 --- a/usr.bin/su/su.c +++ b/usr.bin/su/su.c @@ -1,4 +1,4 @@ -/* $NetBSD: su.c,v 1.33 1999/03/22 03:25:33 abs Exp $ */ +/* $NetBSD: su.c,v 1.34 1999/07/11 23:41:10 kim Exp $ */ /* * Copyright (c) 1988 The Regents of the University of California. @@ -44,7 +44,7 @@ __COPYRIGHT( #if 0 static char sccsid[] = "@(#)su.c 8.3 (Berkeley) 4/2/94";*/ #else -__RCSID("$NetBSD: su.c,v 1.33 1999/03/22 03:25:33 abs Exp $"); +__RCSID("$NetBSD: su.c,v 1.34 1999/07/11 23:41:10 kim Exp $"); #endif #endif /* not lint */ @@ -189,6 +189,25 @@ main(argc, argv) 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. @@ -209,25 +228,6 @@ main(argc, argv) } } } -#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.", |
