From mboxrd@z Thu Jan 1 00:00:00 1970 Message-ID: <5e5cb896f9153b070898df77b1464b9b.axp-list@archive.invalid> X-Archive-Original-Message-ID: <199710030314.XAA10505@pongo.cv.nrao.edu> Date: Thu, 2 Oct 1997 23:14:48 -0400 (EDT) From: Robert L. Millner Subject: argv[] to /sbin/loader This may be better suited to the kernel list but I thought to ask it here. I have a system running: Kern 2.1.57, libc 2.0.5 and the /sbin/loader from 4.0B (system patch 3, about to patch up to 4). When the kernel launches loader, it does so by (I think) shifting off argv[0], and then unshifting the name of the loader on to it (see fs/exec.c:search_binary_handler). When loader gets its argv, it probably looks something like: (loader, -n, 1000) and the exec call is something like (I haven't gone digging enough to get it directly yet so this is speculation) loader, a.out, (loader, -n, 1000), (ENV1, ENV2, ...) loader never bothers to replace argv[0] when it runs the program. This is a problem for some code that checks argv[0]. Under D.U., it looks like exec_with_loader gets called without modifications to argv so that the call is something like: loader, a.out, (a.out, -n, 1000), (ENV1, ENV2, ...) and a.out never knows the difference. Why do we do it the former and not the latter way? I can figure how to change the code myself given enough time but someone out there who already knows it well can send a quick change faster. Thanks. Rob -- To unsubscribe: send e-mail to axp-list-request@redhat.com with 'unsubscribe' as the subject. Do not send it to axp-list@redhat.com