diff options
author | Simo Sorce <idra@samba.org> | 2003-05-01 11:47:48 +0000 |
---|---|---|
committer | Simo Sorce <idra@samba.org> | 2003-05-01 11:47:48 +0000 |
commit | 75cace04fdcb672cc6c3c3ec8403206f2b222c50 (patch) | |
tree | a0e30d36b57bb698cd4af43c769c6deee0ca232d /source3/nsswitch/winbindd_user.c | |
parent | ed454fe3d677a27e19b904f5d0d3199b62c9a1b0 (diff) | |
download | samba-75cace04fdcb672cc6c3c3ec8403206f2b222c50.tar.gz samba-75cace04fdcb672cc6c3c3ec8403206f2b222c50.tar.bz2 samba-75cace04fdcb672cc6c3c3ec8403206f2b222c50.zip |
*id_to_*id call reshape to return NTSTATUS errors
plus internal fixes
1st stage
(This used to be commit 6d036761e565bc93964bb3c939d5b7d78d5778a3)
Diffstat (limited to 'source3/nsswitch/winbindd_user.c')
-rw-r--r-- | source3/nsswitch/winbindd_user.c | 19 |
1 files changed, 5 insertions, 14 deletions
diff --git a/source3/nsswitch/winbindd_user.c b/source3/nsswitch/winbindd_user.c index dd66275390..dc07bc42e7 100644 --- a/source3/nsswitch/winbindd_user.c +++ b/source3/nsswitch/winbindd_user.c @@ -36,29 +36,23 @@ static BOOL winbindd_fill_pwent(char *dom_name, char *user_name, fstring output_username; pstring homedir; fstring sid_string; - unid_t id; - int id_type; if (!pw || !dom_name || !user_name) return False; /* Resolve the uid number */ - id_type = ID_USERID; - if (NT_STATUS_IS_ERR(idmap_get_id_from_sid(&id, &id_type, user_sid))) { + if (NT_STATUS_IS_ERR(sid_to_uid(user_sid, &(pw->pw_uid)))) { DEBUG(1, ("error getting user id for sid %s\n", sid_to_string(sid_string, user_sid))); return False; } - pw->pw_uid = id.uid; /* Resolve the gid number */ - id_type = ID_GROUPID; - if (NT_STATUS_IS_ERR(idmap_get_id_from_sid(&id, &id_type, group_sid))) { + if (NT_STATUS_IS_ERR(sid_to_gid(group_sid, &(pw->pw_gid)))) { DEBUG(1, ("error getting group id for sid %s\n", sid_to_string(sid_string, group_sid))); return False; } - pw->pw_gid = id.gid; /* Username */ @@ -184,8 +178,7 @@ enum winbindd_result winbindd_getpwuid(struct winbindd_cli_state *state) WINBIND_USERINFO user_info; TALLOC_CTX *mem_ctx; NTSTATUS status; - unid_t id; - int id_type; + gid_t gid; /* Bug out if the uid isn't in the winbind range */ @@ -198,8 +191,7 @@ enum winbindd_result winbindd_getpwuid(struct winbindd_cli_state *state) /* Get rid from uid */ - id.uid = state->request.data.uid; - if (NT_STATUS_IS_ERR(idmap_get_sid_from_id(&user_sid, id, ID_USERID))) { + if (NT_STATUS_IS_ERR(uid_to_sid(&user_sid, state->request.data.uid))) { DEBUG(1, ("could not convert uid %d to SID\n", state->request.data.uid)); return WINBINDD_ERROR; @@ -243,8 +235,7 @@ enum winbindd_result winbindd_getpwuid(struct winbindd_cli_state *state) /* Check group has a gid number */ - id_type = ID_GROUPID; - if (NT_STATUS_IS_ERR(idmap_get_id_from_sid(&id, &id_type, user_info.group_sid))) { + if (NT_STATUS_IS_ERR(sid_to_gid(user_info.group_sid, &gid))) { DEBUG(1, ("error getting group id for user %s\n", user_name)); talloc_destroy(mem_ctx); return WINBINDD_ERROR; |