Use sudo_basename() instead of doing the equivalent manually.

This commit is contained in:
Todd C. Miller
2021-02-10 15:14:08 -07:00
parent 41fa461fe1
commit 0663ffbc3f
15 changed files with 38 additions and 101 deletions

View File

@@ -361,10 +361,7 @@ exec_mailer(int pipein)
sudo_debug_exit(__func__, __FILE__, __LINE__, sudo_debug_subsys);
_exit(127);
}
if ((argv[0] = strrchr(mpath, '/')))
argv[0]++;
else
argv[0] = (char *)mpath;
argv[0] = sudo_basename(mpath);
i = 1;
if ((p = strtok_r(mflags, " \t", &last))) {