diff options
author | Volker Lendecke <vl@samba.org> | 2016-12-27 12:32:13 +0000 |
---|---|---|
committer | Uri Simchoni <uri@samba.org> | 2016-12-28 20:17:12 +0100 |
commit | 6830a6a35026664a70f012dce973a9805c85b82d (patch) | |
tree | 3822822941195621a850f92dc2c18f8a1ca04681 /source4/winbind | |
parent | 2146df24d86eff3cbe6ca713db3bee546f2c7de7 (diff) | |
download | samba-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.c | 11 |
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); |