s3:auth: fix create_token_from_sid() to not fail in the winbindd case
authorMichael Adam <obnox@samba.org>
Mon, 10 Dec 2012 14:06:27 +0000 (15:06 +0100)
committerKarolin Seeger <kseeger@samba.org>
Tue, 11 Dec 2012 08:05:08 +0000 (09:05 +0100)
commit1afacd4bdd2de12bffa8899c9b4d90c456d78536
tree610d43bfe54be65ac59798e4410c45d629a72886
parentc14d1da132da186b0d3da3acc10768a9f607628e
s3:auth: fix create_token_from_sid() to not fail in the winbindd case

Commit 1c3c5e2156d9096f60bd53a96b88c2f1001d898a which factored
the sid-based variant out of create_token_from_username() broke
the case of a user handled by winbindd in that the "found_username"
was set to NULL which caused the function to fail with
NT_STATUS_NO_MEMORY further down.

This patch fixes the function so that the case of found_username == NULL
is cleanly separated from the NO_MEMORY case and the caller can provide
the username in this case, if required.

This fixes bug #9457.

Signed-off-by: Michael Adam <obnox@samba.org>
Autobuild-User(master): Volker Lendecke <vl@samba.org>
Autobuild-Date(master): Mon Dec 10 18:18:54 CET 2012 on sn-devel-104
(cherry picked from commit c5b150b33fc54ed97dbd0736cc6f4c15977d6e70)
source3/auth/token_util.c