winbindd: winbindd_ccache_ntlm_auth() -> bool_dispatch_table
authorVolker Lendecke <vl@samba.org>
Wed, 2 May 2018 18:23:54 +0000 (20:23 +0200)
committerVolker Lendecke <vl@samba.org>
Thu, 17 May 2018 06:44:19 +0000 (08:44 +0200)
Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
source3/winbindd/winbindd.c
source3/winbindd/winbindd_ccache_access.c
source3/winbindd/winbindd_proto.h

index 1608a14974cab63f355d7df189564cfc6c7a100c..acccd61128aa4d853dbbb5a966b5271580053843 100644 (file)
@@ -539,7 +539,6 @@ static struct winbindd_dispatch_table {
          "WINBINDD_PRIV_PIPE_DIR" },
 
        /* Credential cache access */
-       { WINBINDD_CCACHE_NTLMAUTH, winbindd_ccache_ntlm_auth, "NTLMAUTH" },
        { WINBINDD_CCACHE_SAVE, winbindd_ccache_save, "CCACHE_SAVE" },
 
        /* End of list */
@@ -570,6 +569,9 @@ static struct winbindd_bool_dispatch_table {
        { WINBINDD_DC_INFO,
          winbindd_dc_info,
          "DC_INFO" },
+       { WINBINDD_CCACHE_NTLMAUTH,
+         winbindd_ccache_ntlm_auth,
+         "NTLMAUTH" },
 };
 
 struct winbindd_async_dispatch_table {
index ddeaf1d99402e75ecca05a0e4b2d58d19561baab..7b558660cc9072586664ee842dad65cb1523b24b 100644 (file)
@@ -180,7 +180,7 @@ static bool check_client_uid(struct winbindd_cli_state *state, uid_t uid)
        return True;
 }
 
-void winbindd_ccache_ntlm_auth(struct winbindd_cli_state *state)
+bool winbindd_ccache_ntlm_auth(struct winbindd_cli_state *state)
 {
        struct winbindd_domain *domain;
        fstring name_namespace, name_domain, name_user;
@@ -206,8 +206,7 @@ void winbindd_ccache_ntlm_auth(struct winbindd_cli_state *state)
        if (!ok) {
                DEBUG(5,("winbindd_ccache_ntlm_auth: cannot parse domain and user from name [%s]\n",
                        state->request->data.ccache_ntlm_auth.user));
-               request_error(state);
-               return;
+               return false;
        }
 
        domain = find_auth_domain(state->request->flags, name_domain);
@@ -215,13 +214,11 @@ void winbindd_ccache_ntlm_auth(struct winbindd_cli_state *state)
        if (domain == NULL) {
                DEBUG(5,("winbindd_ccache_ntlm_auth: can't get domain [%s]\n",
                        name_domain));
-               request_error(state);
-               return;
+               return false;
        }
 
        if (!check_client_uid(state, state->request->data.ccache_ntlm_auth.uid)) {
-               request_error(state);
-               return;
+               return false;
        }
 
        /* validate blob lengths */
@@ -309,11 +306,7 @@ void winbindd_ccache_ntlm_auth(struct winbindd_cli_state *state)
        data_blob_free(&auth);
 
   process_result:
-       if (!NT_STATUS_IS_OK(result)) {
-               request_error(state);
-               return;
-       }
-       request_ok(state);
+       return NT_STATUS_IS_OK(result);
 }
 
 void winbindd_ccache_save(struct winbindd_cli_state *state)
index ea8225256bc39d68202eabaeebe4522db99e94f5..0ffaf803e83c25a8ab329b510a310c493b4383e4 100644 (file)
@@ -173,7 +173,7 @@ void wcache_store_ndr(struct winbindd_domain *domain, uint32_t opnum,
 
 /* The following definitions come from winbindd/winbindd_ccache_access.c  */
 
-void winbindd_ccache_ntlm_auth(struct winbindd_cli_state *state);
+bool winbindd_ccache_ntlm_auth(struct winbindd_cli_state *state);
 enum winbindd_result winbindd_dual_ccache_ntlm_auth(struct winbindd_domain *domain,
                                                struct winbindd_cli_state *state);
 void winbindd_ccache_save(struct winbindd_cli_state *state);