diff options
author | Yaroslav Tykhiy <ytykhiy@gmail.com> | 2002-02-11 15:26:20 +0000 |
---|---|---|
committer | Yaroslav Tykhiy <ytykhiy@gmail.com> | 2002-02-11 15:26:20 +0000 |
commit | 84d62d03edcf076b7da450d7fb89938c947c448c (patch) | |
tree | 7d32a9ec8b11bd2b3c705eff3341aa06f723cffd /adduser | |
parent | 3219560bc43c095672e763e113248ad897441b30 (diff) | |
download | pw-darwin-84d62d03edcf076b7da450d7fb89938c947c448c.tar.gz pw-darwin-84d62d03edcf076b7da450d7fb89938c947c448c.tar.zst pw-darwin-84d62d03edcf076b7da450d7fb89938c947c448c.zip |
Found a single point where rmuser(8) wasn't robust to strange
characters in a username: where it was inserted into a regexp.
Fix it by escaping metacharacters in the name with \Q-\E.
Diffstat (limited to 'adduser')
-rw-r--r-- | adduser/rmuser.perl | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/adduser/rmuser.perl b/adduser/rmuser.perl index aeb9988..1ffac08 100644 --- a/adduser/rmuser.perl +++ b/adduser/rmuser.perl @@ -380,7 +380,7 @@ sub update_group_file { chown($group_uid, $group_gid, $new_group_file) || print STDERR "\n${whoami}: Warning: could not set owner/group of new group file to ${group_uid}/${group_gid} ($!)\n\rContinuing, but please check ownership of $group_file!\n"; while ($i = <GROUP>) { - if (!($i =~ /$login_name/)) { + if (!($i =~ /\Q$login_name\E/)) { # Line doesn't contain any references to the user, so just add it # to the new file print NEW_GROUP $i; |