summaryrefslogtreecommitdiff
path: root/source4/dsdb/samdb/ldb_modules/objectguid.c
diff options
context:
space:
mode:
authorFernando J V da Silva <fernandojvsilva@yahoo.com.br>2009-11-25 17:01:55 -0300
committerAndrew Tridgell <tridge@samba.org>2009-11-30 21:17:27 +1100
commit71e29cbf56048791057ccf07b859654312f3882e (patch)
tree7f413aa6586987f9d1a4817fd85bf66feee2e3d7 /source4/dsdb/samdb/ldb_modules/objectguid.c
parent0003b5fad1dee687bc15dfad9f71b6dfc40556d7 (diff)
downloadsamba-71e29cbf56048791057ccf07b859654312f3882e.tar.gz
samba-71e29cbf56048791057ccf07b859654312f3882e.tar.bz2
samba-71e29cbf56048791057ccf07b859654312f3882e.zip
s4-drs: Using dsdb_msg_add_guid() utility function
Uses the dsdb_msg_add_guid() to add any kind of GUID attribute to a ldb_message in several places of samba4 code. Signed-off-by: Andrew Tridgell <tridge@samba.org>
Diffstat (limited to 'source4/dsdb/samdb/ldb_modules/objectguid.c')
-rw-r--r--source4/dsdb/samdb/ldb_modules/objectguid.c13
1 files changed, 2 insertions, 11 deletions
diff --git a/source4/dsdb/samdb/ldb_modules/objectguid.c b/source4/dsdb/samdb/ldb_modules/objectguid.c
index 12dd402617..bfbf2b4511 100644
--- a/source4/dsdb/samdb/ldb_modules/objectguid.c
+++ b/source4/dsdb/samdb/ldb_modules/objectguid.c
@@ -31,6 +31,7 @@
#include "includes.h"
#include "ldb_module.h"
+#include "dsdb/samdb/samdb.h"
#include "librpc/gen_ndr/ndr_misc.h"
#include "param/param.h"
@@ -136,10 +137,8 @@ static int objectguid_add(struct ldb_module *module, struct ldb_request *req)
struct ldb_request *down_req;
struct ldb_message_element *attribute;
struct ldb_message *msg;
- struct ldb_val v;
struct GUID guid;
uint64_t seq_num;
- enum ndr_err_code ndr_err;
int ret;
time_t t = time(NULL);
struct og_context *ac;
@@ -174,15 +173,7 @@ static int objectguid_add(struct ldb_module *module, struct ldb_request *req)
/* a new GUID */
guid = GUID_random();
- ndr_err = ndr_push_struct_blob(&v, msg,
- lp_iconv_convenience(ldb_get_opaque(ldb, "loadparm")),
- &guid,
- (ndr_push_flags_fn_t)ndr_push_GUID);
- if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
- return LDB_ERR_OPERATIONS_ERROR;
- }
-
- ret = ldb_msg_add_value(msg, "objectGUID", &v, NULL);
+ ret = dsdb_msg_add_guid(msg, &guid, "objectGUID");
if (ret) {
return ret;
}