Handling argc==0 in the kernel
Handling argc==0 in the kernel
Posted Jan 28, 2022 21:21 UTC (Fri) by khim (subscriber, #9252)In reply to: Handling argc==0 in the kernel by floppus
Parent article: Handling argc==0 in the kernel
> But if any setuid program actually relies on argv[0] being the name of the program, that's a severe bug (symlinks, TOCTOU, etc., never mind the fact that the caller can always specify any string they want.)
How? All examples I have ever saw are using argv[0] only to multiplex binaries. They don't ever look on the actual binary which is specified in argv[0], rather, they are only interested in `basename`. Symlinks, TOCTOU and even the fact that caller can specify anything there are irrelevant: for them it's just an argument of the command line which happen to include name of the program.
And empty arguments have tendency to make programs wonky.
