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

@@ -225,9 +225,7 @@ audit_to_eventlog(struct eventlog *evlog, char * const command_info[],
case 'i':
if (strncmp(*cur, "iolog_path=", sizeof("iolog_path=") - 1) == 0) {
evlog->iolog_path = *cur + sizeof("iolog_path=") - 1;
evlog->iolog_file = strrchr(evlog->iolog_path, '/');
if (evlog->iolog_file != NULL)
evlog->iolog_file++;
evlog->iolog_file = sudo_basename(evlog->iolog_path);
continue;
}
break;