Print this page
NEX-18462 SMB can't view ACL if posix ID can't be mapped
Review by: Gordon Ross <gordon.ross@nexenta.com>
Review by: Evan Layton <evan.layton@nexenta.com>
NEX-14547 Get UNIX group info. from AD/LDAP with partial RFC2307 schema
NEX-13132 smbd dumping core in nss_ldap.so.1`getbymember
Reviewed by: Matt Barden <matt.barden@nexenta.com>
Reviewed by: Evan Layton <evan.layton@nexenta.com>
*** 18,27 ****
--- 18,28 ----
*
* CDDL HEADER END
*/
/*
* Copyright (c) 1999, 2010, Oracle and/or its affiliates. All rights reserved.
+ * Copyright 2018 Nexenta Systems, Inc. All rights reserved.
*/
#include "ldap_common.h"
#include <malloc.h>
#include <synch.h>
*** 102,111 ****
--- 103,113 ----
switch (rc) {
case NS_LDAP_SUCCESS:
return (NSS_SUCCESS);
case NS_LDAP_NOTFOUND:
+ errno = 0;
return (NSS_NOTFOUND);
case NS_LDAP_PARTIAL:
return (NSS_TRYAGAIN);
*** 244,261 ****
*/
/* ARGSUSED */
nss_status_t
_nss_ldap_nocb_lookup(ldap_backend_ptr be, nss_XbyY_args_t *argp,
! char *database, char *searchfilter, char *domain,
int (*init_filter_cb)(const ns_ldap_search_desc_t *desc,
char **realfilter, const void *userdata),
const void *userdata)
{
ns_ldap_error_t *error = NULL;
int rc;
#ifdef DEBUG
(void) fprintf(stdout, "\n[ldap_common.c: _nss_ldap_nocb_lookup]\n");
(void) fprintf(stdout, "\tsearchfilter: %s\n", searchfilter);
(void) fprintf(stdout, "\tdatabase: %s\n", database);
(void) fprintf(stdout,
--- 246,266 ----
*/
/* ARGSUSED */
nss_status_t
_nss_ldap_nocb_lookup(ldap_backend_ptr be, nss_XbyY_args_t *argp,
! char *database, char *searchfilter, const char * const *attrs,
int (*init_filter_cb)(const ns_ldap_search_desc_t *desc,
char **realfilter, const void *userdata),
const void *userdata)
{
ns_ldap_error_t *error = NULL;
int rc;
+ if (attrs == NULL)
+ attrs = be->attrs;
+
#ifdef DEBUG
(void) fprintf(stdout, "\n[ldap_common.c: _nss_ldap_nocb_lookup]\n");
(void) fprintf(stdout, "\tsearchfilter: %s\n", searchfilter);
(void) fprintf(stdout, "\tdatabase: %s\n", database);
(void) fprintf(stdout,
*** 263,273 ****
#endif /* DEBUG */
(void) __ns_ldap_freeResult(&be->result);
if ((rc = __ns_ldap_list(database, searchfilter, init_filter_cb,
! be->attrs, NULL, 0, &be->result, &error, NULL,
userdata)) != NS_LDAP_SUCCESS) {
if (argp != NULL)
argp->returnval = 0;
rc = switch_err(rc, error);
(void) __ns_ldap_freeError(&error);
--- 268,278 ----
#endif /* DEBUG */
(void) __ns_ldap_freeResult(&be->result);
if ((rc = __ns_ldap_list(database, searchfilter, init_filter_cb,
! attrs, NULL, 0, &be->result, &error, NULL,
userdata)) != NS_LDAP_SUCCESS) {
if (argp != NULL)
argp->returnval = 0;
rc = switch_err(rc, error);
(void) __ns_ldap_freeError(&error);