Bug 3104 - samba update change-time on readonly shares with DOS
Summary: samba update change-time on readonly shares with DOS
Status: RESOLVED FIXED
Alias: None
Product: Samba 3.0
Classification: Unclassified
Component: File Services (show other bugs)
Version: 3.0.20
Hardware: x86 Linux
: P3 normal
Target Milestone: none
Assignee: Samba Bugzilla Account
QA Contact: Samba QA Contact
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2005-09-16 01:51 UTC by Leo Weppelman
Modified: 2005-09-18 06:29 UTC (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Leo Weppelman 2005-09-16 01:51:00 UTC
We export a share as readonly, but the filesystem itself is mounted read/write.
When we copy a file in DOS from this readonly share to somewhere writable, the
changetime of the original file is updated. This looks wrong to me.

Systems used:
  - PCclient on PC-DOS 6.2
  - Server: Sarge stable with self compiled samba-3.0.20 still
            running a 2.4.20-686 woody kernel.

I solved this with the following patch:
--- source/smbd/dosmode.c        (original from samba 3.0.20)
+++ source/smbd/dosmode.c        (myversion - pached function: file_utime)
@@ -448,6 +448,10 @@
        SMB_STRUCT_STAT sbuf;
        int ret = -1;
 
+       /* Don't update the time on read-only shares */
+       if (!CAN_WRITE(conn))
+               return 0;
+
        errno = 0;
        ZERO_STRUCT(sbuf);
Comment 1 Jeremy Allison 2005-09-16 12:38:24 UTC
Can you send me an ethereal trace showing this please ? I'm puzzled as to how
it's getting to this function as the "NEED_WRITE" filter in smbd/process.c
should be catching this before it gets this far.
Jeremy.
Comment 2 Jeremy Allison 2005-09-16 13:06:03 UTC
Scratch that - I see how this can happen now. I've committed your fix - thanks
very much !
Jeremy.
Comment 3 Thomas Bork 2005-09-18 06:29:00 UTC
> Scratch that - I see how this can happen now. I've committed your fix - thanks
> very much !

I don't understand, why it is necessarily to update the change time of the
original file at all. Nothing is changed on the source. Or hs this something to
do with the archive bit?

der tom