mirror of
https://github.com/samba-team/samba.git
synced 2024-12-25 23:21:54 +03:00
Fix suggested by "Christian Groessler" <chris@fast-ag.de>
dir.c: Cause dptr_create to return -2 when failing on unix error.
reply.c: Use UNIXERROR in more cases.
server.c: Add ENOTDIR mapping to error table.
trans2.c: Correctly determine UNIX error on dptr_create.
Jeremy (jallison@whistle.com)
(This used to be commit de38a0b34f
)
This commit is contained in:
parent
5c3357953c
commit
c76dc7c296
@ -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();
|
||||
|
@ -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));
|
||||
|
@ -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},
|
||||
|
@ -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 */
|
||||
{
|
||||
|
Loading…
Reference in New Issue
Block a user