|
|
Log in / Subscribe / Register

Re: +1 on setproctitle

Re: +1 on setproctitle

Posted Oct 9, 2011 3:26 UTC (Sun) by neilbrown (subscriber, #359)
In reply to: Re: +1 on setproctitle by ldo
Parent article: A Plumber's Wish List for Linux

Neat !!

As long as no-one uses getenv() before-hand and holds on to the string - or uses putenv as you say.

I would probably have a setproctitle_prepare() which is called first-thing in main() and relocates both argv and environ so that the original arg space is not referenced by anything. But that might just be paranoia.

Also - ld-linux.*.so uses environment variables. I wonder if it holds on to any that it looked up before main() was called.. Probably not, that would be asking for trouble.


to post comments


Copyright © 2026, Eklektix, Inc.
Comments and public postings are copyrighted by their creators.
Linux is a registered trademark of Linus Torvalds