return ldb_operr(ldb);
}
- prim_group_dn = samdb_search_dn(ldb, ac, NULL, "(objectSID=%s)",
- dom_sid_string(ac, sid));
+ prim_group_dn = samdb_search_dn(ldb, ac, NULL, "(objectSid=%s)",
+ ldap_encode_ndr_dom_sid(ac, sid));
if (prim_group_dn == NULL) {
ldb_asprintf_errstring(ldb,
"Failed to find primary group with RID %u!",
return ldb_operr(ldb);
}
- prev_prim_group_dn = samdb_search_dn(ldb, ac, NULL, "(objectSID=%s)",
- dom_sid_string(ac, sid));
+ prev_prim_group_dn = samdb_search_dn(ldb, ac, NULL, "(objectSid=%s)",
+ ldap_encode_ndr_dom_sid(ac, sid));
if (prev_prim_group_dn == NULL) {
return ldb_operr(ldb);
}
return ldb_operr(ldb);
}
- new_prim_group_dn = samdb_search_dn(ldb, ac, NULL, "(objectSID=%s)",
- dom_sid_string(ac, sid));
+ new_prim_group_dn = samdb_search_dn(ldb, ac, NULL, "(objectSid=%s)",
+ ldap_encode_ndr_dom_sid(ac, sid));
if (new_prim_group_dn == NULL) {
/* Here we know if the specified new primary group candidate is
* valid or not. */
return ldb_operr(ldb);
}
- group_dn = samdb_search_dn(ldb, ac, NULL, "(objectSID=%s)",
- dom_sid_string(ac, sid));
+ group_dn = samdb_search_dn(ldb, ac, NULL, "(objectSid=%s)",
+ ldap_encode_ndr_dom_sid(ac, sid));
if (group_dn == NULL) {
return ldb_operr(ldb);
}
#include "../librpc/gen_ndr/ndr_security.h"
#include "../libcli/security/dom_sid.h"
#include "libcli/security/security.h"
+#include "libcli/ldap/ldap_ndr.h"
#include "../lib/talloc/talloc.h"
#include "lib/policy/policy.h"
TALLOC_CTX *mem_ctx;
const char **gpos;
struct ldb_result *result;
- const char *sid;
+ char *sid;
struct ldb_dn *dn;
struct ldb_message_element *element;
bool inherit;
mem_ctx = talloc_new(gp_ctx);
NT_STATUS_HAVE_NO_MEMORY(mem_ctx);
- sid = dom_sid_string(mem_ctx, &token->sids[PRIMARY_USER_SID_INDEX]);
+ sid = ldap_encode_ndr_dom_sid(mem_ctx,
+ &token->sids[PRIMARY_USER_SID_INDEX]);
+ NT_STATUS_HAVE_NO_MEMORY(sid);
/* Find the user DN and objectclass via the sid from the security token */
rv = ldb_search(gp_ctx->ldb_ctx,
#include "dsdb/samdb/samdb.h"
#include "auth/auth.h"
#include "libcli/security/security.h"
+#include "libcli/ldap/ldap_ndr.h"
#include "lib/ldb/include/ldb.h"
#include "lib/ldb/include/ldb_errors.h"
#include "../lib/crypto/md5.h"
LDB_SCOPE_SUBTREE,
attrs,
"(&(objectSid=%s)(objectClass=user))",
- dom_sid_string(mem_ctx, sid));
+ ldap_encode_ndr_dom_sid(mem_ctx, sid));
if (ret != LDB_SUCCESS) {
DEBUG(2, ("Failed to search for SID %s in SAM for NTP signing: "
"%s\n",