[Samba] v3.2.0 and MS-DOS: Directories must be upper-case??

Jeremy Allison jra at samba.org
Fri Jul 25 20:09:37 GMT 2008


On Fri, Jul 25, 2008 at 01:54:20PM -0500, Daniel Johnson wrote:
> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: SHA1
> 
> > Can you get me a debug level 10 log from smbd of
> >
> > ver > test.txt
> > del test.txt
> >
> > from the MS-DOS client please ?
> 
> Sure.
> http://thor.chguernsey.com/temp/samba-debug-20080725.tgz (120kb)
> http://thor.chguernsey.com/temp/samba-debug-20080725.tgz.sig
> 
> I did the test three times.  Once to an all-upper-case directory, once
> to all-lower, and once to mixed-case.  I ran a packet capture on the
> server's interface at the same time, it is included in the tarball.

Ok - very useful trace - thanks !

What is happening is the file is successfully created,
then the timestamps are requested to be set (via the
reply_mknew call). This means the name conversion in
create_file() is working correctly.

The smb_set_file_time() call to set the filetimes is failing
because it's using the unmodified name passed in by the
client, not the modified name (matching case on the
disk) thaqt comes out from create_file().

The attached patch should fix this - thanks a *lot*
for catching this ! Will be fixed for 3.2.1 and above.

Jeremy.
-------------- next part --------------
diff --git a/source/smbd/reply.c b/source/smbd/reply.c
index 2506ff9..b41b330 100644
--- a/source/smbd/reply.c
+++ b/source/smbd/reply.c
@@ -2000,7 +2000,7 @@ void reply_mknew(struct smb_request *req)
 	}
 
 	ts[0] = get_atimespec(&sbuf); /* atime. */
-	status = smb_set_file_time(conn, fsp, fname, &sbuf, ts, true);
+	status = smb_set_file_time(conn, fsp, fsp->fsp_fname, &sbuf, ts, true);
 	if (!NT_STATUS_IS_OK(status)) {
 		END_PROFILE(SMBcreate);
 		reply_openerror(req, status);


More information about the samba mailing list