summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChristof Schmitt <cs@samba.org>2015-04-24 09:49:23 -0700
committerJeremy Allison <jra@samba.org>2015-04-25 00:04:24 +0200
commit9e10ddd00e5d0bfe47930adb4627c7a5efc543fb (patch)
tree78ae7fc34f1666f670354c0b8552d5c49ac0f2ff
parent42c46ab642fa989a4e7606b4abd213e2b6c808a7 (diff)
downloadsamba-9e10ddd00e5d0bfe47930adb4627c7a5efc543fb.tar.gz
util_sd: Make server conncection optional
If cli is not set, only attempt numeric conversions. BUG: https://bugzilla.samba.org/show_bug.cgi?id=11237 Signed-off-by: Christof Schmitt <cs@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
-rw-r--r--source3/lib/util_sd.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/source3/lib/util_sd.c b/source3/lib/util_sd.c
index 7f5badf876e..810053927f2 100644
--- a/source3/lib/util_sd.c
+++ b/source3/lib/util_sd.c
@@ -141,7 +141,7 @@ void SidToString(struct cli_state *cli, fstring str, const struct dom_sid *sid,
sid_to_fstring(str, sid);
- if (numeric) {
+ if (numeric || cli == NULL) {
return;
}
@@ -218,6 +218,10 @@ bool StringToSid(struct cli_state *cli, struct dom_sid *sid, const char *str)
return true;
}
+ if (cli == NULL) {
+ return false;
+ }
+
return NT_STATUS_IS_OK(cli_lsa_lookup_name(cli, str, &type, sid));
}