The branch, master has been updated
       via  837a975... s4:cldap_server/rootdse.c - simplify the code a bit
       via  9969cfc... s4:cldap_server.c - here the counter variable should be 
"signed"
      from  2e8c563... Second part of fix converting prs_XX struct and 
functions to talloc. Remove unneeded prs_mem_free calls.

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


- Log -----------------------------------------------------------------
commit 837a975c2be620396f3eac02a14d057a2de6c270
Author: Matthias Dieter Wallnöfer <[email protected]>
Date:   Fri Jun 18 19:11:35 2010 +0200

    s4:cldap_server/rootdse.c - simplify the code a bit
    
    Remove "NULL"-content variables and use "NULL"s directly as arguments. Add 
some
    linewraps where needed.

commit 9969cfc36cc40d37d0cd740d60f698dad3f55bbb
Author: Matthias Dieter Wallnöfer <[email protected]>
Date:   Fri Jun 18 18:57:38 2010 +0200

    s4:cldap_server.c - here the counter variable should be "signed"

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

Summary of changes:
 source4/cldap_server/cldap_server.c |    3 +--
 source4/cldap_server/rootdse.c      |   22 +++++++++-------------
 2 files changed, 10 insertions(+), 15 deletions(-)


Changeset truncated at 500 lines:

diff --git a/source4/cldap_server/cldap_server.c 
b/source4/cldap_server/cldap_server.c
index 8bed38b..09c9889 100644
--- a/source4/cldap_server/cldap_server.c
+++ b/source4/cldap_server/cldap_server.c
@@ -147,10 +147,9 @@ static NTSTATUS cldapd_add_socket(struct cldapd_server 
*cldapd, struct loadparm_
 static NTSTATUS cldapd_startup_interfaces(struct cldapd_server *cldapd, struct 
loadparm_context *lp_ctx,
                                          struct interface *ifaces)
 {
-       int num_interfaces;
+       int i, num_interfaces;
        TALLOC_CTX *tmp_ctx = talloc_new(cldapd);
        NTSTATUS status;
-       unsigned int i;
 
        num_interfaces = iface_count(ifaces);
 
diff --git a/source4/cldap_server/rootdse.c b/source4/cldap_server/rootdse.c
index 3592ffa..59f30bc 100644
--- a/source4/cldap_server/rootdse.c
+++ b/source4/cldap_server/rootdse.c
@@ -36,18 +36,11 @@ static void cldapd_rootdse_fill(struct cldapd_server 
*cldapd,
                                struct ldap_Result *result)
 {
        struct ldap_SearchResEntry *ent = NULL;
-       struct ldb_dn *basedn;
        struct ldb_result *res = NULL;
        struct ldb_request *lreq;
-       enum ldb_scope scope = LDB_SCOPE_DEFAULT;
        const char **attrs = NULL;
        const char *errstr = NULL;
-       int ret = 0;
-       int ldb_ret = -1;
-
-       basedn = ldb_dn_new(mem_ctx, cldapd->samctx, NULL);
-       if (basedn == NULL) goto nomem;
-       scope = LDB_SCOPE_BASE;
+       int ret = LDAP_SUCCESS, ldb_ret;
 
        if (search->num_attributes >= 1) {
                int i;
@@ -65,7 +58,7 @@ static void cldapd_rootdse_fill(struct cldapd_server *cldapd,
        if (res == NULL) goto nomem;
 
        ldb_ret = ldb_build_search_req_ex(&lreq, cldapd->samctx, mem_ctx,
-                                         basedn, scope,
+                                         NULL, LDB_SCOPE_BASE,
                                          search->tree, attrs,
                                          NULL,
                                          res, ldb_search_default_callback,
@@ -106,10 +99,12 @@ static void cldapd_rootdse_fill(struct cldapd_server 
*cldapd,
                        goto reply;
                }
                ent->num_attributes = res->msgs[0]->num_elements;
-               ent->attributes = talloc_array(ent, struct ldb_message_element, 
ent->num_attributes);
+               ent->attributes = talloc_array(ent, struct ldb_message_element,
+                                              ent->num_attributes);
                if (ent->attributes == NULL) goto nomem;
                for (j=0; j < ent->num_attributes; j++) {
-                       ent->attributes[j].name = talloc_steal(ent->attributes, 
res->msgs[0]->elements[j].name);
+                       ent->attributes[j].name = talloc_steal(ent->attributes,
+                                                              
res->msgs[0]->elements[j].name);
                        ent->attributes[j].num_values = 0;
                        ent->attributes[j].values = NULL;
                        if (search->attributesonly && 
(res->msgs[0]->elements[j].num_values == 0)) {
@@ -122,7 +117,7 @@ static void cldapd_rootdse_fill(struct cldapd_server 
*cldapd,
        }
 
 reply:
-       if (ret) {
+       if (ret != LDAP_SUCCESS) {
                /* nothing ... */
        } else if (ldb_ret == LDB_SUCCESS) {
                ret = LDAP_SUCCESS;
@@ -163,7 +158,8 @@ void cldapd_rootdse_request(struct cldap_socket *cldap,
        reply.response          = NULL;
        reply.result            = &result;
 
-       cldapd_rootdse_fill(cldapd, tmp_ctx, search, &reply.response, 
reply.result);
+       cldapd_rootdse_fill(cldapd, tmp_ctx, search, &reply.response,
+                           reply.result);
 
        status = cldap_reply_send(cldap, &reply);
        if (!NT_STATUS_IS_OK(status)) {


-- 
Samba Shared Repository

Reply via email to