diff options
author | Olivier Blin <blino@mageia.org> | 2011-01-16 22:31:43 +0000 |
---|---|---|
committer | Olivier Blin <blino@mageia.org> | 2011-01-16 22:31:43 +0000 |
commit | 18d4ef57d1c13a794056f0125fbd62f99c0ff2da (patch) | |
tree | 295ad385cd4b9704bb34038ad3b98b2f8ead4817 | |
parent | ef36936da6f91e49f3c14cbadd2c625ffd513ca2 (diff) | |
download | iurt-18d4ef57d1c13a794056f0125fbd62f99c0ff2da.tar iurt-18d4ef57d1c13a794056f0125fbd62f99c0ff2da.tar.gz iurt-18d4ef57d1c13a794056f0125fbd62f99c0ff2da.tar.bz2 iurt-18d4ef57d1c13a794056f0125fbd62f99c0ff2da.tar.xz iurt-18d4ef57d1c13a794056f0125fbd62f99c0ff2da.zip |
allow to use umask option for cp
-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; } |