Subject: | DO_DEBUG writes to a shared file - breaks for multiple users |
Date: | Fri, 31 Jan 2014 16:04:27 +1100 |
To: | bug-Net-Whois-IP [...] rt.cpan.org |
From: | Bradley Dean <bjdean [...] bjdean.id.au> |
Greetings,
The DO_DEBUG function writes to $tmp_dir . "/Net.WhoisIP.log" (and warns
when it is unagble to open that file. DO_DEBUG is called unconditionally
throughout the module.
This leads to a conflict:
* multiple users are trying to write to the same file
* on most systems the default permissions of the file mean that
every user after the first user will see a "Unable to open
/tmp/Net.WhoisIP.log" warning (because the file already exists
and is not world writable)
* If the file is set to be world writable there is now a conflict
when multiple users write to the same file.
Suggested fixes:
* make DO_DEBUG do nothing by default unless a debug flag
is turned on
* either chmod the file to be world writeable or name the
file to be user-specific. In this case it would be a good
idea to chmod the file to only allow read and write from the
creating user account (to improve module security)
Cheerio,
Brad
--
Bradley Dean
Email: bjdean@bjdean.id.au Skype: skype@bjdean.id.au
Mobile(Aus): +61-413014395 WWW: http://bjdean.id.au/