The branch, master has been updated
       via  fef69a1 smbldap: Bump version number
       via  e4d013c smbldap: Privatize struct smbldap_state
       via  848067a smbldap: Introduce "smbldap_get_paged_results"
       via  84b7125 smbldap: Introduce "smbldap_get_paged_results"
       via  46968fc smbldap: Introduce "smbldap_get_ldap"
       via  ebc80f4 smbldap: Fix a typo
      from  9f7ed6b autobuild: Do not require cmocka to be installed for 
samba-libs to build

https://git.samba.org/?p=samba.git;a=shortlog;h=master


- Log -----------------------------------------------------------------
commit fef69a132be265398c693183c2cd69b7e5ff6068
Author: Volker Lendecke <[email protected]>
Date:   Wed Apr 19 14:54:11 2017 +0200

    smbldap: Bump version number
    
    Signed-off-by: Volker Lendecke <[email protected]>
    Reviewed-by: Alexander Bokovoy <[email protected]>
    Reviewed-by: Ralph Böhme <[email protected]>
    
    Autobuild-User(master): Volker Lendecke <[email protected]>
    Autobuild-Date(master): Thu Apr 20 14:23:14 CEST 2017 on sn-devel-144

commit e4d013caa2c6d65e4632cb1bc79fd49ec86391cd
Author: Volker Lendecke <[email protected]>
Date:   Wed Apr 19 13:43:39 2017 +0200

    smbldap: Privatize struct smbldap_state
    
    Signed-off-by: Volker Lendecke <[email protected]>
    Reviewed-by: Alexander Bokovoy <[email protected]>
    Reviewed-by: Ralph Böhme <[email protected]>

commit 848067abbcf62d68e25a4f069237787163aea8e6
Author: Volker Lendecke <[email protected]>
Date:   Wed Apr 19 13:39:25 2017 +0200

    smbldap: Introduce "smbldap_get_paged_results"
    
    This should be hidden inside smbldap.c, but this is a quick way to
    get smbldap_state private to smbldap.c
    
    Signed-off-by: Volker Lendecke <[email protected]>
    Reviewed-by: Alexander Bokovoy <[email protected]>
    Reviewed-by: Ralph Böhme <[email protected]>

commit 84b7125b990e1742e742bf2919aaf753df345726
Author: Volker Lendecke <[email protected]>
Date:   Wed Apr 19 13:39:25 2017 +0200

    smbldap: Introduce "smbldap_get_paged_results"
    
    Signed-off-by: Volker Lendecke <[email protected]>
    Reviewed-by: Alexander Bokovoy <[email protected]>
    Reviewed-by: Ralph Böhme <[email protected]>

commit 46968fc60fa6a5c001c79407c71563af2807a440
Author: Volker Lendecke <[email protected]>
Date:   Wed Apr 19 13:29:31 2017 +0200

    smbldap: Introduce "smbldap_get_ldap"
    
    This is a pretty big boiler-plate change. I've renamed the struct member
    temporarily to find all accessors. Not sure where this leads in the end, but
    the goal is to make struct smbldap_struct private to smbldap.c
    
    Signed-off-by: Volker Lendecke <[email protected]>
    Reviewed-by: Alexander Bokovoy <[email protected]>
    Reviewed-by: Ralph Böhme <[email protected]>

commit ebc80f4ac3eb4edaec1fd6354d1dcab625ded0cd
Author: Volker Lendecke <[email protected]>
Date:   Tue Apr 18 20:49:12 2017 +0200

    smbldap: Fix a typo
    
    Signed-off-by: Volker Lendecke <[email protected]>
    Reviewed-by: Alexander Bokovoy <[email protected]>
    Reviewed-by: Ralph Böhme <[email protected]>

-----------------------------------------------------------------------

Summary of changes:
 source3/include/smbldap.h                          |  30 +-
 source3/lib/ABI/{smbldap-0.sigs => smbldap-1.sigs} |   3 +
 source3/lib/smbldap.c                              | 100 +++--
 source3/passdb/pdb_ldap.c                          | 418 +++++++++++++--------
 source3/passdb/pdb_ldap_util.c                     |   9 +-
 source3/passdb/pdb_nds.c                           |  16 +-
 source3/winbindd/idmap_ldap.c                      |  52 +--
 source3/winbindd/idmap_rfc2307.c                   |   2 +-
 source3/wscript_build                              |   2 +-
 9 files changed, 392 insertions(+), 240 deletions(-)
 copy source3/lib/ABI/{smbldap-0.sigs => smbldap-1.sigs} (93%)


