diff options
author | Robert Mustacchi <rm@joyent.com> | 2015-04-16 15:01:56 +0000 |
---|---|---|
committer | Robert Mustacchi <rm@joyent.com> | 2015-04-17 10:10:38 -0700 |
commit | b01b59e369b297df1b370a7ef94d2b9230d04452 (patch) | |
tree | d7c9222a921580dc8e28e91de1523d6981d19093 /usr/src/cmd/pfexecd/pfexecd.c | |
parent | 3e8c3b95d57b4ab5caca2cc99b412489015c4858 (diff) | |
download | illumos-joyent-b01b59e369b297df1b370a7ef94d2b9230d04452.tar.gz |
5853 pfexec_call() error handling could be improved
5854 pfexecd should initialize pfexec response buffers
Reviewed by: Jerry Jelinek <jerry.jelinek@joyent.com>
Reviewed by: Richard Lowe <richlowe@richlowe.net>
Reviewed by: Dan McDonald <danmcd@omniti.com>
Reviewed by: Steven Williamson <steve@freeagent.com>
Approved by: Garrett D'Amore <garrett@damore.org>
Diffstat (limited to 'usr/src/cmd/pfexecd/pfexecd.c')
-rw-r--r-- | usr/src/cmd/pfexecd/pfexecd.c | 17 |
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) |