diff options
author | Volker Lendecke <vl@samba.org> | 2018-04-23 12:13:40 +0200 |
---|---|---|
committer | Volker Lendecke <vl@samba.org> | 2018-04-24 14:32:10 +0200 |
commit | fdf0b2a784f83f9fcaa204be7f28f9e7fc47836b (patch) | |
tree | 8b729b825f499beecea5a4d6e267318581eab1f9 /nsswitch | |
parent | 6120f568017544425071c9ad817faa236fd27058 (diff) | |
download | samba-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.c | 6 |
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; } |