summaryrefslogtreecommitdiff
path: root/source4/winbind
diff options
context:
space:
mode:
authorVolker Lendecke <vl@samba.org>2016-12-27 13:08:58 +0000
committerUri Simchoni <uri@samba.org>2016-12-28 20:17:13 +0100
commite06a342f80bf75863d0c0f057c19aeab2bcb3c29 (patch)
treed94acaff3ec48bae4b6a458d66101885e0d26a80 /source4/winbind
parent166e23d98b90a814450164eb363bbbcbad0a2163 (diff)
downloadsamba-e06a342f80bf75863d0c0f057c19aeab2bcb3c29.tar.gz
idmap4: Use sid_check_is_in_unix_users()
This avoids the need for the special unix users sid Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Uri Simchoni <uri@samba.org>
Diffstat (limited to 'source4/winbind')
-rw-r--r--source4/winbind/idmap.c9
-rw-r--r--source4/winbind/idmap.h1
2 files changed, 2 insertions, 8 deletions
diff --git a/source4/winbind/idmap.c b/source4/winbind/idmap.c
index bc3b57b5855..bcf45874374 100644
--- a/source4/winbind/idmap.c
+++ b/source4/winbind/idmap.c
@@ -23,6 +23,7 @@
#include "includes.h"
#include "auth/auth.h"
#include "librpc/gen_ndr/ndr_security.h"
+#include "lib/util_unixsids.h"
#include <ldb.h>
#include "ldb_wrap.h"
#include "param/param.h"
@@ -180,12 +181,6 @@ struct idmap_context *idmap_init(TALLOC_CTX *mem_ctx,
goto fail;
}
- idmap_ctx->unix_users_sid = dom_sid_parse_talloc(
- idmap_ctx, "S-1-22-1");
- if (idmap_ctx->unix_users_sid == NULL) {
- goto fail;
- }
-
idmap_ctx->samdb = samdb_connect(idmap_ctx, ev_ctx, lp_ctx, system_session(lp_ctx), 0);
if (idmap_ctx->samdb == NULL) {
DEBUG(0, ("Failed to load sam.ldb in idmap_init\n"));
@@ -412,7 +407,7 @@ static NTSTATUS idmap_sid_to_xid(struct idmap_context *idmap_ctx,
TALLOC_CTX *tmp_ctx = talloc_new(mem_ctx);
const char *sam_attrs[] = {"uidNumber", "gidNumber", "samAccountType", NULL};
- if (dom_sid_in_domain(idmap_ctx->unix_users_sid, sid)) {
+ if (sid_check_is_in_unix_users(sid)) {
uint32_t rid;
DEBUG(6, ("This is a local unix uid, just calculate that.\n"));
status = dom_sid_split_rid(tmp_ctx, sid, NULL, &rid);
diff --git a/source4/winbind/idmap.h b/source4/winbind/idmap.h
index 676955c2b24..bc753b227ab 100644
--- a/source4/winbind/idmap.h
+++ b/source4/winbind/idmap.h
@@ -28,7 +28,6 @@ struct idmap_context {
struct loadparm_context *lp_ctx;
struct ldb_context *ldb_ctx;
struct dom_sid *unix_groups_sid;
- struct dom_sid *unix_users_sid;
struct ldb_context *samdb;
};