But no problem: it is useful as it is.
Now wouldn't something like the following be of value?
etc...sub untaint($) { my $tainted = shift; my @untaintedbits; foreach (split //, $tainted) { if (m%([-\@\w.])%) { push @untaintedbits, $1; } } return join '', @untaintedbits; } sub untaintunixpath($) { my $tainted = shift; my @dirs = split '/', $tainted; map { $_ = untaint($_) } @dirs; return join '/', @dirs; } sub untaintstring($) { my $tainted = shift; my @words = split /\s+/, $tainted; map { $_ = untaint($_) } @words; return join ' ', @words; } my $res = GetOptions("help" => \$help, "unlock" => \$unlock, "vob=s" = +> \$vob, "nusers=s" => \@nusers, "lbtype=s" => \@lbtype); usage if $help or !($res and $vob and @lbtype) or ($unlock and @nusers +); @lbtype = split(/,/, join(',', @lbtype)); map { $_ = untaint($_) } @lbtype; $vob = untaintunixpath($vob); $vob = $ct->argv(qw(des -s), "vob:$vob")->qx; die "Couldn't find the vob $vob\n" unless $vob; $vob = untaintunixpath($vob); my $pwnam = (getpwuid($<))[6]; $pwnam =~ s/^ *(.*[^ ]) *$/$1/; $pwnam = untaintstring($pwnam);
Marc
In reply to Re^6: Insecure dependency in system under -T, with list form invocation
by cramdorgi
in thread Insecure dependency in system under -T, with list form invocation
by cramdorgi
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |