util: add policy_hnd_equal().
authorGünther Deschner <gd@samba.org>
Tue, 1 Jul 2008 18:09:09 +0000 (20:09 +0200)
committerGünther Deschner <gd@samba.org>
Thu, 17 Jul 2008 08:32:03 +0000 (10:32 +0200)
Guenther

source/include/proto.h
source/lib/util.c

index 03d203b96e3e10532a6416975ec23c3b5637097e..3c3d5018df326dee0a91468deff934ec8f139c54 100644 (file)
@@ -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  */
index 8d744a5ae3bc6ef7dcbbb5d57d25653d2a1b4243..b34625461774339da2c7c8a872a3f885f3032180 100644 (file)
@@ -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
 ****************************************************************/