summaryrefslogtreecommitdiff
path: root/nsswitch
diff options
context:
space:
mode:
authorVolker Lendecke <vl@samba.org>2018-04-23 12:13:40 +0200
committerVolker Lendecke <vl@samba.org>2018-04-24 14:32:10 +0200
commitfdf0b2a784f83f9fcaa204be7f28f9e7fc47836b (patch)
tree8b729b825f499beecea5a4d6e267318581eab1f9 /nsswitch
parent6120f568017544425071c9ad817faa236fd27058 (diff)
downloadsamba-fdf0b2a784f83f9fcaa204be7f28f9e7fc47836b.tar.gz
nsswitch: Only connect to the priv socket if required
This should speed up calls like "wbinfo -p" Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Stefan Metzmacher <metze@samba.org>
Diffstat (limited to 'nsswitch')
-rw-r--r--nsswitch/wb_common.c6
1 files changed, 5 insertions, 1 deletions
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;
}