summaryrefslogtreecommitdiff
path: root/source3/smbd
diff options
context:
space:
mode:
Diffstat (limited to 'source3/smbd')
-rw-r--r--source3/smbd/dir.c2
-rw-r--r--source3/smbd/reply.c8
-rw-r--r--source3/smbd/server.c1
-rw-r--r--source3/smbd/trans2.c6
4 files changed, 13 insertions, 4 deletions
diff --git a/source3/smbd/dir.c b/source3/smbd/dir.c
index 5bd5b1d573..06ee6ae8ed 100644
--- a/source3/smbd/dir.c
+++ b/source3/smbd/dir.c
@@ -282,7 +282,7 @@ int dptr_create(int cnum,char *path, BOOL expect_close,int pid)
int oldi;
if (!start_dir(cnum,path))
- return(-1);
+ return(-2); /* Code to say use a unix error return code. */
if (dptrs_open >= MAXDIR)
dptr_idleoldest();
diff --git a/source3/smbd/reply.c b/source3/smbd/reply.c
index 0216b58c34..f630e71e25 100644
--- a/source3/smbd/reply.c
+++ b/source3/smbd/reply.c
@@ -546,7 +546,7 @@ int reply_chkpth(char *inbuf,char *outbuf)
ok = directory_exist(name,NULL);
if (!ok)
- return(ERROR(ERRDOS,ERRbadpath));
+ return(UNIXERROR(ERRDOS,ERRbadpath));
outsize = set_message(outbuf,0,0,True);
@@ -825,7 +825,11 @@ int reply_search(char *inbuf,char *outbuf)
{
dptr_num = dptr_create(cnum,directory,expect_close,SVAL(inbuf,smb_pid));
if (dptr_num < 0)
- return(ERROR(ERRDOS,ERRnofids));
+ {
+ if(dptr_num == -2)
+ return (UNIXERROR(ERRDOS,ERRnofids));
+ return(ERROR(ERRDOS,ERRnofids));
+ }
}
DEBUG(4,("dptr_num is %d\n",dptr_num));
diff --git a/source3/smbd/server.c b/source3/smbd/server.c
index 3d5b75794b..93d05ffab6 100644
--- a/source3/smbd/server.c
+++ b/source3/smbd/server.c
@@ -1940,6 +1940,7 @@ struct
{EPERM,ERRDOS,ERRnoaccess},
{EACCES,ERRDOS,ERRnoaccess},
{ENOENT,ERRDOS,ERRbadfile},
+ {ENOTDIR,ERRDOS,ERRbadpath},
{EIO,ERRHRD,ERRgeneral},
{EBADF,ERRSRV,ERRsrverror},
{EINVAL,ERRSRV,ERRsrverror},
diff --git a/source3/smbd/trans2.c b/source3/smbd/trans2.c
index 11a2a50ffe..e7fd6824ab 100644
--- a/source3/smbd/trans2.c
+++ b/source3/smbd/trans2.c
@@ -614,7 +614,11 @@ static int call_trans2findfirst(char *inbuf, char *outbuf, int bufsize, int cnum
dptr_num = dptr_create(cnum,directory, True ,SVAL(inbuf,smb_pid));
if (dptr_num < 0)
- return(ERROR(ERRDOS,ERRbadpath));
+ {
+ if(dptr_num == -2)
+ return (UNIXERROR(ERRDOS,ERRbadpath));
+ return(ERROR(ERRDOS,ERRbadpath));
+ }
/* convert the formatted masks */
{