Re: loop-AES: passing command line arguments to init [patch]

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

 



Martin Godisch wrote:
> On Sun, Dec 28, 2003 at 20:13:35 +0200, Jari Ruusu wrote:
> > How about this one?
> 
> And init will get
> argv[0] "linuxrc", but that's a cosmetic mistake, I don't know whether
> changing argv[0] is portable.

On my test box, kernel stubbornly passed argv[0] as "init" to linuxrc.
And changing it is simple. Something like this:

    if(*argv) *argv = "init";

> > +int main(int argc, char **argv)
>                                  ^
> Is "char **environ" missing here?

That code gets environ from global variable, so it doesn't matter if it
isn't declared there.

-- 
Jari Ruusu  1024R/3A220F51 5B 4B F9 BB D3 3F 52 E9  DB 1D EB E3 24 0E A9 DD
-
Linux-crypto:  cryptography in and on the Linux system
Archive:       http://mail.nl.linux.org/linux-crypto/



[Index of Archives]     [Kernel]     [Linux Crypto]     [Gnu Crypto]     [Gnu Classpath]     [Netfilter]     [Bugtraq]
  Powered by Linux