diff options
author | Stefan Metzmacher <metze@samba.org> | 2012-05-28 18:23:50 +0200 |
---|---|---|
committer | Stefan Metzmacher <metze@samba.org> | 2012-05-28 19:51:59 +0200 |
commit | abf566ca994b8e2b47ab3da69cde67568bca8d71 (patch) | |
tree | f5c8304b1563206bf4d095495f77908447b7cd07 | |
parent | e262db6c3173e977b08f1db37ae11e391246cc30 (diff) | |
download | samba-abf566ca994b8e2b47ab3da69cde67568bca8d71.tar.gz samba-abf566ca994b8e2b47ab3da69cde67568bca8d71.tar.bz2 samba-abf566ca994b8e2b47ab3da69cde67568bca8d71.zip |
s3:smbd: fix reply_open_pipe_and_X() to behave like windows (2008 R2)
See rpc.samba3.smb1-pipe-name.
metze
-rw-r--r-- | source3/smbd/pipes.c | 26 |
1 files changed, 15 insertions, 11 deletions
diff --git a/source3/smbd/pipes.c b/source3/smbd/pipes.c index f9e3618cb4..bb62739eba 100644 --- a/source3/smbd/pipes.c +++ b/source3/smbd/pipes.c @@ -31,11 +31,6 @@ #include "libcli/security/security.h" #include "rpc_server/srv_pipe_hnd.h" -#define PIPE "\\PIPE\\" -#define PIPELEN strlen(PIPE) - -#define MAX_PIPE_NAME_LEN 24 - NTSTATUS open_np_file(struct smb_request *smb_req, const char *name, struct files_struct **pfsp) { @@ -112,15 +107,24 @@ void reply_open_pipe_and_X(connection_struct *conn, struct smb_request *req) /* If the name doesn't start \PIPE\ then this is directed */ /* at a mailslot or something we really, really don't understand, */ /* not just something we really don't understand. */ - if ( strncmp(pipe_name,PIPE,PIPELEN) != 0 ) { - reply_nterror(req, NT_STATUS_ACCESS_DENIED); + +#define PIPE "PIPE\\" +#define PIPELEN strlen(PIPE) + + fname = pipe_name; + while (fname[0] == '\\') { + fname++; + } + if (!strnequal(fname, PIPE, PIPELEN)) { + reply_nterror(req, NT_STATUS_OBJECT_PATH_SYNTAX_BAD); return; } + fname += PIPELEN; + while (fname[0] == '\\') { + fname++; + } - DEBUG(4,("Opening pipe %s.\n", pipe_name)); - - /* Strip \PIPE\ off the name. */ - fname = pipe_name + PIPELEN; + DEBUG(4,("Opening pipe %s => %s.\n", pipe_name, fname)); #if 0 /* |