From 9e10ddd00e5d0bfe47930adb4627c7a5efc543fb Mon Sep 17 00:00:00 2001 From: Christof Schmitt Date: Fri, 24 Apr 2015 09:49:23 -0700 Subject: [PATCH] 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 Reviewed-by: Jeremy Allison --- source3/lib/util_sd.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) 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)); } -- 2.47.3