Bug 5948 - Files moved to CIFS-mounted file system get the executable bit set
Files moved to CIFS-mounted file system get the executable bit set
Status: RESOLVED FIXED
Product: CifsVFS
Classification: Unclassified
Component: user space tools
2.6
Other Linux
: P3 normal
: ---
Assigned To: Steve French
http://bugs.debian.org/501678
:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2008-12-07 05:38 UTC by Debian samba package maintainers (PUBLIC MAILING LIST)
Modified: 2009-04-04 07:39 UTC (History)
1 user (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Debian samba package maintainers (PUBLIC MAILING LIST) 2008-12-07 05:38:47 UTC
This issue is described in Debian bug #501678 (details in the mentioned URL).

When files without the executable bit are moved to a cifs-mounted directory, the executable bit is automatically set.

This seems related to "map archive" as setting this to "no" solves the issue.

However, it is our feeling that files that don't originally have the executable bit should not get it when they're moved.
Comment 1 Shirish S. Pargaonkar 2009-03-16 08:13:12 UTC
I do not see this happening with 1.54 of cifs and Version 3.0.33-3.7.el5 of
samba server either with copy and move of text as well as an executable file.

Here is a simple setup and steps attempted to recreate the problem.

[idsc0]
        path =  /tmp/idsc0dir
        browseable = Yes
        read only = No
        guest ok = Yes
        writable = yes


mount -t cifs //idsc0/idsc0 /mnt/smb_a -o user=root,pass=password

----------------------------------------------------------------------
cifstest6:~ # ls -l /etc/motd
-rw-r--r-- 1 root root 0 Dec 10 10:33 /etc/motd
cifstest6:~ # cp /etc/motd /mnt/smb_a/motd
cifstest6:~ # cp -p /etc/motd /mnt/smb_a/motd.1
cifstest6:~ # ls -l /mnt/smb_a
total 214724

-rw-r--r-- 1 root root          0 Mar 16  2009 motd
-rw-r--r-- 1 root root          0 Dec 10 10:33 motd.1

------------------------------------------------------------------------

cifstest6:~ # cp -p /etc/motd /etc/motd.tomove
cifstest6:~ # ls -l /etc/motd.tomove
-rw-r--r-- 1 root root 0 Dec 10 10:33 /etc/motd.tomove
cifstest6:~ # mv /etc/motd.tomove /mnt/smb_a
cifstest6:~ # ls -l /etc/motd.tomove
ls: cannot access /etc/motd.tomove: No such file or directory
cifstest6:~ # ls -l /mnt/smb_a/motd.tomove
-rw-r--r-- 1 root root 0 Dec 10 10:33 /mnt/smb_a/motd.tomove


------------------------------------------------------------------------
cifstest6:~ # ls -l /bin/date
-rwxr-xr-x 1 root root 56120 Dec  5 17:53 /bin/date

cifstest6:~ # cp /bin/date /mnt/smb_a
cifstest6:~ # cp -p /bin/date /mnt/smb_a/date.1

cifstest6:~ # ls -l /mnt/smb_a
total 214652
-rwxr--r-- 1 root root      56120 Mar 16  2009 date
-rwxr-xr-x 1 root root      56120 Dec  5 17:53 date.1

--------------------------------------------------------------------------
cifstest6:~ # cp /bin/date /bin/date.tomove
cifstest6:~ # mv /bin/date.tomove /mnt/smb_a
cifstest6:~ # ls -l /bin/date.tomove
ls: cannot access /bin/date.tomove: No such file or directory
cifstest6:~ # ls -l /mnt/smb_a/date.tomove
-rwxr-xr-x 1 root root 56120 Mar 16 08:00 /mnt/smb_a/date.tomove

Comment 2 Debian samba package maintainers (PUBLIC MAILING LIST) 2009-04-04 07:39:26 UTC
Confirmed unreproducible with 3.3.2