aboutsummaryrefslogtreecommitdiffstats
path: root/iurt_root_command
diff options
context:
space:
mode:
authorOlivier Blin <blino@mageia.org>2011-01-16 22:31:43 +0000
committerOlivier Blin <blino@mageia.org>2011-01-16 22:31:43 +0000
commit18d4ef57d1c13a794056f0125fbd62f99c0ff2da (patch)
tree295ad385cd4b9704bb34038ad3b98b2f8ead4817 /iurt_root_command
parentef36936da6f91e49f3c14cbadd2c625ffd513ca2 (diff)
downloadiurt-18d4ef57d1c13a794056f0125fbd62f99c0ff2da.tar
iurt-18d4ef57d1c13a794056f0125fbd62f99c0ff2da.tar.gz
iurt-18d4ef57d1c13a794056f0125fbd62f99c0ff2da.tar.bz2
iurt-18d4ef57d1c13a794056f0125fbd62f99c0ff2da.tar.xz
iurt-18d4ef57d1c13a794056f0125fbd62f99c0ff2da.zip
allow to use umask option for cp
Diffstat (limited to 'iurt_root_command')
-rwxr-xr-xiurt_root_command7
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;
}