summaryrefslogtreecommitdiff
path: root/source4/rpc_server/samr/samdb.c
diff options
context:
space:
mode:
authorAndrew Tridgell <tridge@samba.org>2004-05-04 07:53:06 +0000
committerGerald (Jerry) Carter <jerry@samba.org>2007-10-10 12:51:44 -0500
commit1b3bbc7d440d61e0780fdb0b2493dd4ab9bd3f59 (patch)
treee842650726b046501e39f45d6a67889b19096342 /source4/rpc_server/samr/samdb.c
parentd2ea763761b3a358444ac1b01bafe9f4789cfc29 (diff)
downloadsamba-1b3bbc7d440d61e0780fdb0b2493dd4ab9bd3f59.tar.gz
samba-1b3bbc7d440d61e0780fdb0b2493dd4ab9bd3f59.tar.bz2
samba-1b3bbc7d440d61e0780fdb0b2493dd4ab9bd3f59.zip
r466: implemented samr_OpenDomain() and samr_GetDomPwInfo() server side calls
if you take a look at samr_GetDomPwInfo() then you will get a fairly good idea of what I am planning for the database oriented SAMR server implementation. (This used to be commit bba0044a514cf86cbcf14bc82dd6c49808c22dab)
Diffstat (limited to 'source4/rpc_server/samr/samdb.c')
-rw-r--r--source4/rpc_server/samr/samdb.c27
1 files changed, 21 insertions, 6 deletions
diff --git a/source4/rpc_server/samr/samdb.c b/source4/rpc_server/samr/samdb.c
index ac58fe2c01..3f55698376 100644
--- a/source4/rpc_server/samr/samdb.c
+++ b/source4/rpc_server/samr/samdb.c
@@ -91,6 +91,14 @@ int samdb_search(struct ldb_message ***res,
return count;
}
+
+/*
+ free up a search result
+*/
+int samdb_search_free(struct ldb_message **res)
+{
+ return ldb_search_free(sam_db, res);
+}
/*
@@ -121,7 +129,7 @@ const char *samdb_search_string(TALLOC_CTX *mem_ctx,
res[0]->elements[0].values[0].data == NULL) {
DEBUG(1,("samdb: search for %s %s not single valued\n",
attr_name, format));
- ldb_search_free(sam_db, res);
+ samdb_search_free(res);
return NULL;
}
@@ -129,7 +137,7 @@ const char *samdb_search_string(TALLOC_CTX *mem_ctx,
res[0]->elements[0].values[0].data,
res[0]->elements[0].values[0].length);
- ldb_search_free(sam_db, res);
+ samdb_search_free(res);
return str;
}
@@ -164,14 +172,14 @@ int samdb_search_string_multiple(TALLOC_CTX *mem_ctx,
res[i]->elements[0].values[0].data == NULL) {
DEBUG(1,("samdb: search for %s %s not single valued\n",
attr_name, format));
- ldb_search_free(sam_db, res);
+ samdb_search_free(res);
return -1;
}
}
*strs = talloc_array_p(mem_ctx, char *, count+1);
if (! *strs) {
- ldb_search_free(sam_db, res);
+ samdb_search_free(res);
return -1;
}
@@ -182,8 +190,15 @@ int samdb_search_string_multiple(TALLOC_CTX *mem_ctx,
}
(*strs)[count] = NULL;
- ldb_search_free(sam_db, res);
+ samdb_search_free(res);
return count;
}
-
+
+/*
+ pull a uint from a result set.
+*/
+uint_t samdb_result_uint(struct ldb_message *msg, const char *attr, uint_t default_value)
+{
+ return ldb_msg_find_uint(msg, attr, default_value);
+}