in reply to RE: lock files vs. non-predictable file names
in thread lock files vs. non-predictable file names
You are probably lucky that 40,700 decimal is a nice integer value. Why not leave it at octal?my $oct_mode = sprintf "%lo", $dec_mode; if (-O $private_dir and ($oct_mode == 40700)) { return } elsif (-O $private_dir and ($oct_mode != 40700)) {
And that value isn't really a "decimal" mode. It's the value of "the mode", which usually prints out as decimal. Internally, it's binary, unless you have a BCD-coded machine (not likely {grin}).if (-O $private_dir and ($dec_mode == 040700)) { return } elsif (-O $private_dir) {
The other scary code here is your use of mailx. While the content of your message cannot possibly contain a line that begins with tilde, you might get complacent some day and permit such a line, and then you can say buh-bye to security. Get in the right groove by looking at Mail::Mailer pretty durn quick.
-- Randal L. Schwartz, Perl hacker
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
RE: RE: RE: lock files vs. non-predictable file names
by RuphSkunk (Acolyte) on Aug 28, 2000 at 21:35 UTC | |
by merlyn (Sage) on Aug 28, 2000 at 22:11 UTC |