Changeset truncated at 500 lines:

diff --git a/source3/include/smbldap.h b/source3/include/smbldap.h
index b287d62..6af0806 100644
--- a/source3/include/smbldap.h
+++ b/source3/include/smbldap.h
@@ -33,30 +33,7 @@
  *
  */
 
-struct smbldap_state {
-       LDAP *ldap_struct;
-       pid_t pid;
-       time_t last_ping; /* monotonic */
-       /* retrive-once info */
-       const char *uri;
-
-       /* credentials */
-       bool anonymous;
-       char *bind_dn;
-       char *bind_secret;
-       int (*bind_callback)(LDAP *ldap_struct, struct smbldap_state 
*ldap_state, void *data);
-       void *bind_callback_data;
-
-       bool paged_results;
-
-       unsigned int num_failures;
-
-       time_t last_use; /* monotonic */
-       struct tevent_context *tevent_context;
-       struct tevent_timer *idle_event;
-
-       struct timeval last_rebind; /* monotonic */
-};
+struct smbldap_state;
 
 /* The following definitions come from lib/smbldap.c  */
 
@@ -68,6 +45,11 @@ NTSTATUS smbldap_init(TALLOC_CTX *mem_ctx,
                      const char *bind_secret,
                      struct smbldap_state **smbldap_state);
 
