The branch, master has been updated
       via  f87219d6e6e049a6d233696d126ea231cbbc1672 (commit)
      from  1ad54998a971b58f870263b4b8d6e051d627c79e (commit)

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


- Log -----------------------------------------------------------------
commit f87219d6e6e049a6d233696d126ea231cbbc1672
Author: Volker Lendecke <[EMAIL PROTECTED]>
Date:   Sat Oct 25 15:23:36 2008 +0200

    Move the is_known_pipename check into np_open

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

Summary of changes:
 source3/rpc_server/srv_pipe_hnd.c |    6 ++++++
 source3/smbd/nttrans.c            |   15 +++++----------
 source3/smbd/pipes.c              |   16 +++++-----------
 3 files changed, 16 insertions(+), 21 deletions(-)


Changeset truncated at 500 lines:

diff --git a/source3/rpc_server/srv_pipe_hnd.c 
b/source3/rpc_server/srv_pipe_hnd.c
index aaa3557..822d50a 100644
--- a/source3/rpc_server/srv_pipe_hnd.c
+++ b/source3/rpc_server/srv_pipe_hnd.c
@@ -925,6 +925,12 @@ NTSTATUS np_open(struct smb_request *smb_req, struct 
connection_struct *conn,
        struct files_struct *fsp;
        struct pipes_struct *p;
 
+       /* See if it is one we want to handle. */
+
+       if (!is_known_pipename(name)) {
+               return NT_STATUS_OBJECT_NAME_NOT_FOUND;
+       }
+
        status = file_new(smb_req, conn, &fsp);
        if (!NT_STATUS_IS_OK(status)) {
                DEBUG(0, ("file_new failed: %s\n", nt_errstr(status)));
diff --git a/source3/smbd/nttrans.c b/source3/smbd/nttrans.c
index b78c946..3084168 100644
--- a/source3/smbd/nttrans.c
+++ b/source3/smbd/nttrans.c
@@ -276,21 +276,16 @@ static void nt_open_pipe(char *fname, connection_struct 
*conn,
 
        DEBUG(4,("nt_open_pipe: Opening pipe %s.\n", fname));
 
-       /* See if it is one we want to handle. */
-
-       if (!is_known_pipename(fname)) {
-               reply_botherror(req, NT_STATUS_OBJECT_NAME_NOT_FOUND,
-                               ERRDOS, ERRbadpipe);
-               return;
-       }
-
        /* Strip \\ off the name. */
        fname++;
 
-       DEBUG(3,("nt_open_pipe: Known pipe %s opening.\n", fname));
-
        status = np_open(req, conn, fname, &fsp);
        if (!NT_STATUS_IS_OK(status)) {
+               if (NT_STATUS_EQUAL(status, NT_STATUS_OBJECT_NAME_NOT_FOUND)) {
+                       reply_botherror(req, NT_STATUS_OBJECT_NAME_NOT_FOUND,
+                                       ERRDOS, ERRbadpipe);
+                       return;
+               }
                reply_nterror(req, status);
                return;
        }
diff --git a/source3/smbd/pipes.c b/source3/smbd/pipes.c
index 25a1fe2..d971e9d 100644
--- a/source3/smbd/pipes.c
+++ b/source3/smbd/pipes.c
@@ -66,13 +66,6 @@ void reply_open_pipe_and_X(connection_struct *conn, struct 
smb_request *req)
 
        DEBUG(4,("Opening pipe %s.\n", pipe_name));
 
-       /* See if it is one we want to handle. */
-       if (!is_known_pipename(pipe_name)) {
-               reply_botherror(req, NT_STATUS_OBJECT_NAME_NOT_FOUND,
-                               ERRDOS, ERRbadpipe);
-               return;
-       }
-
        /* Strip \PIPE\ off the name. */
        fname = pipe_name + PIPELEN;
 
@@ -86,12 +79,13 @@ void reply_open_pipe_and_X(connection_struct *conn, struct 
smb_request *req)
        }
 #endif
 
-       /* Known pipes arrive with DIR attribs. Remove it so a regular file */
-       /* can be opened and add it in after the open. */
-       DEBUG(3,("Known pipe %s opening.\n",fname));
-
        status = np_open(req, conn, fname, &fsp);
        if (!NT_STATUS_IS_OK(status)) {
+               if (NT_STATUS_EQUAL(status, NT_STATUS_OBJECT_NAME_NOT_FOUND)) {
+                       reply_botherror(req, NT_STATUS_OBJECT_NAME_NOT_FOUND,
+                                       ERRDOS, ERRbadpipe);
+                       return;
+               }
                reply_nterror(req, status);
                return;
        }


-- 
Samba Shared Repository

Reply via email to