src/useradd.c: tallylog_reset(): Use Basename() instead of its pattern

Signed-off-by: Alejandro Colomar <alx@kernel.org>
This commit is contained in:
Alejandro Colomar 2024-05-13 00:13:41 +02:00 committed by Serge Hallyn
parent 964df6ed6e
commit 8176e309ed

View File

@ -2081,11 +2081,7 @@ static void tallylog_reset (const char *user_name)
failed = 1;
break;
case 0: /* child */
pname = strrchr(pam_tally2, '/');
if (pname == NULL)
pname = pam_tally2;
else
pname++; /* Skip the '/' */
pname = Basename(pam_tally2);
execl(pam_tally2, pname, "--user", user_name, "--reset", "--quiet", NULL);
/* If we come here, something has gone terribly wrong */
perror(pam_tally2);