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>
Tue, 12 Mar 2019 11:25:42 +0000 (11:25 +0000)
commitb0a1d90050c54bb22006b5c0e3c67187c20e7f04
treec05f9127ea53c2556f02f10f08d62838ffaba8d8
parent14234542aa56dcee04609019db30c598f381a491
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