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)));
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;
}
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;
}
#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;
}