summaryrefslogtreecommitdiffstats
path: root/adduser
diff options
context:
space:
mode:
authorYaroslav Tykhiy <ytykhiy@gmail.com>2002-02-11 15:26:20 +0000
committerYaroslav Tykhiy <ytykhiy@gmail.com>2002-02-11 15:26:20 +0000
commit1318ead220797be50bdf3331e10ed1d390fd830a (patch)
tree06c6a8e12063c9defccbacc38c042eb2112fb061 /adduser
parentee6068b5a7f0eefa3967019282f9bd398d9a1e19 (diff)
downloadpw-darwin-1318ead220797be50bdf3331e10ed1d390fd830a.tar.gz
pw-darwin-1318ead220797be50bdf3331e10ed1d390fd830a.tar.zst
pw-darwin-1318ead220797be50bdf3331e10ed1d390fd830a.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.perl2
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;