summaryrefslogtreecommitdiff
path: root/source4/librpc/ndr
diff options
context:
space:
mode:
authorStefan Metzmacher <metze@samba.org>2006-12-07 15:24:23 +0000
committerGerald (Jerry) Carter <jerry@samba.org>2007-10-10 14:28:57 -0500
commita28b67c7337b4b2b753d6bfad1ed16af04744870 (patch)
treee966759048aa6c358da23b16546b9ee275ab65bb /source4/librpc/ndr
parent0df2c30821e3a052342c0baf29e83dd471644d28 (diff)
downloadsamba-a28b67c7337b4b2b753d6bfad1ed16af04744870.tar.gz
samba-a28b67c7337b4b2b753d6bfad1ed16af04744870.tar.bz2
samba-a28b67c7337b4b2b753d6bfad1ed16af04744870.zip
r20064: - fix pushing of DeReplicaObjectIdentifierX, this lets the DsAddEntry()
request work correctly - the error structures all have the same type metze (This used to be commit 3322dbd901106262b22db35e9ef455a08ac2867c)
Diffstat (limited to 'source4/librpc/ndr')
-rw-r--r--source4/librpc/ndr/libndr.h1
-rw-r--r--source4/librpc/ndr/ndr_sec_helper.c15
2 files changed, 16 insertions, 0 deletions
diff --git a/source4/librpc/ndr/libndr.h b/source4/librpc/ndr/libndr.h
index fb151e4120..eb0c970208 100644
--- a/source4/librpc/ndr/libndr.h
+++ b/source4/librpc/ndr/libndr.h
@@ -299,5 +299,6 @@ void ndr_print_dom_sid2(struct ndr_print *ndr, const char *name, const struct do
NTSTATUS ndr_push_dom_sid28(struct ndr_push *ndr, int ndr_flags, const struct dom_sid *sid);
NTSTATUS ndr_pull_dom_sid28(struct ndr_pull *ndr, int ndr_flags, struct dom_sid *sid);
void ndr_print_dom_sid28(struct ndr_print *ndr, const char *name, const struct dom_sid *sid);
+size_t ndr_size_dom_sid28(const struct dom_sid *sid, int flags);
#endif /* __LIBNDR_H__ */
diff --git a/source4/librpc/ndr/ndr_sec_helper.c b/source4/librpc/ndr/ndr_sec_helper.c
index dd4435daf1..8059c0f4ea 100644
--- a/source4/librpc/ndr/ndr_sec_helper.c
+++ b/source4/librpc/ndr/ndr_sec_helper.c
@@ -34,6 +34,21 @@ size_t ndr_size_dom_sid(const struct dom_sid *sid, int flags)
return 8 + 4*sid->num_auths;
}
+size_t ndr_size_dom_sid28(const struct dom_sid *sid, int flags)
+{
+ struct dom_sid zero_sid;
+
+ if (!sid) return 0;
+
+ ZERO_STRUCT(zero_sid);
+
+ if (memcmp(&zero_sid, sid, sizeof(zero_sid)) == 0) {
+ return 0;
+ }
+
+ return 8 + 4*sid->num_auths;
+}
+
/*
return the wire size of a security_ace
*/