in reply to Passing a Filehandle that Might be a Bareword
Should I allow for the possibility that caller may decide to supply the filehandle using another syntax? If so, what should I allow?Right off the top of my head, I would say that it is a very bad idea to accept a file handle from an unknown source. It would be better (IMHO) to accept a file name (in taint mode) and sanitize it within your module.
Picture this: A program manages to escalate it's privileges, then opens a system file for write access. It then passes your module the file handle.
If you (instead) receive the file name, you have a better chance of making sure that any action your module takes is benign.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Passing a Filehandle that Might be a Bareword
by BrowserUk (Patriarch) on May 30, 2010 at 05:43 UTC | |
by proceng (Scribe) on May 30, 2010 at 13:23 UTC | |
by BrowserUk (Patriarch) on May 30, 2010 at 15:30 UTC | |
|
Re^2: Passing a Filehandle that Might be a Bareword
by Anonymous Monk on May 30, 2010 at 05:18 UTC | |
|
Re^2: Passing a Filehandle that Might be a Bareword
by JavaFan (Canon) on May 31, 2010 at 10:59 UTC |