summaryrefslogtreecommitdiff
path: root/source3/winbindd/wb_getpwsid.c
diff options
context:
space:
mode:
authorGünther Deschner <gd@samba.org>2018-05-08 11:18:56 +0200
committerKarolin Seeger <kseeger@samba.org>2018-06-20 09:22:23 +0200
commitc70a0d52afbfb600ce2c060379c66d3280b7d5fc (patch)
tree10541b2c8ad7ce2bbbccc38833ec6344756a82d9 /source3/winbindd/wb_getpwsid.c
parentc5f3606ca2574fc4e16b51eb857aafd8912f12a2 (diff)
downloadsamba-c70a0d52afbfb600ce2c060379c66d3280b7d5fc.tar.gz
s3-winbindd: use fill_domain_username_talloc() in winbind.
BUG: https://bugzilla.samba.org/show_bug.cgi?id=13437 Guenther Signed-off-by: Guenther Deschner <gd@samba.org> Reviewed-by: Andreas Schneider <asn@samba.org> (cherry picked from commit 3c6481d75cea175d0a69988577163efb40e2316b)
Diffstat (limited to 'source3/winbindd/wb_getpwsid.c')
-rw-r--r--source3/winbindd/wb_getpwsid.c15
1 files changed, 12 insertions, 3 deletions
diff --git a/source3/winbindd/wb_getpwsid.c b/source3/winbindd/wb_getpwsid.c
index 01c2f9cebfb..a8f32f2fc94 100644
--- a/source3/winbindd/wb_getpwsid.c
+++ b/source3/winbindd/wb_getpwsid.c
@@ -69,7 +69,8 @@ static void wb_getpwsid_queryuser_done(struct tevent_req *subreq)
req, struct wb_getpwsid_state);
struct winbindd_pw *pw = state->pw;
struct wbint_userinfo *info;
- fstring acct_name, output_username;
+ fstring acct_name;
+ const char *output_username;
char *mapped_name = NULL;
char *tmp;
NTSTATUS status;
@@ -101,16 +102,24 @@ static void wb_getpwsid_queryuser_done(struct tevent_req *subreq)
acct_name,
&mapped_name);
if (NT_STATUS_IS_OK(status)) {
- fill_domain_username(output_username,
+ output_username = fill_domain_username_talloc(state,
info->domain_name,
mapped_name, true);
+ if (output_username == NULL) {
+ tevent_req_nterror(req, NT_STATUS_NO_MEMORY);
+ return;
+ }
fstrcpy(acct_name, mapped_name);
} else if (NT_STATUS_EQUAL(status, NT_STATUS_FILE_RENAMED)) {
fstrcpy(acct_name, mapped_name);
} else {
- fill_domain_username(output_username,
+ output_username = fill_domain_username_talloc(state,
info->domain_name,
acct_name, true);
+ if (output_username == NULL) {
+ tevent_req_nterror(req, NT_STATUS_NO_MEMORY);
+ return;
+ }
}
strlcpy(pw->pw_name, output_username, sizeof(pw->pw_name));