diff options
Diffstat (limited to 'usr/src')
-rw-r--r-- | usr/src/lib/libsldap/common/ns_reads.c | 309 | ||||
-rw-r--r-- | usr/src/pkg/manifests/driver-storage-nvme.mf | 3 |
2 files changed, 151 insertions, 161 deletions
diff --git a/usr/src/lib/libsldap/common/ns_reads.c b/usr/src/lib/libsldap/common/ns_reads.c index d4c6a1e477..0d112955d9 100644 --- a/usr/src/lib/libsldap/common/ns_reads.c +++ b/usr/src/lib/libsldap/common/ns_reads.c @@ -110,7 +110,8 @@ _freeControlList(LDAPControl ***ctrls) * */ static char * -_cvtRDN(const char *service, const char *rdn) { +_cvtRDN(const char *service, const char *rdn) +{ char **attrs, **mapped_attrs, **mapp, *type, *value, *attr; char *new_rdn = NULL; int nAttr = 0, i, attr_mapped, len = 0; @@ -119,7 +120,8 @@ _cvtRDN(const char *service, const char *rdn) { if ((attrs = ldap_explode_rdn(rdn, 0)) == NULL) return (NULL); - for (nAttr = 0; attrs[nAttr] != NULL; nAttr++); + for (nAttr = 0; attrs[nAttr] != NULL; nAttr++) + ; if ((mapped_attrs = (char **)calloc(nAttr, sizeof (char *))) == NULL) { ldap_value_free(attrs); @@ -130,7 +132,7 @@ _cvtRDN(const char *service, const char *rdn) { for (i = 0; i < nAttr; i++) { /* Parse type=value pair */ if ((type = strtok_r(attrs[i], "=", &value)) == NULL || - value == NULL) + value == NULL) goto cleanup; /* Reverse map: e.g. cn-sm -> cn */ mapp = __ns_ldap_getOrigAttribute(service, type); @@ -147,8 +149,7 @@ _cvtRDN(const char *service, const char *rdn) { __s_api_free2dArray(mapp); goto cleanup; } - (void) snprintf(attr, len, "%s=%s", - type, value); + (void) snprintf(attr, len, "%s=%s", type, value); mapped_attrs[i] = attr; } else { /* @@ -217,7 +218,8 @@ cleanup: * non-NULL: A converted DN and the memory is allocated */ static char * -_cvtDN(const char *service, const char *dn) { +_cvtDN(const char *service, const char *dn) +{ char **mapped_rdns; char **rdns, *new_rdn, *new_dn = NULL; int nRdn = 0, i, len = 0, rdn_mapped; @@ -300,12 +302,8 @@ cleanup: */ static int -__s_api_cvtEntry(LDAP *ld, - const char *service, - LDAPMessage *e, - int flags, - ns_ldap_entry_t **ret, - ns_ldap_error_t **error) +__s_api_cvtEntry(LDAP *ld, const char *service, LDAPMessage *e, int flags, + ns_ldap_entry_t **ret, ns_ldap_error_t **error) { ns_ldap_entry_t *ep = NULL; @@ -512,8 +510,9 @@ __s_api_cvtEntry(LDAP *ld, if (strcasecmp(mapping[0], "gecos") == 0) { ap[j]->attrname = strdup(attr); gecos_mapping_existed = TRUE; - } else + } else { ap[j]->attrname = strdup(mapping[0]); + } if (ap[j]->attrname == NULL) { ber_free(ber, 0); @@ -847,8 +846,7 @@ __s_api_getEntry(ns_ldap_cookie_t *cookie) } static int -__s_api_get_cachemgr_data(const char *type, - const char *from, char **to) +__s_api_get_cachemgr_data(const char *type, const char *from, char **to) { union { ldap_data_t s_d; @@ -897,8 +895,7 @@ __s_api_get_cachemgr_data(const char *type, } static int -__s_api_set_cachemgr_data(const char *type, - const char *from, const char *to) +__s_api_set_cachemgr_data(const char *type, const char *from, const char *to) { union { ldap_data_t s_d; @@ -1073,14 +1070,14 @@ get_mapped_filter(ns_ldap_cookie_t *cookie, char **new_filter) char *key, *tail, *head; char errstr[MAXERROR]; int num_eq = 0, num_veq = 0; - int in_quote = FALSE; - int is_value = FALSE; + boolean_t in_quote = B_FALSE; + boolean_t is_value = B_FALSE; int i, j, oc_len, len; - int at_least_one = FALSE; + boolean_t at_least_one = B_FALSE; filter_mapping_info_t **info, *info1; char **mapping; char *service, *filter, *err; - int auto_service = FALSE; + boolean_t auto_service = B_FALSE; if (cookie == NULL || new_filter == NULL) return (NS_LDAP_INVALID_PARAM); @@ -1171,7 +1168,7 @@ get_mapped_filter(ns_ldap_cookie_t *cookie, char **new_filter) if (!in_quote && !is_value) { info1 = (filter_mapping_info_t *)calloc(1, sizeof (filter_mapping_info_t)); - if (!info1) { + if (info1 == NULL) { free(filter_c); for (i = 0; i < num_veq; i++) free(info[i]); @@ -1188,7 +1185,7 @@ get_mapped_filter(ns_ldap_cookie_t *cookie, char **new_filter) /* * skip until the end of the attribute value */ - is_value = TRUE; + is_value = B_TRUE; } break; case CPARATOK: @@ -1196,13 +1193,13 @@ get_mapped_filter(ns_ldap_cookie_t *cookie, char **new_filter) * mark the end of the attribute value */ if (!in_quote) - is_value = FALSE; + is_value = B_FALSE; break; case QUOTETOK: /* * switch on/off the in_quote mode */ - in_quote = (in_quote == FALSE); + in_quote = (in_quote == B_FALSE); break; case '\\': /* @@ -1941,8 +1938,8 @@ setup_simplepg_params(ns_ldap_cookie_t *cookie) static void proc_result_referrals(ns_ldap_cookie_t *cookie) { - int errCode, i, rc; - char **referrals = NULL; + int errCode, i, rc; + char **referrals = NULL; /* * Only follow one level of referrals, i.e. @@ -1987,8 +1984,8 @@ proc_result_referrals(ns_ldap_cookie_t *cookie) static void proc_search_references(ns_ldap_cookie_t *cookie) { - char **refurls = NULL; - int i, rc; + char **refurls = NULL; + int i, rc; /* * Only follow one level of referrals, i.e. @@ -2035,11 +2032,11 @@ multi_result(ns_ldap_cookie_t *cookie) LDAPControl **retCtrls = NULL; int i, rc; int errCode; - int finished = 0; + boolean_t finished = B_FALSE; unsigned long target_posp = 0; unsigned long list_size = 0; unsigned int count = 0; - char **referrals = NULL; + char **referrals = NULL; if (cookie->listType == VLVCTRLFLAG) { rc = ldap_parse_result(cookie->conn->ld, cookie->resultMsg, @@ -2097,10 +2094,10 @@ multi_result(ns_ldap_cookie_t *cookie) cookie->index = target_posp + LISTPAGESIZE; if (cookie->index > list_size) - finished = 1; + finished = B_TRUE; } else { if (cookie->entryCount < LISTPAGESIZE) - finished = 1; + finished = B_TRUE; else cookie->index += cookie->entryCount; @@ -2108,9 +2105,9 @@ multi_result(ns_ldap_cookie_t *cookie) } ldap_controls_free(retCtrls); retCtrls = NULL; + } else { + finished = B_TRUE; } - else - finished = 1; } else if (cookie->listType == SIMPLEPAGECTRLFLAG) { rc = ldap_parse_result(cookie->conn->ld, cookie->resultMsg, &errCode, NULL, NULL, &referrals, &retCtrls, 0); @@ -2165,13 +2162,13 @@ multi_result(ns_ldap_cookie_t *cookie) if ((cookie->ctrlCookie == NULL) || (cookie->ctrlCookie->bv_val == NULL) || (cookie->ctrlCookie->bv_len == 0)) - finished = 1; + finished = B_TRUE; } ldap_controls_free(retCtrls); retCtrls = NULL; + } else { + finished = B_TRUE; } - else - finished = 1; } if (!finished && cookie->listType == VLVCTRLFLAG) return (NEXT_VLV); @@ -2458,9 +2455,10 @@ search_state_machine(ns_ldap_cookie_t *cookie, ns_state_t state, int cycle) if (cookie->reinit_on_retriable_err) { cookie->err_rc = rc; cookie->new_state = REINIT; - } else + } else { cookie->new_state = NEXT_SESSION; + } /* * If not able to reach the @@ -2628,9 +2626,10 @@ search_state_machine(ns_ldap_cookie_t *cookie, ns_state_t state, int cycle) cookie->err_rc = rc; cookie->err_from_result = 1; cookie->new_state = REINIT; - } else + } else { cookie->new_state = NEXT_SESSION; + } break; } if ((rc == LDAP_CONNECT_ERROR || @@ -2763,9 +2762,10 @@ search_state_machine(ns_ldap_cookie_t *cookie, ns_state_t state, int cycle) cookie->err_rc = rc; cookie->err_from_result = 1; cookie->new_state = REINIT; - } else + } else { cookie->new_state = NEXT_SESSION; + } break; } @@ -2850,7 +2850,7 @@ search_state_machine(ns_ldap_cookie_t *cookie, ns_state_t state, int cycle) /* * XXX DO WE NEED THIS CASE? * if (search is complete) { - * cookie->new_state = EXIT; + * cookie->new_state = EXIT; * } else */ /* @@ -2872,10 +2872,10 @@ search_state_machine(ns_ldap_cookie_t *cookie, ns_state_t state, int cycle) cookie->refpos = cookie->refpos->next; /* check see if done with all referrals */ - if (cookie->refpos != NULL) + if (cookie->refpos != NULL) { cookie->new_state = GET_REFERRAL_SESSION; - else { + } else { __s_api_deleteRefInfo(cookie->reflist); cookie->reflist = NULL; cookie->new_state = @@ -2885,9 +2885,9 @@ search_state_machine(ns_ldap_cookie_t *cookie, ns_state_t state, int cycle) } break; case GET_REFERRAL_SESSION: - if (get_referral_session(cookie) < 0) + if (get_referral_session(cookie) < 0) { cookie->new_state = EXIT; - else { + } else { cookie->new_state = NEXT_SEARCH; } break; @@ -2910,11 +2910,12 @@ search_state_machine(ns_ldap_cookie_t *cookie, ns_state_t state, int cycle) ldap_err2string( cookie->err_rc)); } - } else + } else { (void) sprintf(errstr, gettext("LDAP ERROR (%d): %s."), cookie->err_rc, ldap_err2string(cookie->err_rc)); + } err = strdup(errstr); if (cookie->err_from_result) { if (cookie->err_rc == LDAP_SERVER_DOWN) { @@ -3252,8 +3253,9 @@ ldap_list( if (conn_user != NULL && conn_user->ns_error != NULL) { *errorp = conn_user->ns_error; conn_user->ns_error = NULL; - } else + } else { *errorp = cookie->errorp; + } } *rResult = cookie->result; from_result = cookie->err_from_result; @@ -3671,8 +3673,9 @@ find_domainname(const char *dn, char **domainname, const ns_cred_t *cred, if (conn_user != NULL && conn_user->ns_error != NULL) { *errorp = conn_user->ns_error; conn_user->ns_error = NULL; - } else + } else { *errorp = cookie->errorp; + } } if (cookie->result == NULL) rc = NS_LDAP_NOTFOUND; @@ -4060,13 +4063,9 @@ __ns_ldap_freeResult(ns_ldap_result_t **result) return (NS_LDAP_SUCCESS); } -/*ARGSUSED*/ int -__ns_ldap_auth(const ns_cred_t *auth, - const int flags, - ns_ldap_error_t **errorp, - LDAPControl **serverctrls, - LDAPControl **clientctrls) +__ns_ldap_auth(const ns_cred_t *auth, const int flags, ns_ldap_error_t **errorp, + LDAPControl **serverctrls __unused, LDAPControl **clientctrls __unused) { ConnectionID connectionId = -1; @@ -4082,7 +4081,7 @@ __ns_ldap_auth(const ns_cred_t *auth, #endif *errorp = NULL; - if (!auth) + if (auth == NULL) return (NS_LDAP_INVALID_PARAM); conn_user = __s_api_conn_user_init(NS_CONN_USER_AUTH, @@ -4133,19 +4132,16 @@ __ns_ldap_getAttrStruct(const ns_ldap_entry_t *entry, const char *attrname) } -/*ARGSUSED*/ int -__ns_ldap_uid2dn(const char *uid, - char **userDN, - const ns_cred_t *cred, /* cred is ignored */ - ns_ldap_error_t **errorp) +__ns_ldap_uid2dn(const char *uid, char **userDN, const ns_cred_t *cred, + ns_ldap_error_t **errorp) { ns_ldap_result_t *result = NULL; char *filter, *userdata; char errstr[MAXERROR]; char **value; int rc = 0; - int i = 0; + int i; size_t len; *errorp = NULL; @@ -4153,19 +4149,17 @@ __ns_ldap_uid2dn(const char *uid, if ((uid == NULL) || (uid[0] == '\0')) return (NS_LDAP_INVALID_PARAM); - while (uid[i] != '\0') { + for (i = 0; uid[i] != '\0'; i++) { if (uid[i] == '=') { *userDN = strdup(uid); return (NS_LDAP_SUCCESS); } - i++; } - i = 0; - while ((uid[i] != '\0') && (isdigit(uid[i]))) - i++; + for (i = 0; (uid[i] != '\0') && isdigit(uid[i]); i++) + ; if (uid[i] == '\0') { len = strlen(UIDNUMFILTER) + strlen(uid) + 1; - filter = (char *)malloc(len); + filter = malloc(len); if (filter == NULL) { *userDN = NULL; return (NS_LDAP_MEMORY); @@ -4173,15 +4167,16 @@ __ns_ldap_uid2dn(const char *uid, (void) snprintf(filter, len, UIDNUMFILTER, uid); len = strlen(UIDNUMFILTER_SSD) + strlen(uid) + 1; - userdata = (char *)malloc(len); + userdata = malloc(len); if (userdata == NULL) { *userDN = NULL; + free(filter); return (NS_LDAP_MEMORY); } (void) snprintf(userdata, len, UIDNUMFILTER_SSD, uid); } else { len = strlen(UIDFILTER) + strlen(uid) + 1; - filter = (char *)malloc(len); + filter = malloc(len); if (filter == NULL) { *userDN = NULL; return (NS_LDAP_MEMORY); @@ -4189,9 +4184,10 @@ __ns_ldap_uid2dn(const char *uid, (void) snprintf(filter, len, UIDFILTER, uid); len = strlen(UIDFILTER_SSD) + strlen(uid) + 1; - userdata = (char *)malloc(len); + userdata = malloc(len); if (userdata == NULL) { *userDN = NULL; + free(filter); return (NS_LDAP_MEMORY); } (void) snprintf(userdata, len, UIDFILTER_SSD, uid); @@ -4242,12 +4238,9 @@ static const char *dn2uid_attrs[] = { (char *)NULL }; -/*ARGSUSED*/ int -__ns_ldap_dn2uid(const char *dn, - char **userID, - const ns_cred_t *cred, /* cred is ignored */ - ns_ldap_error_t **errorp) +__ns_ldap_dn2uid(const char *dn, char **userID, const ns_cred_t *cred, + ns_ldap_error_t **errorp) { ns_ldap_result_t *result = NULL; char *filter, *userdata; @@ -4262,15 +4255,16 @@ __ns_ldap_dn2uid(const char *dn, return (NS_LDAP_INVALID_PARAM); len = strlen(UIDDNFILTER) + strlen(dn) + 1; - filter = (char *)malloc(len); + filter = malloc(len); if (filter == NULL) { return (NS_LDAP_MEMORY); } (void) snprintf(filter, len, UIDDNFILTER, dn); len = strlen(UIDDNFILTER_SSD) + strlen(dn) + 1; - userdata = (char *)malloc(len); + userdata = malloc(len); if (userdata == NULL) { + free(filter); return (NS_LDAP_MEMORY); } (void) snprintf(userdata, len, UIDDNFILTER_SSD, dn); @@ -4315,13 +4309,9 @@ out: return (rc); } -/*ARGSUSED*/ int -__ns_ldap_host2dn(const char *host, - const char *domain, - char **hostDN, - const ns_cred_t *cred, /* cred is ignored */ - ns_ldap_error_t **errorp) +__ns_ldap_host2dn(const char *host, const char *domain, char **hostDN, + const ns_cred_t *cred, ns_ldap_error_t **errorp) { ns_ldap_result_t *result = NULL; char *filter, *userdata; @@ -4330,26 +4320,28 @@ __ns_ldap_host2dn(const char *host, int rc; size_t len; -/* - * XXX - * the domain parameter needs to be used in case domain is not local, if - * this routine is to support multi domain setups, it needs lots of work... - */ + /* + * XXX + * the domain parameter needs to be used in case domain is not local, + * if this routine is to support multi domain setups, it needs lots + * of work... + */ *errorp = NULL; *hostDN = NULL; if ((host == NULL) || (host[0] == '\0')) return (NS_LDAP_INVALID_PARAM); len = strlen(HOSTFILTER) + strlen(host) + 1; - filter = (char *)malloc(len); + filter = malloc(len); if (filter == NULL) { return (NS_LDAP_MEMORY); } (void) snprintf(filter, len, HOSTFILTER, host); len = strlen(HOSTFILTER_SSD) + strlen(host) + 1; - userdata = (char *)malloc(len); + userdata = malloc(len); if (userdata == NULL) { + free(filter); return (NS_LDAP_MEMORY); } (void) snprintf(userdata, len, HOSTFILTER_SSD, host); @@ -4393,12 +4385,9 @@ __ns_ldap_host2dn(const char *host, return (NS_LDAP_SUCCESS); } -/*ARGSUSED*/ int -__ns_ldap_dn2domain(const char *dn, - char **domain, - const ns_cred_t *cred, - ns_ldap_error_t **errorp) +__ns_ldap_dn2domain(const char *dn, char **domain, const ns_cred_t *cred, + ns_ldap_error_t **errorp) { int rc, pnum, i, j, len = 0; char *newdn, **rdns = NULL; @@ -4501,14 +4490,13 @@ __ns_ldap_dn2domain(const char *dn, return (rc); } -/*ARGSUSED*/ int -__ns_ldap_getServiceAuthMethods(const char *service, - ns_auth_t ***auth, - ns_ldap_error_t **errorp) +__ns_ldap_getServiceAuthMethods(const char *service, ns_auth_t ***auth, + ns_ldap_error_t **errorp) { char errstr[MAXERROR]; - int rc, i, done = 0; + int rc, i; + boolean_t done = B_FALSE; int slen; void **param; char **sam, *srv, *send; @@ -4547,8 +4535,8 @@ __ns_ldap_getServiceAuthMethods(const char *service, continue; send = srv; srv++; - for (max = 1; (send = strchr(++send, SEMITOK)) != NULL; - max++) {} + for (max = 1; (send = strchr(++send, SEMITOK)) != NULL; max++) + ; authpp = (ns_auth_t **)calloc(++max, sizeof (ns_auth_t *)); if (authpp == NULL) { (void) __ns_ldap_freeParam(¶m); @@ -4580,7 +4568,7 @@ __ns_ldap_getServiceAuthMethods(const char *service, } authpp[cnt++] = ap; if (send == NULL) - done = TRUE; + done = B_TRUE; else srv = send; } @@ -4613,7 +4601,8 @@ __ns_ldap_getServiceAuthMethods(const char *service, int __s_api_convert_automountmapname(const char *service, char **dn, - ns_ldap_error_t **errp) { + ns_ldap_error_t **errp) +{ char **mapping = NULL; char *mapped_attr = NULL; @@ -4639,9 +4628,10 @@ __s_api_convert_automountmapname(const char *service, char **dn, * if no mapped attribute for auto_xxx, try automount */ - if (mapping == NULL) + if (mapping == NULL) { mapping = __ns_ldap_getMappedAttributes( - "automount", automountmapname); + "automount", automountmapname); + } /* * if no mapped attribute is found, return SUCCESS (no op) @@ -4665,12 +4655,11 @@ __s_api_convert_automountmapname(const char *service, char **dn, __s_api_free2dArray(mapping); (void) snprintf(errstr, (2 * MAXERROR), - gettext( - "Attribute nisMapName is mapped to an " - "empty string.\n")); + gettext("Attribute nisMapName is mapped to an " + "empty string.\n")); MKERROR(LOG_ERR, *errp, NS_CONFIG_SYNTAX, - strdup(errstr), NS_LDAP_MEMORY); + strdup(errstr), NS_LDAP_MEMORY); return (NS_LDAP_CONFIG); } @@ -4681,8 +4670,8 @@ __s_api_convert_automountmapname(const char *service, char **dn, */ rc = __s_api_replace_mapped_attr_in_dn( - (const char *) automountmapname, (const char *) mapped_attr, - (const char *) *dn, &buffer); + (const char *) automountmapname, (const char *) mapped_attr, + (const char *) *dn, &buffer); /* clean up */ @@ -4707,21 +4696,22 @@ __s_api_convert_automountmapname(const char *service, char **dn, /* * If the mapped attr is found in the dn, - * return NS_LDAP_SUCCESS and a new_dn. + * return NS_LDAP_SUCCESS and a new_dn. * If no mapped attr is found, - * return NS_LDAP_SUCCESS and *new_dn == NULL + * return NS_LDAP_SUCCESS and *new_dn == NULL * If there is not enough memory, - * return NS_LDAP_MEMORY and *new_dn == NULL + * return NS_LDAP_MEMORY and *new_dn == NULL */ int -__s_api_replace_mapped_attr_in_dn( - const char *orig_attr, const char *mapped_attr, - const char *dn, char **new_dn) { +__s_api_replace_mapped_attr_in_dn(const char *orig_attr, + const char *mapped_attr, const char *dn, char **new_dn) +{ char **dnArray = NULL; char *cur = NULL, *start = NULL; - int i = 0, found = 0; + int i = 0; + boolean_t found = B_FALSE; int len = 0, orig_len = 0, mapped_len = 0; int dn_len = 0, tmp_len = 0; @@ -4749,9 +4739,10 @@ __s_api_replace_mapped_attr_in_dn( cur = strchr(dnArray[i], '='); *cur = '\0'; if (strcasecmp(mapped_attr, dnArray[i]) == 0) - found = 1; + found = B_TRUE; *cur = '='; - if (found) break; + if (found) + break; } if (!found) { @@ -4789,14 +4780,14 @@ __s_api_replace_mapped_attr_in_dn( /* copy the portion before mapped attr in dn */ start = *new_dn; tmp_len = cur - dn; - (void) memcpy((void *) start, (const void*) dn, tmp_len); + (void) memcpy(start, dn, tmp_len); /* * Copy the orig_attr. e.g. automountMapName * This replaces mapped attr with orig attr */ start = start + (cur - dn); /* move cursor in buffer */ - (void) memcpy((void *) start, (const void*) orig_attr, orig_len); + (void) memcpy(start, orig_attr, orig_len); /* * Copy the portion after mapped attr in dn @@ -4844,21 +4835,22 @@ resync_str(char *str, char *next, char c) static char * find_right_paren(char *s) { - int balance, escape; + int balance; + boolean_t escape; balance = 1; - escape = 0; + escape = B_FALSE; while (*s && balance) { - if (escape == 0) { + if (escape == B_FALSE) { if (*s == '(') balance++; else if (*s == ')') balance--; } - if (*s == '\\' && ! escape) - escape = 1; + if (*s == '\\' && !escape) + escape = B_TRUE; else - escape = 0; + escape = B_FALSE; if (balance) s++; } @@ -4894,9 +4886,10 @@ adj_complex_filter(char *str) static int adj_filter(char *str) { - char *next; - int parens, balance, escape; - char *np, *cp, *dp; + char *next; + int parens, balance; + boolean_t escape; + char *np, *cp, *dp; parens = 0; while (*str) { @@ -4952,19 +4945,19 @@ adj_filter(char *str) default: balance = 1; - escape = 0; + escape = B_FALSE; next = str; while (*next && balance) { - if (escape == 0) { + if (escape == B_FALSE) { if (*next == '(') balance++; else if (*next == ')') balance--; } - if (*next == '\\' && ! escape) - escape = 1; + if (*next == '\\' && !escape) + escape = B_TRUE; else - escape = 0; + escape = B_FALSE; if (balance) next++; } @@ -5117,7 +5110,7 @@ adj_simple_filter(char *str) *s = '\0'; } - if (! is_valid_attr(str)) { + if (!is_valid_attr(str)) { goto free_and_return; } @@ -5193,11 +5186,11 @@ free_and_return: static int unescape_filterval(char *val) { - int escape, firstdigit; - char *s; + boolean_t escape, firstdigit; + char *s; - firstdigit = 0; - escape = 0; + firstdigit = B_FALSE; + escape = B_FALSE; for (s = val; *s; s++) { if (escape) { /* @@ -5208,23 +5201,23 @@ unescape_filterval(char *val) /* * LDAPv2 (RFC1960) escape sequence */ - escape = 0; + escape = B_FALSE; } else { return (-1); } } if (firstdigit) { - firstdigit = 0; + firstdigit = B_FALSE; } else { - escape = 0; + escape = B_FALSE; } } else if (*s != '\\') { - escape = 0; + escape = B_FALSE; } else { - escape = 1; - firstdigit = 1; + escape = B_TRUE; + firstdigit = B_TRUE; } } @@ -5305,9 +5298,9 @@ validate_filter(ns_ldap_cookie_t *cookie) static int setup_acctmgmt_params(ns_ldap_cookie_t *cookie) { - LDAPControl *req = NULL, **requestctrls; + LDAPControl *req, **requestctrls; - req = (LDAPControl *)malloc(sizeof (LDAPControl)); + req = calloc(1, sizeof (LDAPControl)); if (req == NULL) return (NS_LDAP_MEMORY); @@ -5319,8 +5312,6 @@ setup_acctmgmt_params(ns_ldap_cookie_t *cookie) free(req); return (NS_LDAP_MEMORY); } - req->ldctl_value.bv_len = 0; - req->ldctl_value.bv_val = NULL; requestctrls = (LDAPControl **)calloc(2, sizeof (LDAPControl *)); if (requestctrls == NULL) { @@ -5348,9 +5339,9 @@ setup_acctmgmt_params(ns_ldap_cookie_t *cookie) * +t: tag is 0 * +b: TRUE if inactive due to account inactivation * +t: tag is 1 - * +b: TRUE if password has been reset + * +b: TRUE if password has been reset * +t: tag is 2 - * +b: TRUE if password is expired + * +b: TRUE if password is expired * +t: tag is 3 * +i: contains num of remaining grace, 0 means no grace * +t: tag is 4 @@ -5589,7 +5580,7 @@ parse_acct_cont_resp_msg(LDAPControl **ectrls, AcctUsableResponse_t *acctResp) { int rc = NS_LDAP_SUCCESS; BerElement *ber; - ber_tag_t tag; + ber_tag_t tag; ber_len_t len; int i; char errstr[MAXERROR]; @@ -5732,10 +5723,9 @@ parse_acct_cont_resp_msg(LDAPControl **ectrls, AcctUsableResponse_t *acctResp) */ static int getAcctMgmt(const char *user, AcctUsableResponse_t *acctResp, - ns_conn_user_t *conn_user) + ns_conn_user_t *conn_user) { int scope, rc; - char ldapfilter[1024]; ns_ldap_cookie_t *cookie; ns_ldap_search_desc_t **sdlist = NULL; ns_ldap_search_desc_t *dptr; @@ -5825,8 +5815,7 @@ getAcctMgmt(const char *user, AcctUsableResponse_t *acctResp, } /* search for entries for this particular uid */ - (void) snprintf(ldapfilter, sizeof (ldapfilter), "(uid=%s)", user); - cookie->i_filter = strdup(ldapfilter); + (void) asprintf(&cookie->i_filter, "(uid=%s)", user); if (cookie->i_filter == NULL) { rc = NS_LDAP_MEMORY; goto out; diff --git a/usr/src/pkg/manifests/driver-storage-nvme.mf b/usr/src/pkg/manifests/driver-storage-nvme.mf index 4c8d39cacb..3b3d7824bf 100644 --- a/usr/src/pkg/manifests/driver-storage-nvme.mf +++ b/usr/src/pkg/manifests/driver-storage-nvme.mf @@ -15,6 +15,7 @@ # # Copyright 2016 Nexenta Systems, Inc. All rights reserved. +# Copyright 2019 OmniOS Community Edition (OmniOSce) Association. # # @@ -42,7 +43,7 @@ driver name=nvme class=disk perms="* 0600 root sys" \ alias=pciclass,010802 \ alias=pciexclass,010802 file path=kernel/drv/$(ARCH64)/nvme group=sys -file path=kernel/drv/nvme.conf group=sys +file path=kernel/drv/nvme.conf group=sys preserve=renamenew file path=usr/sbin/nvmeadm mode=0555 file path=usr/share/man/man1m/nvmeadm.1m file path=usr/share/man/man7d/nvme.7d |