Re: [Python-ideas] Add __main__ for uuid, random and urandom

On Apr 18, 2016 12:30 PM, "Wes Turner" <wes.turner@gmail.com> wrote:
sys.argv[1] (IFS=' ') stdin (~IFS=$'\n') ... * https://github.com/westurner/dotfiles/blob/develop/scripts/el * https://github.com/westurner/pyline/blob/master/pyline/pyline.py (considering adding an argument (in addition to the existing -m) for importlib.import_module))

On Apr 18, 2016 12:36 PM, "Wes Turner" <wes.turner@gmail.com> wrote:
shell=True)'
(considering adding an argument (in addition to the existing -m) for importlib.import_module)) another thing worth mentioning is that `ls` prints '?' for certain characters in filenames (e.g. newlines $'\n') so, | pipes with ls and xargs are bad/wrong/unsafe: e.g. $ touch 'file'$'\n''name' $ ls 'file'* | xargs stat #ERR $ find . -maxdepth 1 -name 'file*' | xargs stat #ERRless unsafe (?):
[x for x in os.listdir('.') if x.startswith('file')] # ['file\nname']
$ find . -maxdepth 1 -name 'file*' -print0 | xargs -0 stat ... * "CWE-93: Improper Neutralization of CRLF Sequences ('CRLF Injection')" https://cwe.mitre.org/data/definitions/93.html * CWE-78: Improper Neutralization of Special Elements used in an OS Command ('OS Command Injection') https://cwe.mitre.org/data/definitions/78.html

On Apr 18, 2016 12:36 PM, "Wes Turner" <wes.turner@gmail.com> wrote:
shell=True)'
(considering adding an argument (in addition to the existing -m) for importlib.import_module)) another thing worth mentioning is that `ls` prints '?' for certain characters in filenames (e.g. newlines $'\n') so, | pipes with ls and xargs are bad/wrong/unsafe: e.g. $ touch 'file'$'\n''name' $ ls 'file'* | xargs stat #ERR $ find . -maxdepth 1 -name 'file*' | xargs stat #ERRless unsafe (?):
[x for x in os.listdir('.') if x.startswith('file')] # ['file\nname']
$ find . -maxdepth 1 -name 'file*' -print0 | xargs -0 stat ... * "CWE-93: Improper Neutralization of CRLF Sequences ('CRLF Injection')" https://cwe.mitre.org/data/definitions/93.html * CWE-78: Improper Neutralization of Special Elements used in an OS Command ('OS Command Injection') https://cwe.mitre.org/data/definitions/78.html
participants (1)
-
Wes Turner