idmap_cache: Only touch "sid" on success in find_xid_to_sid
authorVolker Lendecke <vl@samba.org>
Tue, 26 Feb 2019 11:46:39 +0000 (12:46 +0100)
committerKarolin Seeger <kseeger@samba.org>
Wed, 13 Mar 2019 08:34:14 +0000 (08:34 +0000)
commit1df6720d74b325cf1c2eb61723fbf687b06c1c10
treefdcceaed243e12880f027da47ecb2a5da58525d4
parent41c1870a8c20e20697feec25b5407381d5f723ca
idmap_cache: Only touch "sid" on success in find_xid_to_sid

Why? This makes the negative mapping condition (is_null_sid) more
explicit in the code.

The callers in lookup_sid initialized "psid" anyway before, and the ones
in wb_xids2sids now do as well. This is more in line with other APIs we
have: Only touch output parameters if you have something to say.

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Christof Schmitt <cs@samba.org>
Bug: https://bugzilla.samba.org/show_bug.cgi?id=13813
(cherry picked from commit 4faf3e9f6da7515fc263d79f77226d105c2f8524)
source3/lib/idmap_cache.c
source3/winbindd/wb_xids2sids.c