aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--lib/libutil/pw_util.c3
-rw-r--r--sbin/hastd/hooks.c3
-rw-r--r--usr.bin/newgrp/newgrp.c5
3 files changed, 4 insertions, 7 deletions
diff --git a/lib/libutil/pw_util.c b/lib/libutil/pw_util.c
index af749d5240de..2838871d93f6 100644
--- a/lib/libutil/pw_util.c
+++ b/lib/libutil/pw_util.c
@@ -58,7 +58,6 @@ static const char rcsid[] =
#include <err.h>
#include <fcntl.h>
#include <inttypes.h>
-#include <libgen.h>
#include <paths.h>
#include <pwd.h>
#include <signal.h>
@@ -315,7 +314,7 @@ pw_edit(int notsetuid)
(void)setuid(getuid());
}
errno = 0;
- execlp(editor, basename(editor), tempname, (char *)NULL);
+ execlp(editor, editor, tempname, (char *)NULL);
_exit(errno);
default:
/* parent */
diff --git a/sbin/hastd/hooks.c b/sbin/hastd/hooks.c
index b1886caaeebf..8cff3bf5ba4f 100644
--- a/sbin/hastd/hooks.c
+++ b/sbin/hastd/hooks.c
@@ -37,7 +37,6 @@ __FBSDID("$FreeBSD$");
#include <errno.h>
#include <fcntl.h>
-#include <libgen.h>
#include <paths.h>
#include <signal.h>
#include <stdbool.h>
@@ -352,7 +351,7 @@ hook_execv(const char *path, va_list ap)
return;
memset(args, 0, sizeof(args));
- args[0] = basename(path);
+ args[0] = __DECONST(char *, path);
for (ii = 1; ii < sizeof(args) / sizeof(args[0]); ii++) {
args[ii] = va_arg(ap, char *);
if (args[ii] == NULL)
diff --git a/usr.bin/newgrp/newgrp.c b/usr.bin/newgrp/newgrp.c
index 9b3972e9eaf6..8fc90f3a60d0 100644
--- a/usr.bin/newgrp/newgrp.c
+++ b/usr.bin/newgrp/newgrp.c
@@ -36,7 +36,6 @@ __FBSDID("$FreeBSD$");
#include <err.h>
#include <errno.h>
#include <grp.h>
-#include <libgen.h>
#include <limits.h>
#include <login_cap.h>
#include <paths.h>
@@ -290,7 +289,7 @@ loginshell(void)
if (ticket != NULL)
setenv("KRBTKFILE", ticket, 1);
- if (asprintf(args, "-%s", basename(shell)) < 0)
+ if (asprintf(args, "-%s", shell) < 0)
err(1, "asprintf");
args[1] = NULL;
@@ -306,6 +305,6 @@ doshell(void)
shell = pwd->pw_shell;
if (*shell == '\0')
shell = _PATH_BSHELL;
- execl(shell, basename(shell), (char *)NULL);
+ execl(shell, shell, (char *)NULL);
err(1, "%s", shell);
}