svn commit: samba r20720 - in branches: SAMBA_3_0/source/smbd
SAMBA_3_0_24/source/smbd
jra at samba.org
jra at samba.org
Sat Jan 13 01:07:40 GMT 2007
Author: jra
Date: 2007-01-13 01:07:39 +0000 (Sat, 13 Jan 2007)
New Revision: 20720
WebSVN: http://websvn.samba.org/cgi-bin/viewcvs.cgi?view=rev&root=samba&rev=20720
Log:
Fix the chkpath problem, still looking at findfirst.
Jeremy.
Modified:
branches/SAMBA_3_0/source/smbd/filename.c
branches/SAMBA_3_0/source/smbd/reply.c
branches/SAMBA_3_0_24/source/smbd/filename.c
branches/SAMBA_3_0_24/source/smbd/reply.c
Changeset:
Modified: branches/SAMBA_3_0/source/smbd/filename.c
===================================================================
--- branches/SAMBA_3_0/source/smbd/filename.c 2007-01-12 23:49:53 UTC (rev 20719)
+++ branches/SAMBA_3_0/source/smbd/filename.c 2007-01-13 01:07:39 UTC (rev 20720)
@@ -147,7 +147,12 @@
if (name[0] == '.' && (name[1] == '/' || name[1] == '\0')) {
/* Start of pathname can't be "." only. */
- return NT_STATUS_OBJECT_NAME_INVALID;
+ if (name[1] == '\0' || name[2] == '\0') {
+ return NT_STATUS_OBJECT_NAME_INVALID;
+ } else {
+ /* Longer pathname starts with ./ */
+ return NT_STATUS_OBJECT_PATH_NOT_FOUND;
+ }
}
/*
Modified: branches/SAMBA_3_0/source/smbd/reply.c
===================================================================
--- branches/SAMBA_3_0/source/smbd/reply.c 2007-01-12 23:49:53 UTC (rev 20719)
+++ branches/SAMBA_3_0/source/smbd/reply.c 2007-01-13 01:07:39 UTC (rev 20720)
@@ -632,6 +632,13 @@
status = unix_convert(conn, name, False, NULL, &sbuf);
if (!NT_STATUS_IS_OK(status)) {
END_PROFILE(SMBchkpth);
+ /* Strange DOS error code semantics only for chkpth... */
+ if (!(SVAL(inbuf,smb_flg2) & FLAGS2_32_BIT_ERROR_CODES)) {
+ if (NT_STATUS_EQUAL(NT_STATUS_OBJECT_NAME_INVALID,status)) {
+ /* We need to map to ERRbadpath */
+ status = NT_STATUS_OBJECT_PATH_NOT_FOUND;
+ }
+ }
return ERROR_NT(status);
}
Modified: branches/SAMBA_3_0_24/source/smbd/filename.c
===================================================================
--- branches/SAMBA_3_0_24/source/smbd/filename.c 2007-01-12 23:49:53 UTC (rev 20719)
+++ branches/SAMBA_3_0_24/source/smbd/filename.c 2007-01-13 01:07:39 UTC (rev 20720)
@@ -147,7 +147,12 @@
if (name[0] == '.' && (name[1] == '/' || name[1] == '\0')) {
/* Start of pathname can't be "." only. */
- return NT_STATUS_OBJECT_NAME_INVALID;
+ if (name[1] == '\0' || name[2] == '\0') {
+ return NT_STATUS_OBJECT_NAME_INVALID;
+ } else {
+ /* Longer pathname starts with ./ */
+ return NT_STATUS_OBJECT_PATH_NOT_FOUND;
+ }
}
/*
Modified: branches/SAMBA_3_0_24/source/smbd/reply.c
===================================================================
--- branches/SAMBA_3_0_24/source/smbd/reply.c 2007-01-12 23:49:53 UTC (rev 20719)
+++ branches/SAMBA_3_0_24/source/smbd/reply.c 2007-01-13 01:07:39 UTC (rev 20720)
@@ -632,6 +632,13 @@
status = unix_convert(conn, name, False, NULL, &sbuf);
if (!NT_STATUS_IS_OK(status)) {
END_PROFILE(SMBchkpth);
+ /* Strange DOS error code semantics only for chkpth... */
+ if (!(SVAL(inbuf,smb_flg2) & FLAGS2_32_BIT_ERROR_CODES)) {
+ if (NT_STATUS_EQUAL(NT_STATUS_OBJECT_NAME_INVALID,status)) {
+ /* We need to map to ERRbadpath */
+ status = NT_STATUS_OBJECT_PATH_NOT_FOUND;
+ }
+ }
return ERROR_NT(status);
}
More information about the samba-cvs
mailing list