named_pipe_auth Always lower case the incoming pipe name
authorAndrew Bartlett <abartlet@samba.org>
Thu, 3 Jun 2010 10:59:25 +0000 (20:59 +1000)
committerAndrew Bartlett <abartlet@samba.org>
Mon, 7 Jun 2010 13:34:28 +0000 (23:34 +1000)
Windows connects to an upper case NETLOGON pipe, and we can't find the
socket to connect to until we lower case the name.

Andrew Bartlett

libcli/named_pipe_auth/npa_tstream.c

index 0834c7dda68b140c4dbc6f3358da07c93c32fbb9..c96e30f80639d977a19c5b4554b6a1519a6caee4 100644 (file)
@@ -73,6 +73,11 @@ struct tevent_req *tstream_npa_connect_send(TALLOC_CTX *mem_ctx,
        struct tevent_req *subreq;
        int ret;
        enum ndr_err_code ndr_err;
+       char *lower_case_npipe = strlower_talloc(talloc_tos(), npipe);
+
+       if (!lower_case_npipe) {
+               return NULL;
+       }
 
        req = tevent_req_create(mem_ctx, &state,
                                struct tstream_npa_connect_state);
@@ -84,7 +89,8 @@ struct tevent_req *tstream_npa_connect_send(TALLOC_CTX *mem_ctx,
 
        state->unix_path = talloc_asprintf(state, "%s/%s",
                                           directory,
-                                          npipe);
+                                          lower_case_npipe);
+       talloc_free(lower_case_npipe);
        if (tevent_req_nomem(state->unix_path, req)) {
                goto post;
        }