The branch, master has been updated
       via  f140bf2e6578e45b8603d4a6c5feef9a3b735804 (commit)
       via  795b896ab083bb0c8336f91f0b8275ee5ef74fc1 (commit)
      from  aa70e44cd0576e5280e24cf35000369a47dd958f (commit)

http://gitweb.samba.org/?p=samba.git;a=shortlog;h=master


- Log -----------------------------------------------------------------
commit f140bf2e6578e45b8603d4a6c5feef9a3b735804
Author: Volker Lendecke <[email protected]>
Date:   Mon May 18 07:08:34 2009 +0200

    Fix broken pipe handling
    
    Metze is right: If we have *any* error at the socket level, we just can
    not continue.
    
    Also, apply some defensive programming: With this async stuff someone else
    might already have closed the socket.

commit 795b896ab083bb0c8336f91f0b8275ee5ef74fc1
Author: Volker Lendecke <[email protected]>
Date:   Mon May 18 07:08:28 2009 +0200

    Fix a type-punned warning

-----------------------------------------------------------------------

Summary of changes:
 source3/libsmb/async_smb.c              |    4 ++--
 source3/rpc_client/cli_pipe.c           |    2 +-
 source3/rpc_client/rpc_transport_sock.c |    4 ++--
 3 files changed, 5 insertions(+), 5 deletions(-)


Changeset truncated at 500 lines:

diff --git a/source3/libsmb/async_smb.c b/source3/libsmb/async_smb.c
index 96b7054..12bc0a6 100644
--- a/source3/libsmb/async_smb.c
+++ b/source3/libsmb/async_smb.c
@@ -742,7 +742,7 @@ static void cli_smb_sent(struct tevent_req *subreq)
        nwritten = writev_recv(subreq, &err);
        TALLOC_FREE(subreq);
        if (nwritten == -1) {
-               if (err == EPIPE) {
+               if (state->cli->fd != -1) {
                        close(state->cli->fd);
                        state->cli->fd = -1;
                }
@@ -791,7 +791,7 @@ static void cli_smb_received(struct tevent_req *subreq)
        received = read_smb_recv(subreq, talloc_tos(), &inbuf, &err);
        TALLOC_FREE(subreq);
        if (received == -1) {
-               if (err == EPIPE) {
+               if (cli->fd != -1) {
                        close(cli->fd);
                        cli->fd = -1;
                }
diff --git a/source3/rpc_client/cli_pipe.c b/source3/rpc_client/cli_pipe.c
index 3d7db06..7d059e4 100644
--- a/source3/rpc_client/cli_pipe.c
+++ b/source3/rpc_client/cli_pipe.c
@@ -3425,7 +3425,7 @@ NTSTATUS rpc_pipe_open_ncalrpc(TALLOC_CTX *mem_ctx, const 
char *socket_path,
        addr.sun_family = AF_UNIX;
        strncpy(addr.sun_path, socket_path, sizeof(addr.sun_path));
 
-       if (sys_connect(fd, (struct sockaddr *)&addr) == -1) {
+       if (sys_connect(fd, (struct sockaddr *)(void *)&addr) == -1) {
                DEBUG(0, ("connect(%s) failed: %s\n", socket_path,
                          strerror(errno)));
                close(fd);
diff --git a/source3/rpc_client/rpc_transport_sock.c 
b/source3/rpc_client/rpc_transport_sock.c
index 3756f73..4ab6500 100644
--- a/source3/rpc_client/rpc_transport_sock.c
+++ b/source3/rpc_client/rpc_transport_sock.c
@@ -82,7 +82,7 @@ static void rpc_sock_read_done(struct tevent_req *subreq)
 
        state->received = async_recv_recv(subreq, &err);
        if (state->received == -1) {
-               if (err == EPIPE) {
+               if (state->transp->fd != -1) {
                        close(state->transp->fd);
                        state->transp->fd = -1;
                }
@@ -152,7 +152,7 @@ static void rpc_sock_write_done(struct tevent_req *subreq)
 
        state->sent = async_send_recv(subreq, &err);
        if (state->sent == -1) {
-               if (err == EPIPE) {
+               if (state->transp->fd != -1) {
                        close(state->transp->fd);
                        state->transp->fd = -1;
                }


-- 
Samba Shared Repository

Reply via email to