diff options
author | Stefan Metzmacher <metze@samba.org> | 2008-01-18 08:43:45 +0100 |
---|---|---|
committer | Stefan Metzmacher <metze@samba.org> | 2008-02-13 13:30:15 +0100 |
commit | 3649f728ed3a449622c4e1dbc3ebf4c3536b72f7 (patch) | |
tree | 412c1a59030af83f5e38664720a7a335fcb0846d | |
parent | dc708ef3a2ec4d55e38c7fd79205d77a0cf33bbb (diff) | |
download | samba-3649f728ed3a449622c4e1dbc3ebf4c3536b72f7.tar.gz samba-3649f728ed3a449622c4e1dbc3ebf4c3536b72f7.tar.bz2 samba-3649f728ed3a449622c4e1dbc3ebf4c3536b72f7.zip |
winbindd: add rids and other_sids arrays in WBFLAG_PAM_INFO3_TEXT mode
metze
(This used to be commit c5e6dd1ca9611e2830ff773875998c01bf779a64)
-rw-r--r-- | source3/winbindd/winbindd_pam.c | 44 |
1 files changed, 43 insertions, 1 deletions
diff --git a/source3/winbindd/winbindd_pam.c b/source3/winbindd/winbindd_pam.c index dd27ad62f3..e3574bbcd6 100644 --- a/source3/winbindd/winbindd_pam.c +++ b/source3/winbindd/winbindd_pam.c @@ -31,6 +31,10 @@ static NTSTATUS append_info3_as_txt(TALLOC_CTX *mem_ctx, struct winbindd_cli_state *state, NET_USER_INFO_3 *info3) { + char *ex; + size_t size; + uint32_t i; + state->response.data.auth.info3.logon_time = nt_time_to_unix(info3->logon_time); state->response.data.auth.info3.logoff_time = @@ -83,6 +87,42 @@ static NTSTATUS append_info3_as_txt(TALLOC_CTX *mem_ctx, &info3->uni_logon_dom, sizeof(state->response.data.auth.info3.logon_dom)); + ex = talloc_strdup(mem_ctx, ""); + NT_STATUS_HAVE_NO_MEMORY(ex); + + for (i=0; i < info3->num_groups; i++) { + ex = talloc_asprintf_append_buffer(ex, "0x%08X:0x%08X\n", + info3->gids[i].g_rid, + info3->gids[i].attr); + NT_STATUS_HAVE_NO_MEMORY(ex); + } + + for (i=0; i < info3->num_other_sids; i++) { + char *sid; + + sid = dom_sid_string(mem_ctx, &info3->other_sids[i].sid); + NT_STATUS_HAVE_NO_MEMORY(sid); + + ex = talloc_asprintf_append_buffer(ex, "%s:0x%08X\n", + sid, + info3->other_sids_attrib[i]); + NT_STATUS_HAVE_NO_MEMORY(ex); + + talloc_free(sid); + } + + size = talloc_get_size(ex); + + SAFE_FREE(state->response.extra_data.data); + state->response.extra_data.data = SMB_MALLOC(size); + if (!state->response.extra_data.data) { + return NT_STATUS_NO_MEMORY; + } + memcpy(state->response.extra_data.data, ex, size); + talloc_free(ex); + + state->response.length += size; + return NT_STATUS_OK; } @@ -703,16 +743,18 @@ static bool check_request_flags(uint32_t flags) { uint32_t flags_edata = WBFLAG_PAM_AFS_TOKEN | WBFLAG_PAM_UNIX_NAME | + WBFLAG_PAM_INFO3_TEXT | WBFLAG_PAM_INFO3_NDR; if ( ( (flags & flags_edata) == WBFLAG_PAM_AFS_TOKEN) || ( (flags & flags_edata) == WBFLAG_PAM_INFO3_NDR) || + ( (flags & flags_edata) == WBFLAG_PAM_INFO3_TEXT)|| ( (flags & flags_edata) == WBFLAG_PAM_UNIX_NAME) || !(flags & flags_edata) ) { return True; } - DEBUG(1,("check_request_flags: invalid request flags\n")); + DEBUG(1,("check_request_flags: invalid request flags[0x%08X]\n",flags)); return False; } |