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

@@ -352,9 +352,7 @@ iolog_deserialize_info(struct log_details *details, char * const user_info[],
evlog->iolog_path = strdup(*cur + sizeof("iolog_path=") - 1);
if (evlog->iolog_path == NULL)
goto oom;
evlog->iolog_file = strrchr(evlog->iolog_path, '/');
if (evlog->iolog_file != NULL)
evlog->iolog_file++;
evlog->iolog_file = sudo_basename(evlog->iolog_path);
continue;
}
if (strncmp(*cur, "iolog_stdin=", sizeof("iolog_stdin=") - 1) == 0) {