summaryrefslogtreecommitdiff
path: root/usr/src/cmd/pfexec
diff options
context:
space:
mode:
Diffstat (limited to 'usr/src/cmd/pfexec')
-rw-r--r--usr/src/cmd/pfexec/pfexec.c12
1 files changed, 10 insertions, 2 deletions
diff --git a/usr/src/cmd/pfexec/pfexec.c b/usr/src/cmd/pfexec/pfexec.c
index f06e1c3806..35bffd0d72 100644
--- a/usr/src/cmd/pfexec/pfexec.c
+++ b/usr/src/cmd/pfexec/pfexec.c
@@ -96,6 +96,7 @@ main(int argc, char **argv)
{
char *cmd;
char *pset = NULL;
+ const char *msg;
char pathbuf[MAXPATHLEN];
int c;
priv_set_t *wanted;
@@ -129,9 +130,12 @@ main(int argc, char **argv)
switch (shellname(cmd, pathbuf)) {
case RES_OK:
(void) execv(pathbuf, argv);
+ msg = strerror(errno);
+ if (errno == ENOTACTIVE)
+ msg = gettext("failed to contact pfexecd");
(void) fprintf(stderr,
gettext("pfexec: unable to execute %s: %s\n"),
- pathbuf, strerror(errno));
+ pathbuf, msg);
return (1);
case RES_PFEXEC:
case RES_FAILURE:
@@ -170,9 +174,13 @@ main(int argc, char **argv)
}
(void) execvp(argv[0], argv);
+
+ msg = strerror(errno);
+ if (errno == ENOTACTIVE)
+ msg = gettext("failed to contact pfexecd");
(void) fprintf(stderr,
gettext("pfexec: unable to execute %s: %s\n"),
- argv[0], strerror(errno));
+ argv[0], msg);
return (1);
}
return (1);