Samba 2.0.6, MKS' touch.exe, and file/dir time stamps

Jeremy Allison jeremy at
Wed Nov 24 22:16:51 GMT 1999

don_mccall at wrote:
> Hi Peter, et. al;
> I can reproduce this behavior with the standard NT 4.0 touch command (that you
> can pull from the NT 4.0 ResourceKit CD) from the command prompt if I map a
> network drive to my Samba 2.05b HP-UX 11.0 server.  But interestingly enough, I
> did a "touch *" in the directory in question, and ONE file DID reflect the new
> time, the other didn't.
> Looking at the debug file for samba, I found the reason why:
> [1999/11/24 15:04:49, 4] smbd/dosmode.c:(251)
>   set_filetime(anothertestbydon.txt) failed: Not owner
> Turns out that I was comming in as 'nobody'; I only had one file in the
> directory I was using to test your problem on, so I did a drag and drop copy of
> this file (anothertestbydon.txt) and it was called "Copy of
> anothertestbydon.txt".  Of course, since I had just CREATED this copy, 'nobody'
> owned it. the original file was owned by another user.  When I did a "touch *"
> the file I 'owned' changed timestamp, and the original one did not.
> Perhaps your issue is related?  By the way, I took a netmon trace of the
> success and failure, and did not see where the reply to the SetFilePathInfo
> transact2 smb (which is the smb that the NT client sent to request the date
> change in response to the 'touch' command) in the failing case differed with
> the one that succeeded - neither returned any error information, which jives
> with your finding that the command comes back clean, even though the timestamp
> remains unchanged.
> Try using smbstatus to see what username you are attached to, and what unix
> user that maps to, and then see whether changing the ownership on one of the
> files you are doing a touch on makes a difference...
> Sorry I ran out of time to investigate if this is reasonable behavior, but I
> did a quick test by 'touching' a file on an NT 4.0 server share which I did not
> own, and the timestamp on THAT file did change...
> Hope this helps,
> Don

There's a missing "return False" statement in smbd/dosmode.c

Try the following patch (should apply cleanly to 2.0.5a and
2.0.6) and see if this fixes the problem.


	Jeremy Allison,
	Samba Team.

-------------------------cut here-------------------------------------
Index: smbd/dosmode.c
RCS file: /data/cvs/samba/source/smbd/dosmode.c,v
retrieving revision
diff -u -r1.6.2.2 dosmode.c
--- dosmode.c   1999/06/14 22:25:48
+++ dosmode.c   1999/11/24 21:16:34
@@ -249,9 +249,8 @@

   if (file_utime(conn, fname, &times)) {
     DEBUG(4,("set_filetime(%s) failed: %s\n",fname,strerror(errno)));
+    return False;

-------------------------cut here-------------------------------------
Buying an operating system without source is like buying
a self-assembly Space Shuttle with no instructions.

More information about the samba mailing list