Opened 10 years ago

Closed 10 years ago

#307 closed defect (fixed)

argv[0] of shell script interpreter

Reported by: KO Myung-Hun Owned by:
Priority: normal Milestone: libc-0.6.6
Component: libc-backend Version: 0.6.5
Severity: normal Keywords:
Cc:

Description

Hi/2.

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)

spawn_arg.zip (4.7 KB ) - added by KO Myung-Hun 10 years ago.
sample programs
__spawnve_arg0.diff (1.1 KB ) - added by KO Myung-Hun 10 years ago.
patch for argv[0] problem

Download all attachments as: .zip

Change History (4)

by KO Myung-Hun, 10 years ago

Attachment: spawn_arg.zip added

sample programs

by KO Myung-Hun, 10 years ago

Attachment: __spawnve_arg0.diff added

patch for argv[0] problem

comment:1 by bird, 10 years ago

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 by bird, 10 years ago

Component: libclibc-backend
Milestone: libc-0.7libc-0.6.6
Resolution: fixed
Status: newclosed
Note: See TracTickets for help on using tickets.