diff options
-rwxr-xr-x | iurt_root_command | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/iurt_root_command b/iurt_root_command index 1880e44..6fb68af 100755 --- a/iurt_root_command +++ b/iurt_root_command @@ -294,6 +294,10 @@ sub cp { plog('FAIL', "copying to $dest forbidden"); return; } + + my $prev_umask = umask(); + umask($prev_umask | $opt->{umask}) if $opt->{umask}; + foreach my $f (@files) { if (-d $f) { if (!$opt->{recursive}) { @@ -326,6 +330,9 @@ sub cp { } } } + + umask($prev_umask) if $opt->{umask}; + if (!$done) { plog('DEBUG', "nothing copied") } $ok; } |