diff options
Diffstat (limited to 'daemons/ipa-sam')
-rw-r--r-- | daemons/ipa-sam/ipa_sam.c | 17 |
1 files changed, 16 insertions, 1 deletions
diff --git a/daemons/ipa-sam/ipa_sam.c b/daemons/ipa-sam/ipa_sam.c index ce8f623bd..be033476d 100644 --- a/daemons/ipa-sam/ipa_sam.c +++ b/daemons/ipa-sam/ipa_sam.c @@ -95,7 +95,6 @@ int dom_sid_compare_domain(const struct dom_sid *sid1, const struct dom_sid *sid char *sid_string_talloc(TALLOC_CTX *mem_ctx, const struct dom_sid *sid); /* available in libsmbconf.so */ char *sid_string_dbg(const struct dom_sid *sid); /* available in libsmbconf.so */ bool is_null_sid(const struct dom_sid *sid); /* available in libsecurity.so */ -bool strnequal(const char *s1,const char *s2,size_t n); /* available in libutil_str.so */ bool trim_char(char *s,char cfront,char cback); /* available in libutil_str.so */ bool sid_peek_check_rid(const struct dom_sid *exp_dom_sid, const struct dom_sid *sid, uint32_t *rid); /* available in libsecurity.so */ char *escape_ldap_string(TALLOC_CTX *mem_ctx, const char *s); /* available in libsmbconf.so */ @@ -169,6 +168,22 @@ struct ipasam_privates { char *client_princ; }; +static bool strnequal(const char *s1, const char *s2, size_t n) { + if (s1 == s2) { + return true; + } + + if (s1 == NULL || s2 == NULL || n == 0) { + return false; + } + + if (strncasecmp(s1, s2, n) == 0) { + return true; + } + + return false; +} + static LDAP *priv2ld(struct ldapsam_privates *priv) { return priv->smbldap_state->ldap_struct; |