Handle user and group names with spaces in them https://sourceforge.net/p/webadmin/bugs/5011/

This commit is contained in:
Jamie Cameron
2017-08-11 13:58:08 -07:00
parent e55e1a32dd
commit bebc39ec26
2 changed files with 2 additions and 16 deletions

View File

@@ -25,7 +25,7 @@ if ($in{'multi'}) {
# base frame
&PrintHeader();
print "<script type='text/javascript'>\n";
@ul = &split_quoted(&filter_javascript($in{'group'}));
@ul = &split_quoted_string(&filter_javascript($in{'group'}));
$len = @ul;
print "sel = new Array($len);\n";
print "selr = new Array($len);\n";
@@ -207,17 +207,3 @@ endgrent() if ($gconfig{'os_type'} ne 'hpux');
return sort { $a->[0] cmp $b->[0] } @groups;
}
# split_quoted(string)
sub split_quoted
{
local @rv;
local $str = $_[0];
while($str =~ /^\s*(\S*"[^"]+"\S*)(.*)$/ || $str =~ /^\s*(\S+)(.*)$/) {
$str = $2;
local $g = $1;
$g =~ s/"//g;
push(@rv, $g);
}
return @rv;
}