The branch stable/12 has been updated by bapt:

URL: 
https://cgit.FreeBSD.org/src/commit/?id=554f8644b038bc430afaa9a941eb57edb1b4f226

commit 554f8644b038bc430afaa9a941eb57edb1b4f226
Author:     pbuff <[email protected]>
AuthorDate: 2023-05-16 03:05:30 +0000
Commit:     Baptiste Daroussin <[email protected]>
CommitDate: 2023-05-19 08:19:55 +0000

    pw: The pw_checkname function has added ';' checking.
    
    The pw_checkname function forgot to include a ';'
    when checking usernames, causing shell commands
    to be executed when a username with a ';' is deleted.
    
    PR:             271427
    MFC After:      3 days
    
    (cherry picked from commit e0155c6989049da43c5499f7129002aa17d1ca79)
---
 usr.sbin/pw/pw_user.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/usr.sbin/pw/pw_user.c b/usr.sbin/pw/pw_user.c
index 778855e3d1cd..db2b3e6f6d9b 100644
--- a/usr.sbin/pw/pw_user.c
+++ b/usr.sbin/pw/pw_user.c
@@ -637,7 +637,7 @@ pw_checkname(char *name, int gecos)
                showtype = "gecos field";
        } else {
                /* See if the name is valid as a userid or group. */
-               badchars = " ,\t:+&#%$^()!@~*?<>=|\\/\"";
+               badchars = " ,\t:+&#%$^()!@~*?<>=|\\/\";";
                showtype = "userid/group name";
                /* Userids and groups can not have a leading '-'. */
                if (*ch == '-')

Reply via email to