summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCasper H.S. Dik <Casper.Dik@Sun.COM>2010-05-22 12:44:18 +0200
committerCasper H.S. Dik <Casper.Dik@Sun.COM>2010-05-22 12:44:18 +0200
commitbf8599311c92f3dbd7e51f465d9da6668b81187d (patch)
tree7bebddedaa5956d2e1564f763257ce61d0aa6abe
parentcde58dbc6a23d4d38db7c8866312be83221c765f (diff)
downloadillumos-joyent-bf8599311c92f3dbd7e51f465d9da6668b81187d.tar.gz
6954245 pfexecd should try to remove the isa directory if the exec->attr == NULL.
6954626 libsecdb rewrite added a memory leak
-rw-r--r--usr/src/cmd/pfexecd/pfexecd.c8
-rw-r--r--usr/src/lib/libsecdb/common/chkauthattr.c4
2 files changed, 9 insertions, 3 deletions
diff --git a/usr/src/cmd/pfexecd/pfexecd.c b/usr/src/cmd/pfexecd/pfexecd.c
index b043c33e9c..c8ec8a12df 100644
--- a/usr/src/cmd/pfexecd/pfexecd.c
+++ b/usr/src/cmd/pfexecd/pfexecd.c
@@ -354,7 +354,7 @@ callback_pfexec(pfexec_arg_t *pap)
gid_t gid, egid;
struct passwd pw, *pwd;
char buf[1024];
- execattr_t *exec;
+ execattr_t *exec = NULL;
char *value;
priv_set_t *lset, *iset;
size_t mysz = repsz - 2 * setsz;
@@ -367,8 +367,10 @@ callback_pfexec(pfexec_arg_t *pap)
exec = getexecuser(pwd->pw_name, KV_COMMAND, path, GET_ONE);
- if (exec == NULL && removeisapath(path))
+ if ((exec == NULL || exec->attr == NULL) && removeisapath(path)) {
+ free_execattr(exec);
exec = getexecuser(pwd->pw_name, KV_COMMAND, path, GET_ONE);
+ }
if (exec == NULL) {
res->pfr_allowed = B_FALSE;
@@ -446,6 +448,8 @@ ret:
return;
stdexec:
+ free_execattr(exec);
+
res->pfr_scrubenv = B_FALSE;
res->pfr_setcred = B_FALSE;
res->pfr_allowed = B_TRUE;
diff --git a/usr/src/lib/libsecdb/common/chkauthattr.c b/usr/src/lib/libsecdb/common/chkauthattr.c
index 7f8be5aa4d..3e8e4edaac 100644
--- a/usr/src/lib/libsecdb/common/chkauthattr.c
+++ b/usr/src/lib/libsecdb/common/chkauthattr.c
@@ -170,8 +170,10 @@ _enum_common(const char *username,
}
}
free_userattr(ua);
- if (res != 0)
+ if (res != 0) {
+ free_proflist(profs, cnt);
return (res);
+ }
}
if ((cnt == 0 || strcmp(profs[cnt-1], PROFILE_STOP) != 0) &&