also since this thread came back to life: On Mon, Jan 06, 2025 at 05:26:05PM -0500, Rob Whitlock wrote: > >> Also all argv[] strings can be modifiable by callee. pathname of the > >> execution (as passed to execve(2) or like) is not. > > > > So? > > > > (also, that's UB in C so the traditional Unix behavior is not by any > > means guaranteed, and on NetBSD you should be using setproctitle(3) > > for that instead anyhow) > > What exactly is UB in C? Since execve(2) is not part of ANSI/ISO C, > I presume you might be talking about modification of the argv[] > strings? But that is explicitly allowed, and not UB.
Apparently I had it in my head that modifying argv strings isn't allowed, and that allowing it was a sketchy Unix extension, but in fact it is. (C&V: C99 5.1.2.2.1 #2) -- David A. Holland [email protected]
