winbindd: winbindd_ccache_save() -> bool_dispatch_table
authorVolker Lendecke <vl@samba.org>
Wed, 2 May 2018 18:26:19 +0000 (20:26 +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 acccd61128aa4d853dbbb5a966b5271580053843..03b44bc9a51ab0d37acca0ea17292762399e21d8 100644 (file)
@@ -539,7 +539,6 @@ static struct winbindd_dispatch_table {
          "WINBINDD_PRIV_PIPE_DIR" },
 
        /* Credential cache access */
-       { WINBINDD_CCACHE_SAVE, winbindd_ccache_save, "CCACHE_SAVE" },
 
        /* End of list */
 
@@ -572,6 +571,9 @@ static struct winbindd_bool_dispatch_table {
        { WINBINDD_CCACHE_NTLMAUTH,
          winbindd_ccache_ntlm_auth,
          "NTLMAUTH" },
+       { WINBINDD_CCACHE_SAVE,
+         winbindd_ccache_save,
+         "CCACHE_SAVE" },
 };
 
 struct winbindd_async_dispatch_table {
index 7b558660cc9072586664ee842dad65cb1523b24b..b3a8c89d7be4010c398ca97fe0e9fa0c91ae1fd7 100644 (file)
@@ -309,7 +309,7 @@ bool winbindd_ccache_ntlm_auth(struct winbindd_cli_state *state)
        return NT_STATUS_IS_OK(result);
 }
 
-void winbindd_ccache_save(struct winbindd_cli_state *state)
+bool winbindd_ccache_save(struct winbindd_cli_state *state)
 {
        struct winbindd_domain *domain;
        fstring name_namespace, name_domain, name_user;
@@ -336,8 +336,7 @@ void winbindd_ccache_save(struct winbindd_cli_state *state)
                DEBUG(5,("winbindd_ccache_save: cannot parse domain and user "
                         "from name [%s]\n",
                         state->request->data.ccache_save.user));
-               request_error(state);
-               return;
+               return false;
        }
 
        /*
@@ -353,13 +352,11 @@ void winbindd_ccache_save(struct winbindd_cli_state *state)
        if (domain == NULL) {
                DEBUG(5, ("winbindd_ccache_save: can't get domain [%s]\n",
                          name_domain));
-               request_error(state);
-               return;
+               return false;
        }
 
        if (!check_client_uid(state, state->request->data.ccache_save.uid)) {
-               request_error(state);
-               return;
+               return false;
        }
 
        status = winbindd_add_memory_creds(
@@ -370,8 +367,7 @@ void winbindd_ccache_save(struct winbindd_cli_state *state)
        if (!NT_STATUS_IS_OK(status)) {
                DEBUG(1, ("winbindd_add_memory_creds failed %s\n",
                          nt_errstr(status)));
-               request_error(state);
-               return;
+               return false;
        }
-       request_ok(state);
+       return true;
 }
index 0ffaf803e83c25a8ab329b510a310c493b4383e4..2005730be334805d6660a8ed37d82bf998abd0db 100644 (file)
@@ -176,7 +176,7 @@ void wcache_store_ndr(struct winbindd_domain *domain, uint32_t opnum,
 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);
+bool winbindd_ccache_save(struct winbindd_cli_state *state);
 
 /* The following definitions come from winbindd/winbindd_cm.c  */
 void winbind_msg_domain_offline(struct messaging_context *msg_ctx,