Graham Dumpleton wrote:
Although you can get access to argv[], you can only change the value of argv[0], at least for the purposes of effecting the output from 'ps'. This is because that argv[] is not the original argv[] and thus modules could have substituted the program arguments, ie., argv[1] and beyond. This means that any value you substitute must fit into the original length of argv[0] and cannot flow over into the additional arguments.
Wouldn't this just mean you need to be further up the food chain. From my read of the module structure, I see a rewrite_args hook. This hook runs from main.c shortly after the creation of the process structure and the inventory of the prelinked modules. In theory, you just need make sure the module is linked into Apache in such a fashion as to get first grab at the args.
Of course all bets are off if the goal is to have a dynamically loaded module such as mod_wsgi.
Regards, Chris Kukuchka Sequoia Group, Inc.
