summaryrefslogtreecommitdiff
path: root/source4/winbind
diff options
context:
space:
mode:
authorVolker Lendecke <vl@samba.org>2016-12-27 12:32:13 +0000
committerUri Simchoni <uri@samba.org>2016-12-28 20:17:12 +0100
commit6830a6a35026664a70f012dce973a9805c85b82d (patch)
tree3822822941195621a850f92dc2c18f8a1ca04681 /source4/winbind
parent2146df24d86eff3cbe6ca713db3bee546f2c7de7 (diff)
downloadsamba-6830a6a35026664a70f012dce973a9805c85b82d.tar.gz
idmap4: Slightly simplify idmap_xid_to_sid
No need to parse "S-1-22-1", we have global_sid_Unix_Users 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.c11
1 files changed, 4 insertions, 7 deletions
diff --git a/source4/winbind/idmap.c b/source4/winbind/idmap.c
index 6f701f04621..bc3b57b5855 100644
--- a/source4/winbind/idmap.c
+++ b/source4/winbind/idmap.c
@@ -221,7 +221,8 @@ static NTSTATUS idmap_xid_to_sid(struct idmap_context *idmap_ctx,
struct ldb_context *ldb = idmap_ctx->ldb_ctx;
struct ldb_result *res = NULL;
struct ldb_message *msg;
- struct dom_sid *unix_sid, *new_sid;
+ const struct dom_sid *unix_sid;
+ struct dom_sid *new_sid;
TALLOC_CTX *tmp_ctx = talloc_new(mem_ctx);
const char *id_type;
@@ -359,13 +360,9 @@ static NTSTATUS idmap_xid_to_sid(struct idmap_context *idmap_ctx,
/* For local users/groups , we just create a rid = uid/gid */
if (unixid->type == ID_TYPE_UID) {
- unix_sid = dom_sid_parse_talloc(tmp_ctx, "S-1-22-1");
+ unix_sid = &global_sid_Unix_Users;
} else {
- unix_sid = dom_sid_parse_talloc(tmp_ctx, "S-1-22-2");
- }
- if (unix_sid == NULL) {
- status = NT_STATUS_NO_MEMORY;
- goto failed;
+ unix_sid = &global_sid_Unix_Groups;
}
new_sid = dom_sid_add_rid(mem_ctx, unix_sid, unixid->id);