summaryrefslogtreecommitdiff
path: root/source4/lib/ldb
diff options
context:
space:
mode:
authorAndrew Bartlett <abartlet@samba.org>2006-08-14 00:59:57 +0000
committerGerald (Jerry) Carter <jerry@samba.org>2007-10-10 14:15:33 -0500
commit8f42f1292c2f1f1002b8446dc8b5351eb633d5ce (patch)
tree93ea15acce51657b8dd95bdc429b450db63313b5 /source4/lib/ldb
parent027583e6de2a6981d1c0e8959e1e37bf758be8f9 (diff)
downloadsamba-8f42f1292c2f1f1002b8446dc8b5351eb633d5ce.tar.gz
samba-8f42f1292c2f1f1002b8446dc8b5351eb633d5ce.tar.bz2
samba-8f42f1292c2f1f1002b8446dc8b5351eb633d5ce.zip
r17526: Move timestamp generation into the objectGUID module. It probably
needs to be renamed (operation_add?). This allows me to match the behaviour and substitute with the entryUUID module for remote LDAP connections. Andrew Bartlett (This used to be commit af02b4d7c631bb15bf5a5f73f9fdc23075d50f60)
Diffstat (limited to 'source4/lib/ldb')
-rw-r--r--source4/lib/ldb/modules/operational.c41
1 files changed, 0 insertions, 41 deletions
diff --git a/source4/lib/ldb/modules/operational.c b/source4/lib/ldb/modules/operational.c
index 934622eccd..b14d552e83 100644
--- a/source4/lib/ldb/modules/operational.c
+++ b/source4/lib/ldb/modules/operational.c
@@ -170,35 +170,6 @@ failed:
}
/*
- add a time element to a record
-*/
-static int add_time_element(struct ldb_message *msg, const char *attr, time_t t)
-{
- struct ldb_message_element *el;
- char *s;
-
- if (ldb_msg_find_element(msg, attr) != NULL) {
- return 0;
- }
-
- s = ldb_timestring(msg, t);
- if (s == NULL) {
- return -1;
- }
-
- if (ldb_msg_add_string(msg, attr, s) != 0) {
- return -1;
- }
-
- el = ldb_msg_find_element(msg, attr);
- /* always set as replace. This works because on add ops, the flag
- is ignored */
- el->flags = LDB_FLAG_MOD_REPLACE;
-
- return 0;
-}
-
-/*
add a uint64_t element to a record
*/
static int add_uint64_element(struct ldb_message *msg, const char *attr, uint64_t v)
@@ -348,7 +319,6 @@ static int operational_add(struct ldb_module *module, struct ldb_request *req)
{
struct ldb_request *down_req;
struct ldb_message *msg;
- time_t t = time(NULL);
uint64_t seq_num;
int ret;
@@ -368,11 +338,6 @@ static int operational_add(struct ldb_module *module, struct ldb_request *req)
if (msg == NULL) {
return LDB_ERR_OPERATIONS_ERROR;
}
- if (add_time_element(msg, "whenCreated", t) != 0 ||
- add_time_element(msg, "whenChanged", t) != 0) {
- talloc_free(down_req);
- return LDB_ERR_OPERATIONS_ERROR;
- }
/* Get a sequence number from the backend */
ret = ldb_sequence_number(module->ldb, &seq_num);
@@ -405,7 +370,6 @@ static int operational_modify(struct ldb_module *module, struct ldb_request *req
{
struct ldb_request *down_req;
struct ldb_message *msg;
- time_t t = time(NULL);
uint64_t seq_num;
int ret;
@@ -425,11 +389,6 @@ static int operational_modify(struct ldb_module *module, struct ldb_request *req
if (msg == NULL) {
return LDB_ERR_OPERATIONS_ERROR;
}
- if (add_time_element(msg, "whenChanged", t) != 0) {
- talloc_free(down_req);
- return LDB_ERR_OPERATIONS_ERROR;
- }
-
/* Get a sequence number from the backend */
ret = ldb_sequence_number(module->ldb, &seq_num);
if (ret == LDB_SUCCESS) {