[lkml]   [2003]   [Jan]   [15]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
Messages in this thread
SubjectChanging argv[0] under Linux. This MUST work...
    Hi Jakob :)

Your solution of exec'ing ourselves MUST undoubtly work (well, I
know that this an affirmation that I will lament XDDDD), because it
only relies on 'exec()' passing the argv[0] you provide as the
argv[0] of the invoked binary, and that should work or programs like
'/bin/login' will stop working... They rely on the same principle,
since they need to prepend an '-' to the shell name to make it a
login shell :))) Didn't remember this until now!

So, if you do 'execl(ourselves, "my new name", ..., NULL)', the
argv[0] received by the binary specified in 'ourselves' MUST be 'my
new name'. Otherwise '/bin/login' and a good bunch of shells won't

If you happen to come to Spain at any point in the future, just
tell me, I'll buy you a beer (or crack, or whatever you use XDDD).

Thanks :)

To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to
More majordomo info at
Please read the FAQ at

 \ /
  Last update: 2005-03-22 13:32    [W:0.145 / U:0.940 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site