diff options
| author | fukachan <fukachan> | 2002-10-29 10:35:30 +0000 |
|---|---|---|
| committer | fukachan <fukachan> | 2002-10-29 10:35:30 +0000 |
| commit | 82001f3d939afb46bbdb5a067ccde92f5ea34b2d (patch) | |
| tree | 520aabb0cb3fd947a30531424db0494930f8b154 /fml/lib/FML/Process | |
| parent | b6a01dcefbdfb6f84040e3f591a2b1a708f3fea6 (diff) | |
| download | fml8-82001f3d939afb46bbdb5a067ccde92f5ea34b2d.tar.gz fml8-82001f3d939afb46bbdb5a067ccde92f5ea34b2d.tar.bz2 fml8-82001f3d939afb46bbdb5a067ccde92f5ea34b2d.zip | |
ensure umask escape in _mkpath_*()
Diffstat (limited to 'fml/lib/FML/Process')
| -rw-r--r-- | fml/lib/FML/Process/Utils.pm | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/fml/lib/FML/Process/Utils.pm b/fml/lib/FML/Process/Utils.pm index bd1023ec..50eef53e 100644 --- a/fml/lib/FML/Process/Utils.pm +++ b/fml/lib/FML/Process/Utils.pm @@ -4,7 +4,7 @@ # All rights reserved. This program is free software; you can # redistribute it and/or modify it under the same terms as Perl itself. # -# $FML: Utils.pm,v 1.46 2002/10/05 15:44:39 fukachan Exp $ +# $FML: Utils.pm,v 1.47 2002/10/29 09:06:52 fukachan Exp $ # package FML::Process::Utils; @@ -254,6 +254,9 @@ sub mkdir sub _mkpath_num { my ($dir, $mode) = @_; + my $cur_mask = umask(); + + umask(0); if ($mode =~ /^\d+$/) { # NUM 0700 eval q{ use File::Path;}; @@ -264,6 +267,8 @@ sub _mkpath_num else { LogError("mkdir: invalid mode (N)"); } + + umask($cur_mask); } @@ -274,6 +279,9 @@ sub _mkpath_num sub _mkpath_str { my ($dir, $mode) = @_; + my $cur_mask = umask(); + + umask(0); if ($mode =~ /^\d+$/) { # STR 0700 eval qq{ @@ -287,6 +295,8 @@ sub _mkpath_str else { LogError("mkdir: invalid mode (S)"); } + + umask($cur_mask); } |
