summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorStefan Metzmacher <metze@samba.org>2012-08-22 12:07:02 +0200
committerStefan Metzmacher <metze@samba.org>2012-08-24 13:43:31 +0200
commit99b134adbe6b02388665c3b34f00b6723f6a1120 (patch)
treee5ca114a66d6b1311282a932bfadb74fd9bb6663
parent6145329fcd7463279b3c497a7a5db5f4f6bd991e (diff)
downloadsamba-99b134adbe6b02388665c3b34f00b6723f6a1120.tar.gz
samba-99b134adbe6b02388665c3b34f00b6723f6a1120.tar.bz2
samba-99b134adbe6b02388665c3b34f00b6723f6a1120.zip
s3:lib: implement serverid_exists() as wrapper of serverids_exist()
metze
-rw-r--r--source3/lib/serverid.c35
1 files changed, 5 insertions, 30 deletions
diff --git a/source3/lib/serverid.c b/source3/lib/serverid.c
index c866d24bc2..1ab0d6958c 100644
--- a/source3/lib/serverid.c
+++ b/source3/lib/serverid.c
@@ -251,40 +251,15 @@ static void server_exists_parse(TDB_DATA key, TDB_DATA data, void *priv)
bool serverid_exists(const struct server_id *id)
{
- struct db_context *db;
- struct serverid_exists_state state;
- struct serverid_key key;
- TDB_DATA tdbkey;
- NTSTATUS status;
-
- if (procid_is_me(id)) {
- return true;
- }
+ bool result = false;
+ bool ok = false;
- if (!process_exists(*id)) {
+ ok = serverids_exist(id, 1, &result);
+ if (!ok) {
return false;
}
- if (id->unique_id == SERVERID_UNIQUE_ID_NOT_TO_VERIFY) {
- return true;
- }
-
- db = serverid_db();
- if (db == NULL) {
- return false;
- }
-
- serverid_fill_key(id, &key);
- tdbkey = make_tdb_data((uint8_t *)&key, sizeof(key));
-
- state.id = id;
- state.exists = false;
-
- status = dbwrap_parse_record(db, tdbkey, server_exists_parse, &state);
- if (!NT_STATUS_IS_OK(status)) {
- return false;
- }
- return state.exists;
+ return result;
}
bool serverids_exist(const struct server_id *ids, int num_ids, bool *results)