diff options
-rw-r--r-- | source3/smbd/process.c | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/source3/smbd/process.c b/source3/smbd/process.c index afde2e94a9..0373cd471c 100644 --- a/source3/smbd/process.c +++ b/source3/smbd/process.c @@ -936,8 +936,14 @@ static int switch_message(int type,char *inbuf,char *outbuf,int size,int bufsize change_to_root_user(); /* does this protocol need a valid tree connection? */ - if ((flags & AS_USER) && !conn) - return ERROR_DOS(ERRSRV, ERRinvnid); + if ((flags & AS_USER) && !conn) { + /* Amazingly, the error code depends on the command (from Samba4). */ + if (type == SMBntcreateX) { + return ERROR_NT(NT_STATUS_INVALID_HANDLE); + } else { + return ERROR_DOS(ERRSRV, ERRinvnid); + } + } /* does this protocol need to be run as the connected user? */ |