The branch, master has been updated
       via  18cacc5... s4-drs: we need to specifically ask for 
ntSecurityDescriptor
       via  51a59e8... s4-ldb: added a warning about ldb_msg_add_dn
       via  1169dd3... added new function "ldb_msg_add_dn"
      from  f3f0c8e... s4-dsdb: removed attributes that should not be displayed 
by default

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


- Log -----------------------------------------------------------------
commit 18cacc506e24e9017513501cac2ff9b5ca304bd5
Author: Andrew Tridgell <[email protected]>
Date:   Fri Nov 20 14:57:04 2009 +1100

    s4-drs: we need to specifically ask for ntSecurityDescriptor
    
    ntSecurityDescriptor is no longer included by default

commit 51a59e8f9ed930eaa8f2936972b810fdd0acccbd
Author: Andrew Tridgell <[email protected]>
Date:   Thu Nov 19 16:03:59 2009 -0200

    s4-ldb: added a warning about ldb_msg_add_dn
    
    ldb_msg_add_dn does not copy the dn linearized string

commit 1169dd3b50dfefa59b56cd1897bcd0b6c2ffb3be
Author: Crístian Deives <[email protected]>
Date:   Thu Nov 19 16:03:59 2009 -0200

    added new function "ldb_msg_add_dn"
    
    a helper function to a DN element to an ldb_msg using ldb_msg_add_string.
    
    Signed-off-by: Andrew Tridgell <[email protected]>

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

Summary of changes:
 source4/dsdb/samdb/ldb_modules/extended_dn_out.c |    5 +++--
 source4/lib/ldb/common/ldb_msg.c                 |   11 +++++++++++
 source4/lib/ldb/include/ldb.h                    |    2 ++
 source4/lib/ldb/ldb_map/ldb_map_inbound.c        |   10 +++-------
 source4/rpc_server/drsuapi/getncchanges.c        |    2 +-
 5 files changed, 20 insertions(+), 10 deletions(-)


Changeset truncated at 500 lines:

diff --git a/source4/dsdb/samdb/ldb_modules/extended_dn_out.c 
b/source4/dsdb/samdb/ldb_modules/extended_dn_out.c
index a3e4f57..1249a9c 100644
--- a/source4/dsdb/samdb/ldb_modules/extended_dn_out.c
+++ b/source4/dsdb/samdb/ldb_modules/extended_dn_out.c
@@ -377,8 +377,9 @@ static int extended_callback(struct ldb_request *req, 
struct ldb_reply *ares,
                                ret = ldb_msg_add_steal_string(ares->message, 
"distinguishedName", 
                                                               
ldb_dn_get_extended_linearized(ares->message, ares->message->dn, 
ac->extended_type));
                        } else {
-                               ret = ldb_msg_add_string(ares->message, 
"distinguishedName", 
-                                                        
ldb_dn_get_linearized(ares->message->dn));
+                               ret = ldb_msg_add_dn(ares->message,
+                                                    "distinguishedName",
+                                                    ares->message->dn);
                        }
                        if (ret != LDB_SUCCESS) {
                                ldb_oom(ldb);
diff --git a/source4/lib/ldb/common/ldb_msg.c b/source4/lib/ldb/common/ldb_msg.c
index 161a6b1..f1dd6f3 100644
--- a/source4/lib/ldb/common/ldb_msg.c
+++ b/source4/lib/ldb/common/ldb_msg.c
@@ -259,6 +259,17 @@ int ldb_msg_add_steal_string(struct ldb_message *msg,
 }
 
 /*
+  add a DN element to a message
+  WARNING: this uses the linearized string from the dn, and does not
+  copy the string.
+*/
+int ldb_msg_add_dn(struct ldb_message *msg, const char *attr_name,
+                  struct ldb_dn *dn)
+{
+       return ldb_msg_add_string(msg, attr_name, ldb_dn_get_linearized(dn));
+}
+
+/*
   add a printf formatted element to a message
 */
 int ldb_msg_add_fmt(struct ldb_message *msg, 
diff --git a/source4/lib/ldb/include/ldb.h b/source4/lib/ldb/include/ldb.h
index 2d42596..1d0b533 100644
--- a/source4/lib/ldb/include/ldb.h
+++ b/source4/lib/ldb/include/ldb.h
@@ -1752,6 +1752,8 @@ int ldb_msg_add_steal_string(struct ldb_message *msg,
                             const char *attr_name, char *str);
 int ldb_msg_add_string(struct ldb_message *msg, 
                       const char *attr_name, const char *str);
+int ldb_msg_add_dn(struct ldb_message *msg, const char *attr_name,
+                  struct ldb_dn *dn);
 int ldb_msg_add_fmt(struct ldb_message *msg, 
                    const char *attr_name, const char *fmt, ...) 
PRINTF_ATTRIBUTE(3,4);
 
diff --git a/source4/lib/ldb/ldb_map/ldb_map_inbound.c 
b/source4/lib/ldb/ldb_map/ldb_map_inbound.c
index 5a237ef..11ec9d2 100644
--- a/source4/lib/ldb/ldb_map/ldb_map_inbound.c
+++ b/source4/lib/ldb/ldb_map/ldb_map_inbound.c
@@ -362,7 +362,6 @@ int map_add(struct ldb_module *module, struct ldb_request 
*req)
        struct ldb_context *ldb;
        struct map_context *ac;
        struct ldb_message *remote_msg;
-       const char *dn;
        int ret;
 
        ldb = ldb_module_get_ctx(module);
@@ -426,8 +425,7 @@ int map_add(struct ldb_module *module, struct ldb_request 
*req)
 
        /* Store remote DN in 'IS_MAPPED' */
        /* TODO: use GUIDs here instead */
-       dn = ldb_dn_alloc_linearized(ac->local_msg, remote_msg->dn);
-       if (ldb_msg_add_string(ac->local_msg, IS_MAPPED, dn) != 0) {
+       if (ldb_msg_add_dn(ac->local_msg, IS_MAPPED, remote_msg->dn) != 0) {
                return LDB_ERR_OPERATIONS_ERROR;
        }
 
@@ -545,7 +543,6 @@ static int map_modify_do_local(struct map_context *ac)
 {
        struct ldb_request *local_req;
        struct ldb_context *ldb;
-       char *dn;
        int ret;
 
        ldb = ldb_module_get_ctx(ac->module);
@@ -558,9 +555,8 @@ static int map_modify_do_local(struct map_context *ac)
                                        LDB_FLAG_MOD_ADD, NULL) != 0) {
                        return LDB_ERR_OPERATIONS_ERROR;
                }
-               dn = ldb_dn_alloc_linearized(ac->local_msg,
-                                       ac->remote_req->op.mod.message->dn);
-               if (ldb_msg_add_string(ac->local_msg, IS_MAPPED, dn) != 0) {
+               if (ldb_msg_add_dn(ac->local_msg, IS_MAPPED,
+                                  ac->remote_req->op.mod.message->dn) != 0) {
                        return LDB_ERR_OPERATIONS_ERROR;
                }
 
diff --git a/source4/rpc_server/drsuapi/getncchanges.c 
b/source4/rpc_server/drsuapi/getncchanges.c
index ca404c4..2fb3016 100644
--- a/source4/rpc_server/drsuapi/getncchanges.c
+++ b/source4/rpc_server/drsuapi/getncchanges.c
@@ -340,7 +340,7 @@ WERROR dcesrv_drsuapi_DsGetNCChanges(struct 
dcesrv_call_state *dce_call, TALLOC_
        struct drsuapi_DsReplicaObjectListItemEx **currentObject;
        NTSTATUS status;
        DATA_BLOB session_key;
-       const char *attrs[] = { "*", "distinguishedName", NULL };
+       const char *attrs[] = { "*", "distinguishedName", 
"ntSecurityDescriptor", NULL };
        WERROR werr;
        struct dcesrv_handle *h;
        struct drsuapi_bind_state *b_state;     


-- 
Samba Shared Repository

Reply via email to