diff options
| author | fukachan <fukachan> | 2002-12-26 04:26:10 +0000 |
|---|---|---|
| committer | fukachan <fukachan> | 2002-12-26 04:26:10 +0000 |
| commit | 746eb282c8dce618e4a49e1e602fe0dbac6a6ff8 (patch) | |
| tree | 46dff4fce3506590ce1435e350ea6a7ebeb6e279 /fml/lib/FML/Log.pm | |
| parent | e01185f187916c1cf457d838181e9faa47d9e41a (diff) | |
| download | fml8-746eb282c8dce618e4a49e1e602fe0dbac6a6ff8.tar.gz fml8-746eb282c8dce618e4a49e1e602fe0dbac6a6ff8.tar.bz2 fml8-746eb282c8dce618e4a49e1e602fe0dbac6a6ff8.zip | |
create log file with mode 0600 if could.
it seems o.k. by "Principle of Least Surprise".
Diffstat (limited to 'fml/lib/FML/Log.pm')
| -rw-r--r-- | fml/lib/FML/Log.pm | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/fml/lib/FML/Log.pm b/fml/lib/FML/Log.pm index 8d67061d..97064ec3 100644 --- a/fml/lib/FML/Log.pm +++ b/fml/lib/FML/Log.pm @@ -2,7 +2,7 @@ # # Copyright (C) 2000,2001,2002 Ken'ichi Fukamachi # -# $FML: Log.pm,v 1.23 2002/09/22 14:56:40 fukachan Exp $ +# $FML: Log.pm,v 1.24 2002/12/18 03:42:28 fukachan Exp $ # package FML::Log; @@ -120,8 +120,12 @@ sub Log my $fh = undef; my $sender = FML::Credential->sender; - if (defined $file && -f $file) { + if (defined $file) { + my $old_mask = umask(077); $fh = new FileHandle ">> $file"; + umask($old_mask); + + $fh = \*STDERR unless $fh; } else { $fh = \*STDERR; |
