diff options
author | Sumit Bose <sbose@redhat.com> | 2012-05-24 12:39:56 +0200 |
---|---|---|
committer | Jan Zeleny <jzeleny@redhat.com> | 2012-06-08 14:42:00 +0200 |
commit | 2998435fcc95857b73049b3955af9889ab595f24 (patch) | |
tree | c989231a56a595c2120b62a35f13b2124ac7abe0 /src/lib/idmap/sss_idmap_private.h | |
parent | 7733e4179f56fb0ca41788b5d8de2ee1130b1bad (diff) | |
download | sssd-2998435fcc95857b73049b3955af9889ab595f24.tar.gz sssd-2998435fcc95857b73049b3955af9889ab595f24.tar.bz2 sssd-2998435fcc95857b73049b3955af9889ab595f24.zip |
sss_idmap: add support for samba struct dom_sid
The samba ndr libraries use struct dom_sid to handle SIDs. Since there
is no public samba library which offers conversion from other
representations, e.g. as string, this is added to libsss_idmap.
To avoid compile-time or run-time dependency to any samba library or
header file the definition of the struct is copied here.
Diffstat (limited to 'src/lib/idmap/sss_idmap_private.h')
-rw-r--r-- | src/lib/idmap/sss_idmap_private.h | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/src/lib/idmap/sss_idmap_private.h b/src/lib/idmap/sss_idmap_private.h index 776c56ab..bdb52895 100644 --- a/src/lib/idmap/sss_idmap_private.h +++ b/src/lib/idmap/sss_idmap_private.h @@ -38,4 +38,23 @@ struct sss_idmap_ctx { struct idmap_domain_info *idmap_domain_info; }; +/* This is a copy of the definition in the samba gen_ndr/security.h header + * file. We use it here to be able to offer conversions form struct dom_sid to + * string or binary representation since those are not made available by + * public samba libraries. + * + * If the definition ever changes on the samba side we have to adopt the + * change. But chances are very low that this will ever happen since e.g. this + * struct is also defined in public documentation from Microsoft. See e.g. + * section 2.4.2.3 of "[MS-DTYP]: Windows Data Types" + * http://msdn.microsoft.com/en-us/library/cc230364(v=prot.10) + */ + +struct dom_sid { + uint8_t sid_rev_num; + int8_t num_auths; + uint8_t id_auth[6]; + uint32_t sub_auths[15]; +}; + #endif /* SSS_IDMAP_PRIVATE_H_ */ |