diff options
author | Sumit Bose <sbose@redhat.com> | 2012-08-27 13:42:26 +0200 |
---|---|---|
committer | Martin Kosek <mkosek@redhat.com> | 2012-09-06 09:24:58 +0200 |
commit | 454c2d4e8cb88dea0c1984504383288216cebd14 (patch) | |
tree | 233f25072a80bc0a85a4651cfda1cc0f151c6a5b /daemons/ipa-sam | |
parent | 885f4a6bb812c56d9085c61d1c955cdc95183f41 (diff) | |
download | freeipa-454c2d4e8cb88dea0c1984504383288216cebd14.tar.gz freeipa-454c2d4e8cb88dea0c1984504383288216cebd14.tar.xz freeipa-454c2d4e8cb88dea0c1984504383288216cebd14.zip |
ipasam: replace sid_copy()
Diffstat (limited to 'daemons/ipa-sam')
-rw-r--r-- | daemons/ipa-sam/ipa_sam.c | 16 |
1 files changed, 15 insertions, 1 deletions
diff --git a/daemons/ipa-sam/ipa_sam.c b/daemons/ipa-sam/ipa_sam.c index c3eff47d3..e7774f5b3 100644 --- a/daemons/ipa-sam/ipa_sam.c +++ b/daemons/ipa-sam/ipa_sam.c @@ -85,7 +85,6 @@ bool fetch_ldap_pw(char **dn, char** pw); /* available in libpdb.so */ bool sid_check_is_builtin(const struct dom_sid *sid); /* available in libpdb.so */ /* available in libpdb.so, renamed from sid_check_is_domain() in c43505b621725c9a754f0ee98318d451b093f2ed */ bool sid_check_is_our_sam(const struct dom_sid *sid); -void sid_copy(struct dom_sid *dst, const struct dom_sid *src); /* available in libsecurity.so */ bool sid_linearize(char *outbuf, size_t len, const struct dom_sid *sid); /* available in libsmbconf.so */ bool string_to_sid(struct dom_sid *sidout, const char *sidstr); /* available in libsecurity.so */ bool sid_compose(struct dom_sid *dst, const struct dom_sid *domain_sid, uint32_t rid); /* available in libsecurity.so */ @@ -166,6 +165,21 @@ struct ipasam_privates { char *client_princ; }; +static void sid_copy(struct dom_sid *dst, const struct dom_sid *src) +{ + size_t c; + + memset(dst, 0, sizeof(*dst)); + + dst->sid_rev_num = src->sid_rev_num; + dst->num_auths = src->num_auths; + memcpy(&dst->id_auth[0], &src->id_auth[0], sizeof(src->id_auth)); + + for (c = 0; c < src->num_auths; c++) { + dst->sub_auths[c] = src->sub_auths[c]; + } +} + static bool strnequal(const char *s1, const char *s2, size_t n) { if (s1 == s2) { return true; |