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 | 1318ead220797be50bdf3331e10ed1d390fd830a (patch) | |
tree | 06c6a8e12063c9defccbacc38c042eb2112fb061 /adduser/rmuser.perl | |
parent | ee6068b5a7f0eefa3967019282f9bd398d9a1e19 (diff) | |
download | pw-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/rmuser.perl')
-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; |