summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGünther Deschner <gd@samba.org>2008-07-01 20:09:09 +0200
committerGünther Deschner <gd@samba.org>2008-07-17 10:32:03 +0200
commit6a3b742db7fba057b5dd0534bee6fa1385010311 (patch)
tree1b5ed47c16b36f9cbbc874936d48e60b8a5e66a2
parentbda5542de19445b00398440518e2896ad165d5fd (diff)
downloadsamba-6a3b742db7fba057b5dd0534bee6fa1385010311.tar.gz
samba-6a3b742db7fba057b5dd0534bee6fa1385010311.tar.bz2
samba-6a3b742db7fba057b5dd0534bee6fa1385010311.zip
util: add policy_hnd_equal().
Guenther (This used to be commit 6aca163e898bfeeff824725bb27b2ef4f7b729f9)
-rw-r--r--source3/include/proto.h2
-rw-r--r--source3/lib/util.c10
2 files changed, 12 insertions, 0 deletions
diff --git a/source3/include/proto.h b/source3/include/proto.h
index 03d203b96e..3c3d5018df 100644
--- a/source3/include/proto.h
+++ b/source3/include/proto.h
@@ -1408,6 +1408,8 @@ void *talloc_zeronull(const void *context, size_t size, const char *name);
NTSTATUS split_ntfs_stream_name(TALLOC_CTX *mem_ctx, const char *fname,
char **pbase, char **pstream);
bool is_valid_policy_hnd(const POLICY_HND *hnd);
+bool policy_hnd_equal(const struct policy_handle *hnd1,
+ const struct policy_handle *hnd2);
const char *strip_hostname(const char *s);
/* The following definitions come from lib/util_file.c */
diff --git a/source3/lib/util.c b/source3/lib/util.c
index 8d744a5ae3..b346254617 100644
--- a/source3/lib/util.c
+++ b/source3/lib/util.c
@@ -3458,6 +3458,16 @@ bool is_valid_policy_hnd(const POLICY_HND *hnd)
return (memcmp(&tmp, hnd, sizeof(tmp)) != 0);
}
+bool policy_hnd_equal(const struct policy_handle *hnd1,
+ const struct policy_handle *hnd2)
+{
+ if (!hnd1 || !hnd2) {
+ return false;
+ }
+
+ return (memcmp(hnd1, hnd2, sizeof(*hnd1)) == 0);
+}
+
/****************************************************************
strip off leading '\\' from a hostname
****************************************************************/