[BusyBox] bug report - halt/reboot/poweroff error

Tomi Ollila Tomi.Ollila at sonera.com
Fri Sep 15 04:33:27 UTC 2000


Thursday Sep 14 12:39:18 -0600 2000 Erik Andersen <andersen at lineo.com> wrote:
> 
> I don't think that is it, since in init.c I force argv[0] to be "init"...
> (about line 977):
> 
>     /* Fix up argv[0] to be certain we claim to be init */
>     strncpy(argv[0], "init", strlen(argv[0])+1);

Short comment here -- argv[0] most probably is `busybox' here, so there is
no problem in this case -- but think of a vague case where argv[0] contains
`ps\0aslkgihrrt...'. after a previous strncopy, argv[0] would contain
`iniaslkgihrrt...' 

couldn't that just be done as: argv[0] = "init" -- it should not matter
where argv[0] points at ?

> 
>  -Erik

Tomi





More information about the busybox mailing list