mirror of
https://git.proxmox.com/git/mirror_zfs.git
synced 2026-05-22 02:27:36 +03:00
Forbid basename(3) and dirname(3)
There are at least two interpretations of basename(3), in addition to both functions being allowed to /both/ return a static buffer (unsuitable in multi-threaded environments) /and/ raze the input (which encourages overallocations, at best) Reviewed-by: John Kennedy <john.kennedy@delphix.com> Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov> Reviewed-by: Ryan Moeller <ryan@iXsystems.com> Signed-off-by: Ahelenia Ziemiańska <nabijaczleweli@nabijaczleweli.xyz> Closes #12105
This commit is contained in:
@@ -4309,7 +4309,7 @@ zfs_save_arguments(int argc, char **argv, char *string, int len)
|
||||
{
|
||||
int i;
|
||||
|
||||
(void) strlcpy(string, basename(argv[0]), len);
|
||||
(void) strlcpy(string, zfs_basename(argv[0]), len);
|
||||
for (i = 1; i < argc; i++) {
|
||||
(void) strlcat(string, " ", len);
|
||||
(void) strlcat(string, argv[i], len);
|
||||
|
||||
Reference in New Issue
Block a user