Print this page
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>


   3  *
   4  * The contents of this file are subject to the terms of the
   5  * Common Development and Distribution License (the "License").
   6  * You may not use this file except in compliance with the License.
   7  *
   8  * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
   9  * or http://www.opensolaris.org/os/licensing.
  10  * See the License for the specific language governing permissions
  11  * and limitations under the License.
  12  *
  13  * When distributing Covered Code, include this CDDL HEADER in each
  14  * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
  15  * If applicable, add the following below this CDDL HEADER, with the
  16  * fields enclosed by brackets "[]" replaced with your own identifying
  17  * information: Portions Copyright [yyyy] [name of copyright owner]
  18  *
  19  * CDDL HEADER END
  20  */
  21 /*
  22  * Copyright (c) 1999, 2010, Oracle and/or its affiliates. All rights reserved.

  23  */
  24 
  25 #ifndef _LDAP_COMMON_H
  26 #define _LDAP_COMMON_H
  27 
  28 #ifdef  __cplusplus
  29 extern "C" {
  30 #endif
  31 
  32 #include <ctype.h>
  33 #include <nss_dbdefs.h>
  34 #include <stdlib.h>
  35 #include <string.h>
  36 #include <strings.h>
  37 #include <signal.h>
  38 #include <lber.h>
  39 #include <ldap.h>
  40 #include <pwd.h>
  41 #include "ns_sldap.h"
  42 


 122         int                     setcalled;
 123         const char              **attrs;
 124         ns_ldap_result_t        *result;
 125         fnf                     ldapobj2str;
 126         void                    *netgroup_cookie;
 127         void                    *services_cookie;
 128         char                    *toglue;
 129         char                    *buffer;
 130         int                     buflen;
 131         nss_ldap_db_type_t      db_type;
 132 };
 133 
 134 extern nss_status_t     _nss_ldap_destr(ldap_backend_ptr be, void *a);
 135 extern nss_status_t     _nss_ldap_endent(ldap_backend_ptr be, void *a);
 136 extern nss_status_t     _nss_ldap_setent(ldap_backend_ptr be, void *a);
 137 extern nss_status_t     _nss_ldap_getent(ldap_backend_ptr be, void *a);
 138 nss_backend_t           *_nss_ldap_constr(ldap_backend_op_t ops[], int nops,
 139                         char *tablename, const char **attrs, fnf ldapobj2str);
 140 extern nss_status_t     _nss_ldap_nocb_lookup(ldap_backend_ptr be,
 141                         nss_XbyY_args_t *argp, char *database,
 142                         char *searchfilter, char *domain,
 143                         int (*init_filter_cb)(
 144                                 const ns_ldap_search_desc_t *desc,
 145                                 char **realfilter, const void *userdata),
 146                         const void *userdata);
 147 extern nss_status_t     _nss_ldap_lookup(ldap_backend_ptr be,
 148                         nss_XbyY_args_t *argp, char *database,
 149                         char *searchfilter, char *domain,
 150                         int (*init_filter_cb)(
 151                                 const ns_ldap_search_desc_t *desc,
 152                                 char **realfilter, const void *userdata),
 153                         const void *userdata);
 154 extern void             _clean_ldap_backend(ldap_backend_ptr be);
 155 
 156 extern ns_ldap_attr_t *getattr(ns_ldap_result_t *result, int i);
 157 extern const char *_strip_quotes(char *ipaddress);
 158 extern int __nss2herrno(nss_status_t nsstat);
 159 extern int propersubdomain(char *domain, char *subdomain);
 160 extern int chophostdomain(char *string, char *host, char *domain);
 161 extern char *_get_domain_name(char *cdn);
 162 extern int _merge_SSD_filter(const ns_ldap_search_desc_t *desc,


   3  *
   4  * The contents of this file are subject to the terms of the
   5  * Common Development and Distribution License (the "License").
   6  * You may not use this file except in compliance with the License.
   7  *
   8  * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
   9  * or http://www.opensolaris.org/os/licensing.
  10  * See the License for the specific language governing permissions
  11  * and limitations under the License.
  12  *
  13  * When distributing Covered Code, include this CDDL HEADER in each
  14  * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
  15  * If applicable, add the following below this CDDL HEADER, with the
  16  * fields enclosed by brackets "[]" replaced with your own identifying
  17  * information: Portions Copyright [yyyy] [name of copyright owner]
  18  *
  19  * CDDL HEADER END
  20  */
  21 /*
  22  * Copyright (c) 1999, 2010, Oracle and/or its affiliates. All rights reserved.
  23  * Copyright 2017 Nexenta Systems, Inc.  All rights reserved.
  24  */
  25 
  26 #ifndef _LDAP_COMMON_H
  27 #define _LDAP_COMMON_H
  28 
  29 #ifdef  __cplusplus
  30 extern "C" {
  31 #endif
  32 
  33 #include <ctype.h>
  34 #include <nss_dbdefs.h>
  35 #include <stdlib.h>
  36 #include <string.h>
  37 #include <strings.h>
  38 #include <signal.h>
  39 #include <lber.h>
  40 #include <ldap.h>
  41 #include <pwd.h>
  42 #include "ns_sldap.h"
  43 


 123         int                     setcalled;
 124         const char              **attrs;
 125         ns_ldap_result_t        *result;
 126         fnf                     ldapobj2str;
 127         void                    *netgroup_cookie;
 128         void                    *services_cookie;
 129         char                    *toglue;
 130         char                    *buffer;
 131         int                     buflen;
 132         nss_ldap_db_type_t      db_type;
 133 };
 134 
 135 extern nss_status_t     _nss_ldap_destr(ldap_backend_ptr be, void *a);
 136 extern nss_status_t     _nss_ldap_endent(ldap_backend_ptr be, void *a);
 137 extern nss_status_t     _nss_ldap_setent(ldap_backend_ptr be, void *a);
 138 extern nss_status_t     _nss_ldap_getent(ldap_backend_ptr be, void *a);
 139 nss_backend_t           *_nss_ldap_constr(ldap_backend_op_t ops[], int nops,
 140                         char *tablename, const char **attrs, fnf ldapobj2str);
 141 extern nss_status_t     _nss_ldap_nocb_lookup(ldap_backend_ptr be,
 142                         nss_XbyY_args_t *argp, char *database,
 143                         char *searchfilter, const char * const *attrs,
 144                         int (*init_filter_cb)(
 145                                 const ns_ldap_search_desc_t *desc,
 146                                 char **realfilter, const void *userdata),
 147                         const void *userdata);
 148 extern nss_status_t     _nss_ldap_lookup(ldap_backend_ptr be,
 149                         nss_XbyY_args_t *argp, char *database,
 150                         char *searchfilter, char *domain,
 151                         int (*init_filter_cb)(
 152                                 const ns_ldap_search_desc_t *desc,
 153                                 char **realfilter, const void *userdata),
 154                         const void *userdata);
 155 extern void             _clean_ldap_backend(ldap_backend_ptr be);
 156 
 157 extern ns_ldap_attr_t *getattr(ns_ldap_result_t *result, int i);
 158 extern const char *_strip_quotes(char *ipaddress);
 159 extern int __nss2herrno(nss_status_t nsstat);
 160 extern int propersubdomain(char *domain, char *subdomain);
 161 extern int chophostdomain(char *string, char *host, char *domain);
 162 extern char *_get_domain_name(char *cdn);
 163 extern int _merge_SSD_filter(const ns_ldap_search_desc_t *desc,