After a ':' (as in login:group or just :group) insist that there
actually be a group name (of some form, don't care what) present.
This commit is contained in:
parent
5e706d5f81
commit
221399499c
|
@ -1,4 +1,4 @@
|
||||||
/* $NetBSD: su.c,v 1.74 2021/10/30 11:25:30 nia Exp $ */
|
/* $NetBSD: su.c,v 1.75 2023/03/24 16:58:24 kre Exp $ */
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Copyright (c) 1988 The Regents of the University of California.
|
* Copyright (c) 1988 The Regents of the University of California.
|
||||||
|
@ -39,7 +39,7 @@ __COPYRIGHT("@(#) Copyright (c) 1988\
|
||||||
#if 0
|
#if 0
|
||||||
static char sccsid[] = "@(#)su.c 8.3 (Berkeley) 4/2/94";*/
|
static char sccsid[] = "@(#)su.c 8.3 (Berkeley) 4/2/94";*/
|
||||||
#else
|
#else
|
||||||
__RCSID("$NetBSD: su.c,v 1.74 2021/10/30 11:25:30 nia Exp $");
|
__RCSID("$NetBSD: su.c,v 1.75 2023/03/24 16:58:24 kre Exp $");
|
||||||
#endif
|
#endif
|
||||||
#endif /* not lint */
|
#endif /* not lint */
|
||||||
|
|
||||||
|
@ -210,8 +210,9 @@ main(int argc, char **argv)
|
||||||
if ((p = strchr(user, ':')) != NULL) {
|
if ((p = strchr(user, ':')) != NULL) {
|
||||||
*p = '\0';
|
*p = '\0';
|
||||||
gname = ++p;
|
gname = ++p;
|
||||||
}
|
if (*gname == '\0')
|
||||||
else
|
errx(EXIT_FAILURE, "missing 'group' after ':'");
|
||||||
|
} else
|
||||||
gname = NULL;
|
gname = NULL;
|
||||||
|
|
||||||
#ifdef ALLOW_EMPTY_USER
|
#ifdef ALLOW_EMPTY_USER
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
/* $NetBSD: su_pam.c,v 1.23 2021/11/27 22:16:42 rillig Exp $ */
|
/* $NetBSD: su_pam.c,v 1.24 2023/03/24 16:58:24 kre Exp $ */
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Copyright (c) 1988 The Regents of the University of California.
|
* Copyright (c) 1988 The Regents of the University of California.
|
||||||
|
@ -39,7 +39,7 @@ __COPYRIGHT("@(#) Copyright (c) 1988\
|
||||||
#if 0
|
#if 0
|
||||||
static char sccsid[] = "@(#)su.c 8.3 (Berkeley) 4/2/94";*/
|
static char sccsid[] = "@(#)su.c 8.3 (Berkeley) 4/2/94";*/
|
||||||
#else
|
#else
|
||||||
__RCSID("$NetBSD: su_pam.c,v 1.23 2021/11/27 22:16:42 rillig Exp $");
|
__RCSID("$NetBSD: su_pam.c,v 1.24 2023/03/24 16:58:24 kre Exp $");
|
||||||
#endif
|
#endif
|
||||||
#endif /* not lint */
|
#endif /* not lint */
|
||||||
|
|
||||||
|
@ -204,8 +204,9 @@ main(int argc, char **argv)
|
||||||
if ((p = strchr(user, ':')) != NULL) {
|
if ((p = strchr(user, ':')) != NULL) {
|
||||||
*p = '\0';
|
*p = '\0';
|
||||||
gname = ++p;
|
gname = ++p;
|
||||||
}
|
if (*gname == '\0')
|
||||||
else
|
errx(EXIT_FAILURE, "missing 'group' after ':'");
|
||||||
|
} else
|
||||||
gname = NULL;
|
gname = NULL;
|
||||||
|
|
||||||
#ifdef ALLOW_EMPTY_USER
|
#ifdef ALLOW_EMPTY_USER
|
||||||
|
|
Loading…
Reference in New Issue