[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [UX] real names exposed

From: Troy Sankey
Subject: Re: [UX] real names exposed
Date: Sat, 03 Sep 2016 18:21:07 -0400
User-agent: alot/0.3.7

I suspect the scope of this UX "bug" is larger than python.  I think this 
probably affects every executable written in an interpreted
language and using a shebang.  Here's another example with a bash

  $ cat >
  sed 's/\x0/\\0/g'  # replaces null bytes with a visible '\0'
  $ ./ </proc/self/cmdline

Looks like '/bin/bash' is argv[0].  What happens when we try exec -a:
  $ bash -c 'exec -a FOO bash </proc/self/cmdline'

  $ bash -c 'exec -a FOO ./ </proc/self/cmdline'

"" still appears. The result of that last command surprised me,
there's no FOO in /prod/self/cmdline at all (still confused)!  By the
way, bash does the same as python, in that $0 always references the
script name, never the actual argv[0]:

  $ cat >
  echo $0
  $ ./ </proc/self/cmdline

  $ bash </proc/self/cmdline

I'm not sure what the solution is.


Attachment: signature.asc
Description: signature

reply via email to

[Prev in Thread] Current Thread [Next in Thread]