mirror of
https://github.com/freebsd/freebsd-src.git
synced 2024-11-28 04:43:32 +00:00
Make su a little less fascist about using Kerberos if it is not
configured or available. Also fix a _nasty_ bug that would let one in if su -K was used. Any old password would work :-( :-(.
This commit is contained in:
parent
5be175963d
commit
1a98a0fb5b
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=14572
@ -42,7 +42,7 @@ static const char copyright[] =
|
||||
static char sccsid[] = "@(#)su.c 8.3 (Berkeley) 4/2/94";
|
||||
*/
|
||||
static const char rcsid[] =
|
||||
"$Id$";
|
||||
"$Id: su.c,v 1.12 1996/03/09 14:57:43 markm Exp $";
|
||||
#endif /* not lint */
|
||||
|
||||
#include <sys/param.h>
|
||||
@ -186,9 +186,10 @@ main(argc, argv)
|
||||
if (ruid) {
|
||||
#ifdef KERBEROS
|
||||
if (use_kerberos && koktologin(username, user)
|
||||
&& !pwd->pw_uid)
|
||||
errx(1, "kerberos: not in %s's ACL.", user);
|
||||
else
|
||||
&& !pwd->pw_uid) {
|
||||
warnx("kerberos: not in %s's ACL.", user);
|
||||
use_kerberos = 0;
|
||||
}
|
||||
#endif
|
||||
{
|
||||
/* only allow those in group zero to su to root. */
|
||||
@ -228,8 +229,8 @@ main(argc, argv)
|
||||
if (strcmp(pwd->pw_passwd, crypt(p, pwd->pw_passwd))) {
|
||||
#endif
|
||||
#ifdef KERBEROS
|
||||
if (use_kerberos &&
|
||||
kerberos(username, user, pwd->pw_uid, p)
|
||||
if (!use_kerberos || (use_kerberos &&
|
||||
kerberos(username, user, pwd->pw_uid, p))
|
||||
)
|
||||
#endif
|
||||
{
|
||||
|
Loading…
Reference in New Issue
Block a user