+LDAP *smbldap_get_ldap(struct smbldap_state *state);
+bool smbldap_get_paged_results(struct smbldap_state *state);
+void smbldap_set_paged_results(struct smbldap_state *state,
+                              bool paged_results);
+
 void smbldap_set_mod (LDAPMod *** modlist, int modop, const char *attribute, 
const char *value);
 void smbldap_set_mod_blob(LDAPMod *** modlist, int modop, const char 
*attribute, const DATA_BLOB *newblob);
 void smbldap_make_mod(LDAP *ldap_struct, LDAPMessage *existing,
diff --git a/source3/lib/ABI/smbldap-0.sigs b/source3/lib/ABI/smbldap-1.sigs
similarity index 93%
copy from source3/lib/ABI/smbldap-0.sigs
copy to source3/lib/ABI/smbldap-1.sigs
index d0e1d2f..cacc56d 100644
--- a/source3/lib/ABI/smbldap-0.sigs
+++ b/source3/lib/ABI/smbldap-1.sigs
@@ -2,6 +2,8 @@ smbldap_add: int (struct smbldap_state *, const char *, LDAPMod 
**)
 smbldap_delete: int (struct smbldap_state *, const char *)
 smbldap_extended_operation: int (struct smbldap_state *, const char *, struct 
berval *, LDAPControl **, LDAPControl **, char **, struct berval **)
 smbldap_free_struct: void (struct smbldap_state **)
+smbldap_get_ldap: LDAP *(struct smbldap_state *)
+smbldap_get_paged_results: bool (struct smbldap_state *)
 smbldap_get_single_attribute: bool (LDAP *, LDAPMessage *, const char *, char 
*, int)
 smbldap_has_control: bool (LDAP *, const char *)
 smbldap_has_extension: bool (LDAP *, const char *)
@@ -17,6 +19,7 @@ smbldap_search_suffix: int (struct smbldap_state *, const 
char *, const char **,
 smbldap_set_creds: bool (struct smbldap_state *, bool, const char *, const 
char *)
 smbldap_set_mod: void (LDAPMod ***, int, const char *, const char *)
 smbldap_set_mod_blob: void (LDAPMod ***, int, const char *, const DATA_BLOB *)
+smbldap_set_paged_results: void (struct smbldap_state *, bool)
 smbldap_setup_full_conn: int (LDAP **, const char *)
 smbldap_start_tls: int (LDAP *, int)
 smbldap_talloc_autofree_ldapmod: void (TALLOC_CTX *, LDAPMod **)
diff --git a/source3/lib/smbldap.c b/source3/lib/smbldap.c
index 2ef112f..3e7cdd4 100644
--- a/source3/lib/smbldap.c
+++ b/source3/lib/smbldap.c
@@ -35,6 +35,47 @@
 
 #define SMBLDAP_IDLE_TIME 150          /* After 2.5 minutes disconnect */
 
+struct smbldap_state {
+       LDAP *ldap_struct;
+       pid_t pid;
+       time_t last_ping; /* monotonic */
+       /* retrieve-once info */
+       const char *uri;
+
+       /* credentials */
+       bool anonymous;
+       char *bind_dn;
+       char *bind_secret;
+       int (*bind_callback)(LDAP *ldap_struct,
+                            struct smbldap_state *ldap_state, void *data);
+       void *bind_callback_data;
+
+       bool paged_results;
+
+       unsigned int num_failures;
+
+       time_t last_use; /* monotonic */
+       struct tevent_context *tevent_context;
+       struct tevent_timer *idle_event;
+
+       struct timeval last_rebind; /* monotonic */
+};
+
+LDAP *smbldap_get_ldap(struct smbldap_state *state)
+{
+       return state->ldap_struct;
+}
+
+bool smbldap_get_paged_results(struct smbldap_state *state)
+{
+       return state->paged_results;
+}
+
+void smbldap_set_paged_results(struct smbldap_state *state,
+                              bool paged_results)
+{
+       state->paged_results = paged_results;
+}
 
 /*******************************************************************
  Search an attribute and return the first value found.
@@ -943,7 +984,7 @@ static int rebindproc_connect (LDAP * ld, LDAP_CONST char 
*url, int request,
 ******************************************************************/
 static int smbldap_connect_system(struct smbldap_state *ldap_state)
 {
-       LDAP *ldap_struct = ldap_state->ldap_struct;
+       LDAP *ldap_struct = smbldap_get_ldap(ldap_state);
        int rc;
        int version;
 
@@ -988,7 +1029,8 @@ static int smbldap_connect_system(struct smbldap_state 
*ldap_state)
 
        if (rc != LDAP_SUCCESS) {
                char *ld_error = NULL;
-               ldap_get_option(ldap_state->ldap_struct, LDAP_OPT_ERROR_STRING,
+               ldap_get_option(smbldap_get_ldap(ldap_state),
+                               LDAP_OPT_ERROR_STRING,
                                &ld_error);
                DEBUG(ldap_state->num_failures ? 2 : 0,
                      ("failed to bind to server %s with dn=\"%s\" Error: 
%s\n\t%s\n",
@@ -1004,9 +1046,11 @@ static int smbldap_connect_system(struct smbldap_state 
*ldap_state)
        ldap_state->num_failures = 0;
        ldap_state->paged_results = False;
 
-       ldap_get_option(ldap_state->ldap_struct, LDAP_OPT_PROTOCOL_VERSION, 
&version);
+       ldap_get_option(smbldap_get_ldap(ldap_state),
+                       LDAP_OPT_PROTOCOL_VERSION, &version);
 
-       if (smbldap_has_control(ldap_state->ldap_struct, ADS_PAGE_CTL_OID) && 
version == 3) {
+       if (smbldap_has_control(smbldap_get_ldap(ldap_state), ADS_PAGE_CTL_OID)
+           && version == 3) {
                ldap_state->paged_results = True;
        }
 
@@ -1035,7 +1079,9 @@ static int smbldap_open(struct smbldap_state *ldap_state)
        bool reopen = False;
        SMB_ASSERT(ldap_state);
 
-       if ((ldap_state->ldap_struct != NULL) && ((ldap_state->last_ping + 
SMBLDAP_DONT_PING_TIME) < time_mono(NULL))) {
+       if ((smbldap_get_ldap(ldap_state) != NULL) &&
+           ((ldap_state->last_ping + SMBLDAP_DONT_PING_TIME) <
+            time_mono(NULL))) {
 
 #ifdef HAVE_UNIXSOCKET
                struct sockaddr_un addr;
@@ -1045,7 +1091,8 @@ static int smbldap_open(struct smbldap_state *ldap_state)
                socklen_t len = sizeof(addr);
                int sd;
 
-               opt_rc = ldap_get_option(ldap_state->ldap_struct, 
LDAP_OPT_DESC, &sd);
+               opt_rc = ldap_get_option(smbldap_get_ldap(ldap_state),
+                                        LDAP_OPT_DESC, &sd);
                if (opt_rc == 0 && (getpeername(sd, (struct sockaddr *) &addr, 
&len)) < 0 )
                        reopen = True;
 
@@ -1055,15 +1102,15 @@ static int smbldap_open(struct smbldap_state 
*ldap_state)
 #endif
                if (reopen) {
                        /* the other end has died. reopen. */
-                       ldap_unbind(ldap_state->ldap_struct);
-                       ldap_state->ldap_struct = NULL;
+                       ldap_unbind(smbldap_get_ldap(ldap_state));
+                       ldap_state->ldap_struct = NULL;
                        ldap_state->last_ping = (time_t)0;
                } else {
                        ldap_state->last_ping = time_mono(NULL);
                } 
        }
 
-       if (ldap_state->ldap_struct != NULL) {
+       if (smbldap_get_ldap(ldap_state) != NULL) {
                DEBUG(11,("smbldap_open: already connected to the LDAP 
server\n"));
                return LDAP_SUCCESS;
        }
@@ -1102,8 +1149,8 @@ static NTSTATUS smbldap_close(struct smbldap_state 
*ldap_state)
        if (!ldap_state)
                return NT_STATUS_INVALID_PARAMETER;
 
-       if (ldap_state->ldap_struct != NULL) {
-               ldap_unbind(ldap_state->ldap_struct);
+       if (smbldap_get_ldap(ldap_state) != NULL) {
+               ldap_unbind(smbldap_get_ldap(ldap_state));
                ldap_state->ldap_struct = NULL;
        }
 
@@ -1172,10 +1219,10 @@ static void setup_ldap_local_alarm(struct smbldap_state 
*ldap_state, time_t abso
 
 static void get_ldap_errs(struct smbldap_state *ldap_state, char 
**pp_ld_error, int *p_ld_errno)
 {
-       ldap_get_option(ldap_state->ldap_struct,
+       ldap_get_option(smbldap_get_ldap(ldap_state),
                        LDAP_OPT_ERROR_NUMBER, p_ld_errno);
 
-       ldap_get_option(ldap_state->ldap_struct,
+       ldap_get_option(smbldap_get_ldap(ldap_state),
                        LDAP_OPT_ERROR_STRING, pp_ld_error);
 }
 
@@ -1295,7 +1342,8 @@ static int smbldap_search_ext(struct smbldap_state 
*ldap_state,
                        break;
                }
 
-               rc = ldap_search_ext_s(ldap_state->ldap_struct, base, scope, 
+               rc = ldap_search_ext_s(smbldap_get_ldap(ldap_state),
+                                      base, scope,
                                       utf8_filter,
                                       discard_const_p(char *, attrs),
                                       attrsonly, sctrls, cctrls, timeout_ptr,
@@ -1315,7 +1363,7 @@ static int smbldap_search_ext(struct smbldap_state 
*ldap_state,
                if (ld_errno != LDAP_SERVER_DOWN) {
                        break;
                }
-               ldap_unbind(ldap_state->ldap_struct);
+               ldap_unbind(smbldap_get_ldap(ldap_state));
                ldap_state->ldap_struct = NULL;
        }
 
@@ -1390,7 +1438,7 @@ int smbldap_search_paged(struct smbldap_state *ldap_state,
 
        DEBUG(3,("smbldap_search_paged: search was successful\n"));
 
-       rc = ldap_parse_result(ldap_state->ldap_struct, *res, NULL, NULL, 
+       rc = ldap_parse_result(smbldap_get_ldap(ldap_state), *res, NULL, NULL,
                               NULL, NULL, &rcontrols,  0);
        if (rc != 0) {
                DEBUG(3,("smbldap_search_paged: ldap_parse_result failed " \
@@ -1449,7 +1497,8 @@ int smbldap_modify(struct smbldap_state *ldap_state, 
const char *dn, LDAPMod *at
                        break;
                }
 
-               rc = ldap_modify_s(ldap_state->ldap_struct, utf8_dn, attrs);
+               rc = ldap_modify_s(smbldap_get_ldap(ldap_state), utf8_dn,
+                                  attrs);
                if (rc == LDAP_SUCCESS) {
                        break;
                }
@@ -1465,7 +1514,7 @@ int smbldap_modify(struct smbldap_state *ldap_state, 
const char *dn, LDAPMod *at
                if (ld_errno != LDAP_SERVER_DOWN) {
                        break;
                }
-               ldap_unbind(ldap_state->ldap_struct);
+               ldap_unbind(smbldap_get_ldap(ldap_state));
                ldap_state->ldap_struct = NULL;
        }
 
@@ -1499,7 +1548,7 @@ int smbldap_add(struct smbldap_state *ldap_state, const 
char *dn, LDAPMod *attrs
                        break;
                }
 
-               rc = ldap_add_s(ldap_state->ldap_struct, utf8_dn, attrs);
+               rc = ldap_add_s(smbldap_get_ldap(ldap_state), utf8_dn, attrs);
                if (rc == LDAP_SUCCESS) {
                        break;
                }
@@ -1515,7 +1564,7 @@ int smbldap_add(struct smbldap_state *ldap_state, const 
char *dn, LDAPMod *attrs
                if (ld_errno != LDAP_SERVER_DOWN) {
                        break;
                }
-               ldap_unbind(ldap_state->ldap_struct);
+               ldap_unbind(smbldap_get_ldap(ldap_state));
                ldap_state->ldap_struct = NULL;
        }
 
@@ -1549,7 +1598,7 @@ int smbldap_delete(struct smbldap_state *ldap_state, 
const char *dn)
                        break;
                }
 
-               rc = ldap_delete_s(ldap_state->ldap_struct, utf8_dn);
+               rc = ldap_delete_s(smbldap_get_ldap(ldap_state), utf8_dn);
                if (rc == LDAP_SUCCESS) {
                        break;
                }
@@ -1565,7 +1614,7 @@ int smbldap_delete(struct smbldap_state *ldap_state, 
const char *dn)
                if (ld_errno != LDAP_SERVER_DOWN) {
                        break;
                }
-               ldap_unbind(ldap_state->ldap_struct);
+               ldap_unbind(smbldap_get_ldap(ldap_state));
                ldap_state->ldap_struct = NULL;
        }
 
@@ -1595,7 +1644,8 @@ int smbldap_extended_operation(struct smbldap_state 
*ldap_state,
                        break;
                }
 
-               rc = ldap_extended_operation_s(ldap_state->ldap_struct, reqoid,
+               rc = ldap_extended_operation_s(smbldap_get_ldap(ldap_state),
+                                              reqoid,
                                               reqdata, serverctrls,
                                               clientctrls, retoidp, retdatap);
                if (rc == LDAP_SUCCESS) {
@@ -1613,7 +1663,7 @@ int smbldap_extended_operation(struct smbldap_state 
*ldap_state,
                if (ld_errno != LDAP_SERVER_DOWN) {
                        break;
                }
-               ldap_unbind(ldap_state->ldap_struct);
+               ldap_unbind(smbldap_get_ldap(ldap_state));
                ldap_state->ldap_struct = NULL;
        }
 
@@ -1641,7 +1691,7 @@ static void smbldap_idle_fn(struct tevent_context 
*tevent_ctx,
 
        TALLOC_FREE(state->idle_event);
 
-       if (state->ldap_struct == NULL) {
+       if (smbldap_get_ldap(state) == NULL) {
                DEBUG(10,("ldap connection not connected...\n"));
                return;
        }
diff --git a/source3/passdb/pdb_ldap.c b/source3/passdb/pdb_ldap.c
index b5c6cbf..9514175 100644
--- a/source3/passdb/pdb_ldap.c
+++ b/source3/passdb/pdb_ldap.c
@@ -74,7 +74,7 @@
 
 LDAP *priv2ld(struct ldapsam_privates *priv)
 {
-       return priv->smbldap_state->ldap_struct;
+       return smbldap_get_ldap(priv->smbldap_state);
 }
 
 /**********************************************************************
@@ -191,7 +191,9 @@ static NTSTATUS ldapsam_get_seq_num(struct pdb_methods 
*my_methods, time_t *seq_
                return ntstatus;
        }
 
-       if (!smbldap_has_naming_context(ldap_state->smbldap_state->ldap_struct, 
lp_ldap_suffix(talloc_tos()))) {
+       if (!smbldap_has_naming_context(
+                   smbldap_get_ldap(ldap_state->smbldap_state),
+                   lp_ldap_suffix(talloc_tos()))) {
                DEBUG(3,("ldapsam_get_seq_num: DIT not configured to hold %s "
                         "as top-level namingContext\n", 
lp_ldap_suffix(talloc_tos())));
                return ntstatus;
@@ -243,19 +245,22 @@ static NTSTATUS ldapsam_get_seq_num(struct pdb_methods 
*my_methods, time_t *seq_
                goto done;
        }
 
-       num_result = ldap_count_entries(ldap_state->smbldap_state->ldap_struct, 
msg);
+       num_result = ldap_count_entries(
+               smbldap_get_ldap(ldap_state->smbldap_state), msg);
        if (num_result != 1) {
                DEBUG(3,("ldapsam_get_seq_num: Expected one entry, got %d\n", 
num_result));
                goto done;
        }
 
-       entry = ldap_first_entry(ldap_state->smbldap_state->ldap_struct, msg);
+       entry = ldap_first_entry(
+               smbldap_get_ldap(ldap_state->smbldap_state), msg);
        if (entry == NULL) {
                DEBUG(3,("ldapsam_get_seq_num: Could not retrieve entry\n"));
                goto done;
        }
 
-       values = ldap_get_values(ldap_state->smbldap_state->ldap_struct, entry, 
attrs[0]);
+       values = ldap_get_values(
+               smbldap_get_ldap(ldap_state->smbldap_state), entry, attrs[0]);
        if (values == NULL) {
                DEBUG(3,("ldapsam_get_seq_num: no values\n"));
                goto done;
@@ -435,8 +440,10 @@ static time_t ldapsam_get_entry_timestamp( struct 
ldapsam_privates *ldap_state,
        char *temp;
        struct tm tm;
 
-       temp = 
smbldap_talloc_single_attribute(ldap_state->smbldap_state->ldap_struct, entry,
-                       
get_userattr_key2string(ldap_state->schema_ver,LDAP_ATTR_MOD_TIMESTAMP),
+       temp = smbldap_talloc_single_attribute(
+               smbldap_get_ldap(ldap_state->smbldap_state), entry,
+               get_userattr_key2string(ldap_state->schema_ver,
+                                       LDAP_ATTR_MOD_TIMESTAMP),
                        talloc_tos());
        if (!temp) {
                return (time_t) 0;
@@ -541,7 +548,7 @@ static bool init_sam_from_ldap(struct ldapsam_privates 
*ldap_state,
 
        if ( ldap_state->schema_ver == SCHEMAVER_SAMBASAMACCOUNT ) {
                if ((temp = smbldap_talloc_single_attribute(
-                               ldap_state->smbldap_state->ldap_struct,
+                               smbldap_get_ldap(ldap_state->smbldap_state),
                                entry,
                                get_userattr_key2string(ldap_state->schema_ver,
                                        LDAP_ATTR_USER_SID),
@@ -550,7 +557,7 @@ static bool init_sam_from_ldap(struct ldapsam_privates 
*ldap_state,
                }
        } else {
                if ((temp = smbldap_talloc_single_attribute(
-                               ldap_state->smbldap_state->ldap_struct,
+                               smbldap_get_ldap(ldap_state->smbldap_state),
                                entry,
                                get_userattr_key2string(ldap_state->schema_ver,
                                        LDAP_ATTR_USER_RID),
@@ -571,7 +578,7 @@ static bool init_sam_from_ldap(struct ldapsam_privates 
*ldap_state,
        }
 
        temp = smbldap_talloc_single_attribute(
-                       ldap_state->smbldap_state->ldap_struct,
+                       smbldap_get_ldap(ldap_state->smbldap_state),
                        entry,
                        get_userattr_key2string(ldap_state->schema_ver,
                                LDAP_ATTR_PWD_LAST_SET),
@@ -583,7 +590,7 @@ static bool init_sam_from_ldap(struct ldapsam_privates 
*ldap_state,
        }
 
        temp = smbldap_talloc_single_attribute(
-                       ldap_state->smbldap_state->ldap_struct,
+                       smbldap_get_ldap(ldap_state->smbldap_state),
                        entry,
                        get_userattr_key2string(ldap_state->schema_ver,
                                LDAP_ATTR_LOGON_TIME),
@@ -594,7 +601,7 @@ static bool init_sam_from_ldap(struct ldapsam_privates 
*ldap_state,
        }
 
        temp = smbldap_talloc_single_attribute(
-                       ldap_state->smbldap_state->ldap_struct,
+                       smbldap_get_ldap(ldap_state->smbldap_state),
                        entry,
                        get_userattr_key2string(ldap_state->schema_ver,
                                LDAP_ATTR_LOGOFF_TIME),
@@ -605,7 +612,7 @@ static bool init_sam_from_ldap(struct ldapsam_privates 
*ldap_state,
        }
 
        temp = smbldap_talloc_single_attribute(
-                       ldap_state->smbldap_state->ldap_struct,
+                       smbldap_get_ldap(ldap_state->smbldap_state),
                        entry,
                        get_userattr_key2string(ldap_state->schema_ver,
                                LDAP_ATTR_KICKOFF_TIME),
@@ -616,7 +623,7 @@ static bool init_sam_from_ldap(struct ldapsam_privates 
*ldap_state,
        }
 
        temp = smbldap_talloc_single_attribute(
-                       ldap_state->smbldap_state->ldap_struct,
+                       smbldap_get_ldap(ldap_state->smbldap_state),
                        entry,
                        get_userattr_key2string(ldap_state->schema_ver,
                                LDAP_ATTR_PWD_CAN_CHANGE),
@@ -634,7 +641,7 @@ static bool init_sam_from_ldap(struct ldapsam_privates 
*ldap_state,
         */
 
        fullname = smbldap_talloc_single_attribute(
-                       ldap_state->smbldap_state->ldap_struct,
+                       smbldap_get_ldap(ldap_state->smbldap_state),
                        entry,
                        get_userattr_key2string(ldap_state->schema_ver,
                                LDAP_ATTR_DISPLAY_NAME),
@@ -643,7 +650,7 @@ static bool init_sam_from_ldap(struct ldapsam_privates 
*ldap_state,
                pdb_set_fullname(sampass, fullname, PDB_SET);
        } else {
                fullname = smbldap_talloc_single_attribute(
-                               ldap_state->smbldap_state->ldap_struct,
+                               smbldap_get_ldap(ldap_state->smbldap_state),
                                entry,
                                get_userattr_key2string(ldap_state->schema_ver,
                                        LDAP_ATTR_CN),
@@ -654,7 +661,7 @@ static bool init_sam_from_ldap(struct ldapsam_privates 
*ldap_state,
        }
 
        dir_drive = smbldap_talloc_single_attribute(
-                       ldap_state->smbldap_state->ldap_struct,
+                       smbldap_get_ldap(ldap_state->smbldap_state),
                        entry,
                        get_userattr_key2string(ldap_state->schema_ver,
                                LDAP_ATTR_HOME_DRIVE),
@@ -666,7 +673,7 @@ static bool init_sam_from_ldap(struct ldapsam_privates 
*ldap_state,
        }
 
        homedir = smbldap_talloc_single_attribute(
-                       ldap_state->smbldap_state->ldap_struct,
+                       smbldap_get_ldap(ldap_state->smbldap_state),
                        entry,
                        get_userattr_key2string(ldap_state->schema_ver,
                                LDAP_ATTR_HOME_PATH),
@@ -690,7 +697,7 @@ static bool init_sam_from_ldap(struct ldapsam_privates 
*ldap_state,
        }
 
        logon_script = smbldap_talloc_single_attribute(
-                       ldap_state->smbldap_state->ldap_struct,
+                       smbldap_get_ldap(ldap_state->smbldap_state),


-- 
Samba Shared Repository

Reply via email to