summaryrefslogtreecommitdiff
path: root/usr/src/lib/nsswitch
diff options
context:
space:
mode:
authorDan McDonald <danmcd@joyent.com>2021-03-31 14:47:38 -0400
committerDan McDonald <danmcd@joyent.com>2021-03-31 14:47:40 -0400
commitf2739712dfa5da3abbd7592fc410a479c3df7ff0 (patch)
treed7d7bf09295d3bd98c2da7f56aea1552b6e6d213 /usr/src/lib/nsswitch
parent9d6ec448872defb7278c9f6cfeb23f249f0f91cc (diff)
parent35d41f28ed229ff7c40e0acb85ce4465390ac9bb (diff)
downloadillumos-joyent-f2739712dfa5da3abbd7592fc410a479c3df7ff0.tar.gz
[illumos-gate merge]
commit 35d41f28ed229ff7c40e0acb85ce4465390ac9bb 13637 Support promiscuous mode on vioif interfaces commit 3bbba396f8599b5a3225ae7d8bb0119abdfaa427 13681 libfruraw: writing 1 byte into a region of size 0 commit fd8be61dc48514ff8e3bb97fdb04972e2765a6da 13651 libucb: cast between incompatible function types commit c1ba859699f12f01e0a0ae33b874b48f666aac62 13518 sun_sas: multiply-defined symbols commit 91b4b5393fe18d32505f967d482b81eef7f68d22 13650 sendmail: writing 1 byte into a region of size 0 commit 472cd20d26008f77084ade4c2048159b98c2b705 13668 mdns: update to mDNSResponder-1310.80.1 commit e4cc4004bc22385fe82642b211027316c120a5a5 13672 nvmeadm list could support parsable output commit 561433436929270392bcec8fb5afe3f73597dd55 13533 rdist: symbol 'buf' is multiply-defined commit 81de4da4caf1b6a02c80229f9f948f69e09f9719 13626 libsldap: implicit conversion from 'enum <anonymous>' commit a0570dbda2f64cada915185eb4e1b42c3b4bf755 13671 profiles -l can crash in ldap backend commit b89fc615f42c703d6100c78de04791708d190e5e 13658 exception_lists/cstyle has stale entries Conflicts: exception_lists/cstyle
Diffstat (limited to 'usr/src/lib/nsswitch')
-rw-r--r--usr/src/lib/nsswitch/ldap/common/getexecattr.c32
1 files changed, 17 insertions, 15 deletions
diff --git a/usr/src/lib/nsswitch/ldap/common/getexecattr.c b/usr/src/lib/nsswitch/ldap/common/getexecattr.c
index abd22908e0..fc44698267 100644
--- a/usr/src/lib/nsswitch/ldap/common/getexecattr.c
+++ b/usr/src/lib/nsswitch/ldap/common/getexecattr.c
@@ -21,6 +21,7 @@
/*
* Copyright 2009 Sun Microsystems, Inc. All rights reserved.
* Use is subject to license terms.
+ * Copyright 2021 Joyent, Inc.
*/
#include <secdb.h>
@@ -355,7 +356,7 @@ result_exec2str:
static nss_status_t
_exec_process_val(ldap_backend_ptr be, nss_XbyY_args_t *argp)
{
- int status;
+ int status;
nss_status_t nss_stat = NSS_UNAVAIL;
ns_ldap_attr_t *attrptr;
ns_ldap_entry_t *entry;
@@ -420,7 +421,7 @@ get_wild(ldap_backend_ptr be, nss_XbyY_args_t *argp, int getby_flag)
const char *policy = _priv_exec->policy;
const char *type = _priv_exec->type;
- if (strpbrk(policy, "*()\\") != NULL ||
+ if ((policy != NULL && strpbrk(policy, "*()\\") != NULL) ||
type != NULL && strpbrk(type, "*()\\") != NULL)
return ((nss_status_t)NSS_NOTFOUND);
@@ -446,11 +447,12 @@ get_wild(ldap_backend_ptr be, nss_XbyY_args_t *argp, int getby_flag)
switch (getby_flag) {
case NSS_DBOP_EXECATTR_BYID:
ret = snprintf(searchfilter, sizeof (searchfilter),
- _EXEC_GETEXECID, id, policy, ISWILD(type));
+ _EXEC_GETEXECID, id, ISWILD(policy), ISWILD(type));
if (ret >= sizeof (searchfilter) || ret < 0)
goto go_out;
ret = snprintf(userdata, sizeof (userdata),
- _EXEC_GETEXECID_SSD, id, policy, ISWILD(type));
+ _EXEC_GETEXECID_SSD, id, ISWILD(policy),
+ ISWILD(type));
if (ret >= sizeof (userdata) || ret < 0)
goto go_out;
break;
@@ -458,12 +460,12 @@ get_wild(ldap_backend_ptr be, nss_XbyY_args_t *argp, int getby_flag)
case NSS_DBOP_EXECATTR_BYNAMEID:
ret = snprintf(searchfilter, sizeof (searchfilter),
_EXEC_GETEXECNAMEID, name, id,
- policy, ISWILD(type));
+ ISWILD(policy), ISWILD(type));
if (ret >= sizeof (searchfilter) || ret < 0)
goto go_out;
ret = snprintf(userdata, sizeof (userdata),
_EXEC_GETEXECNAMEID_SSD, name, id,
- policy, ISWILD(type));
+ ISWILD(policy), ISWILD(type));
if (ret >= sizeof (userdata) || ret < 0)
goto go_out;
break;
@@ -484,8 +486,8 @@ go_out:
}
static nss_status_t
-exec_attr_process_val(ldap_backend_ptr be, nss_XbyY_args_t *argp) {
-
+exec_attr_process_val(ldap_backend_ptr be, nss_XbyY_args_t *argp)
+{
_priv_execattr *_priv_exec = (_priv_execattr *)(argp->key.attrp);
int stat, nss_stat = NSS_SUCCESS;
@@ -497,10 +499,10 @@ exec_attr_process_val(ldap_backend_ptr be, nss_XbyY_args_t *argp) {
if (argp->buf.result != NULL) {
/* file format -> execstr_t */
stat = (*argp->str2ent)(be->buffer,
- be->buflen,
- argp->buf.result,
- argp->buf.buffer,
- argp->buf.buflen);
+ be->buflen,
+ argp->buf.result,
+ argp->buf.buffer,
+ argp->buf.buflen);
if (stat == NSS_STR_PARSE_SUCCESS) {
argp->returnval = argp->buf.result;
argp->returnlen = 1; /* irrelevant */
@@ -544,16 +546,16 @@ getbynam(ldap_backend_ptr be, void *a)
const char *policy = _priv_exec->policy;
const char *type = _priv_exec->type;
- if (strpbrk(policy, "*()\\") != NULL ||
+ if (policy != NULL && strpbrk(policy, "*()\\") != NULL ||
type != NULL && strpbrk(type, "*()\\") != NULL ||
_ldap_filter_name(name, _priv_exec->name, sizeof (name)) != 0)
return ((nss_status_t)NSS_NOTFOUND);
ret = snprintf(searchfilter, sizeof (searchfilter),
- _EXEC_GETEXECNAME, name, policy, ISWILD(type));
+ _EXEC_GETEXECNAME, name, ISWILD(policy), ISWILD(type));
if (ret >= sizeof (searchfilter) || ret < 0)
return ((nss_status_t)NSS_NOTFOUND);
ret = snprintf(userdata, sizeof (userdata),
- _EXEC_GETEXECNAME_SSD, name, policy, ISWILD(type));
+ _EXEC_GETEXECNAME_SSD, name, ISWILD(policy), ISWILD(type));
if (ret >= sizeof (userdata) || ret < 0)
return ((nss_status_t)NSS_NOTFOUND);