nsswitch: Correct users of "ctx->is_privileged"
authorVolker Lendecke <vl@samba.org>
Fri, 4 May 2018 13:23:18 +0000 (15:23 +0200)
committerJeremy Allison <jra@samba.org>
Tue, 24 Jul 2018 18:36:50 +0000 (20:36 +0200)
winbindd_context->is_privileged is a bool

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
nsswitch/wb_common.c

index df32789..42b341b 100644 (file)
@@ -37,7 +37,7 @@ struct winbindd_context {
 
 static struct winbindd_context wb_global_ctx = {
        .winbindd_fd = -1,
-       .is_privileged = 0,
+       .is_privileged = false,
        .our_pid = 0
 };
 
@@ -371,7 +371,7 @@ static int winbind_open_pipe_sock(struct winbindd_context *ctx,
                ctx->our_pid = getpid();
        }
 
-       if ((need_priv != 0) && (ctx->is_privileged == 0)) {
+       if ((need_priv != 0) && !ctx->is_privileged) {
                winbind_close_sock(ctx);
        }
 
@@ -389,7 +389,7 @@ static int winbind_open_pipe_sock(struct winbindd_context *ctx,
                return -1;
        }
 
-       ctx->is_privileged = 0;
+       ctx->is_privileged = false;
 
        /* version-check the socket */
 
@@ -422,13 +422,13 @@ static int winbind_open_pipe_sock(struct winbindd_context *ctx,
                if (fd != -1) {
                        close(ctx->winbindd_fd);
                        ctx->winbindd_fd = fd;
-                       ctx->is_privileged = 1;
+                       ctx->is_privileged = true;
                }
 
                SAFE_FREE(response.extra_data.data);
        }
 
-       if (ctx->is_privileged == 0) {
+       if (!ctx->is_privileged) {
                return -1;
        }