bool add_rid_to_array_unique(TALLOC_CTX *mem_ctx,
uint32_t rid, uint32_t **pp_rids, size_t *p_num);
bool is_null_sid(const struct dom_sid *sid);
+bool sids_contains_sid(const struct auth_SidAttr *sids,
+ const uint32_t num_sids,
+ const struct dom_sid *sid,
+ uint32_t attrs);
#endif /*_DOM_SID_H_*/
-
return dom_sid_equal(sid, &null_sid);
}
+/**
+ * Return true if an array of auth_SidAttr contains a certain SID with certain
+ * attributes.
+ *
+ * @param [in] sids The auth_SidAttr array.
+ * @param [in] num_sids The size of the auth_SidArray array.
+ * @param [in] sid The SID in question.
+ * @param [in] attrs The attributes of the SID.
+ * @returns true if the array contains the SID.
+ */
+bool sids_contains_sid(const struct auth_SidAttr *sids,
+ const uint32_t num_sids,
+ const struct dom_sid *sid,
+ uint32_t attrs)
+{
+ uint32_t i;
+
+ for (i = 0; i < num_sids; i++) {
+ if (attrs != sids[i].attrs) {
+ continue;
+ }
+ if (!dom_sid_equal(&sids[i].sid, sid)) {
+ continue;
+ }
+
+ return true;
+ }
+ return false;
+}
+
/*
* See [MS-LSAT] 3.1.1.1.1 Predefined Translation Database and Corresponding View
*/
#include "libcli/security/security.h"
#include "dsdb/common/util.h"
-/* This function tests if a SID structure "sids" contains the SID "sid" */
-static bool sids_contains_sid(const struct auth_SidAttr *sids,
- const uint32_t num_sids,
- const struct dom_sid *sid,
- uint32_t attrs)
-{
- uint32_t i;
-
- for (i = 0; i < num_sids; i++) {
- if (attrs != sids[i].attrs) {
- continue;
- }
- if (!dom_sid_equal(&sids[i].sid, sid)) {
- continue;
- }
-
- return true;
- }
- return false;
-}
-
/*
* This function generates the transitive closure of a given SAM object "dn_val"
* (it basically expands nested memberships).
source='common/util.c common/util_trusts.c common/util_groups.c common/util_samr.c common/dsdb_dn.c common/dsdb_access.c common/util_links.c common/rodc_helper.c',
autoproto='common/proto.h',
private_library=True,
- deps='ldb NDR_DRSBLOBS util_ldb LIBCLI_AUTH samba-hostconfig samba_socket cli-ldap-common flag_mapping UTIL_RUNCMD SAMBA_VERSION'
+ deps='ldb NDR_DRSBLOBS util_ldb LIBCLI_AUTH samba-hostconfig samba_socket cli-ldap-common flag_mapping UTIL_RUNCMD SAMBA_VERSION samba-security'
)