summaryrefslogtreecommitdiff
path: root/usr/src/cmd/pfexecd/pfexecd.c
diff options
context:
space:
mode:
Diffstat (limited to 'usr/src/cmd/pfexecd/pfexecd.c')
-rw-r--r--usr/src/cmd/pfexecd/pfexecd.c17
1 files changed, 16 insertions, 1 deletions
diff --git a/usr/src/cmd/pfexecd/pfexecd.c b/usr/src/cmd/pfexecd/pfexecd.c
index c8ec8a12df..1d25c09188 100644
--- a/usr/src/cmd/pfexecd/pfexecd.c
+++ b/usr/src/cmd/pfexecd/pfexecd.c
@@ -19,7 +19,7 @@
* CDDL HEADER END
*
* Copyright (c) 2010, Oracle and/or its affiliates. All rights reserved.
- *
+ * Copyright 2015, Joyent, Inc.
*/
#define _POSIX_PTHREAD_SEMANTICS 1
@@ -360,6 +360,21 @@ callback_pfexec(pfexec_arg_t *pap)
size_t mysz = repsz - 2 * setsz;
char *path = pap->pfa_path;
+ /*
+ * Initialize the pfexec_reply_t to a sane state.
+ */
+ res->pfr_vers = pap->pfa_vers;
+ res->pfr_len = 0;
+ res->pfr_ruid = PFEXEC_NOTSET;
+ res->pfr_euid = PFEXEC_NOTSET;
+ res->pfr_rgid = PFEXEC_NOTSET;
+ res->pfr_egid = PFEXEC_NOTSET;
+ res->pfr_setcred = B_FALSE;
+ res->pfr_scrubenv = B_TRUE;
+ res->pfr_allowed = B_FALSE;
+ res->pfr_ioff = 0;
+ res->pfr_loff = 0;
+
uuid = pap->pfa_uid;
if (getpwuid_r(uuid, &pw, buf, sizeof (buf), &pwd) != 0 || pwd == NULL)