From: Volker Lendecke Date: Mon, 23 Apr 2018 10:13:40 +0000 (+0200) Subject: nsswitch: Only connect to the priv socket if required X-Git-Tag: ldb-1.4.0~540 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=fdf0b2a784f83f9fcaa204be7f28f9e7fc47836b;p=thirdparty%2Fsamba.git nsswitch: Only connect to the priv socket if required This should speed up calls like "wbinfo -p" Signed-off-by: Volker Lendecke Reviewed-by: Stefan Metzmacher --- diff --git a/nsswitch/wb_common.c b/nsswitch/wb_common.c index da81734ae3c..6768fde535b 100644 --- a/nsswitch/wb_common.c +++ b/nsswitch/wb_common.c @@ -401,6 +401,10 @@ static int winbind_open_pipe_sock(struct winbindd_context *ctx, return -1; } + if (need_priv == 0) { + return ctx->winbindd_fd; + } + /* try and get priv pipe */ request.wb_flags = WBFLAG_RECURSE; @@ -424,7 +428,7 @@ static int winbind_open_pipe_sock(struct winbindd_context *ctx, SAFE_FREE(response.extra_data.data); } - if ((need_priv != 0) && (ctx->is_privileged == 0)) { + if (ctx->is_privileged == 0) { return -1; }