| joerg | processes may change their own... whateveritis that's shown in `ps` | 02:55 |
|---|---|---|
| joerg | their own commandline? | 02:55 |
| rrq | yes | 04:38 |
| rrq | joerg: (eg in C) memcpy( argv[0], "another commandlline", 22 ); // provided the given commandline is 21 bytes long | 05:08 |
| joerg | :-) | 05:08 |
| rrq | (and maybe the space should be replaced by a NUL, to make a command with 1 argument) | 05:10 |
| joerg | :-D | 05:11 |
| joerg | you're sure? what's about argv[1] ? | 05:11 |
| joerg | given it exists | 05:12 |
| joerg | not sure if for n>argc, any argv[n] is defined | 05:13 |
| rrq | the commandline is a contiguous string with NUL separators; I'm not sure one can point argv[0] elsewhere, so it's all within the one string with NUL separation | 05:13 |
| rrq | and limited in total size by the original commandline | 05:14 |
| joerg | plausible, but I'd not bet on it | 05:14 |
| joerg | I *think* ps (or at least some similar tools, like kde system monitor) distinguish between argv[0] and parameters | 05:15 |
| joerg | then, you certainly could rewrite argc as well | 05:16 |
| rrq | mmm changing argv[0] pointer doesn't change what ps sees | 05:20 |
| rrq | but argv[1] points into the commandline data starting at argv[0] | 05:21 |
| rrq | so the data size is limited by original commandline, but one can divide it willy-nilly with NUL | 05:22 |
| rrq | (and the have to change argv[1] etc) | 05:22 |
| joerg | interesting | 05:23 |
| rrq | see also the -z arg for init | 05:24 |
| joerg | argc The number of arguments to tclsh or wish. | 05:29 |
| joerg | argv Tcl list of arguments to tclsh or wish. | 05:29 |
| joerg | argv0 The script that tclsh or wish started executing (if it was specified) or otherwise the name by which tclsh or wish was invoked. | 05:29 |
| joerg | seems there's a difference between argv[n] and argv0 | 05:30 |
| rrq | yes. there is a similar comment for ps (the "c" output modifier) | 05:32 |
| joerg | execve... | 05:41 |
| data41201 | < | 13:18 |
Generated by irclog2html.py 2.17.0 by Marius Gedminas - find it at https://mg.pov.lt/irclog2html/!