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.
This commit is contained in:
parent
9cadaeedec
commit
b4afbb7b01
@ -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;
|
||||
|
Loading…
x
Reference in New Issue
Block a user