Opened 5 years ago

Closed 5 years ago

#307 closed defect (fixed)

argv[0] of shell script interpreter

Reported by: komh Owned by:
Priority: normal Milestone: libc-0.6.6
Component: libc-backend Version: 0.6.5
Severity: normal Keywords:



argv[0] should be a program itself. However, if spawn() a shell script, the script name is passed to a shell. So the shell using argv[0] misbehave.

I attach test programs. If you run spawn_arg.exe, then you can confirm argv[0] is a shell script not a shell.

Attachments (2) (4.7 KB) - added by komh 5 years ago.
sample programs
__spawnve_arg0.diff (1.1 KB) - added by komh 5 years ago.
patch for argv[0] problem

Download all attachments as: .zip

Change History (4)

Changed 5 years ago by komh

sample programs

Changed 5 years ago by komh

patch for argv[0] problem

comment:1 Changed 5 years ago by bird

Thanks for the testcase. Don't know where I got the weird ideas for that list of parameter to the interpreter from... Anyway, r3930 does a better job, though I suspect it shouldn't really do an _realrealpath on the script name.

comment:2 Changed 5 years ago by bird

  • Component changed from libc to libc-backend
  • Milestone changed from libc-0.7 to libc-0.6.6
  • Resolution set to fixed
  • Status changed from new to closed
Note: See TracTickets for help on using tickets.