Handling argc==0 in the kernel
Handling argc==0 in the kernel
Posted Jan 28, 2022 16:18 UTC (Fri) by larkey (guest, #104463)In reply to: Handling argc==0 in the kernel by judas_iscariote
Parent article: Handling argc==0 in the kernel
execve("/bin/date", NULL, NULL);
as mentioned in the year-old bug report. But this patch is about
execve("/bin/date", &(char*){NULL}, NULL);
which neither FreeBSD thinks is faulty, nor POSIX requires (i.e., FreeBSD is exactly in line with POSIX here). POSIX however recommends that argv[0] != NULL.
There are two issues here, a) that Linux isn't POSIX conforming, allowing argv == NULL, and b) pkexec relying on argv[0] != NULL which is only a POSIX recommendation. I do think the patch from Ariadne Conill should be applied, but then Linux is decidedly stricter than FreeBSD.
