renaming via samba changes file permissions
Moderators: white, Hacker, petermad, Stefan2
renaming via samba changes file permissions
I use Samba to map UNIX (Solaris) drives to Windows. When I rename a file from windows, it changes the file permissions. In my test, i renamed an empty file named 'core' to 'core.renamed' and the permissions changed from 600 rw- --- --- to 720 rwx -w- ---.
Why? How do I control this?
Why? How do I control this?
- ghisler(Author)
- Site Admin
- Posts: 48108
- Joined: 2003-02-04, 09:46 UTC
- Location: Switzerland
- Contact:
Renaming doesn't usually change any permissions.
I can only guess that Samba prohibited the renaming, so TC copied the file to the new name and then deleted the original. Can you confirm this? You can check this by renaming a large file, you would get a progress bar then for the copied data.
I can only guess that Samba prohibited the renaming, so TC copied the file to the new name and then deleted the original. Can you confirm this? You can check this by renaming a large file, you would get a progress bar then for the copied data.
Author of Total Commander
https://www.ghisler.com
https://www.ghisler.com
I do not like for this to be executed without any dialog informing about concequences...ghisler(Author) wrote:Renaming doesn't usually change any permissions.
I can only guess that Samba prohibited the renaming, so TC copied the file to the new name and then deleted the original. Can you confirm this? You can check this by renaming a large file, you would get a progress bar then for the copied data.
Ambiguity succeeds where honesty dares not venture.
Rename from explorer works correctly and does not change permissions. Using Total Commander 6.53, a 56 meg file was renamed amost instantly, so it does not appear to be copying the file. File permissions were changed from 644 to 764
-rw-r--r-- 1 jbr3e meme 56901632 Jul 20 09:06 k_sto_combo.sas7bdat
to
-rwxrw-r-- 1 jbr3e meme 56901632 Jul 20 09:06 k_sto_combo.sas7bdat.rename*
Previously the file permissions were changed from 600 rw- --- --- to 720 rwx -w- ---. so it seems that 120 (--x -w- ---) is being added
my umask is 022
-rw-r--r-- 1 jbr3e meme 56901632 Jul 20 09:06 k_sto_combo.sas7bdat
to
-rwxrw-r-- 1 jbr3e meme 56901632 Jul 20 09:06 k_sto_combo.sas7bdat.rename*
Previously the file permissions were changed from 600 rw- --- --- to 720 rwx -w- ---. so it seems that 120 (--x -w- ---) is being added
my umask is 022
- ghisler(Author)
- Site Admin
- Posts: 48108
- Joined: 2003-02-04, 09:46 UTC
- Location: Switzerland
- Contact:
OK I checked what TC does exactly:
1. Read the attribute of the file
2. If it has read only, hidden, or system set, reset to archive only. This is done because some network file systems seem to prevent the renaming with these attributes.
3. Rename the file
4. Set the attribute back to what it was in step 1, including the archive bit
I guess that Samba is trying to map this to Unix permissions in some weird way, causing the change of the permissons in your case. Unfortunately I have no influence on how Samba handles calls to Windows attribute changes. Maybe it can be controlled in the samba settings.
1. Read the attribute of the file
2. If it has read only, hidden, or system set, reset to archive only. This is done because some network file systems seem to prevent the renaming with these attributes.
3. Rename the file
4. Set the attribute back to what it was in step 1, including the archive bit
I guess that Samba is trying to map this to Unix permissions in some weird way, causing the change of the permissons in your case. Unfortunately I have no influence on how Samba handles calls to Windows attribute changes. Maybe it can be controlled in the samba settings.
Author of Total Commander
https://www.ghisler.com
https://www.ghisler.com
renaming via samba changes file permissions
I'm confused then. Why does the explorere rename work correctly and TC not work correctly?
Ahem, I wouldn't be so convinced of that.UNIX file permissions are 9 characters (bits, whatever ...) and must be mapped to windows attributes Read-Only,System, Hidden, and Archive.
Roman
Mal angenommen, du drückst Strg+F, wählst die FTP-Verbindung (mit gespeichertem Passwort), klickst aber nicht auf Verbinden, sondern fällst tot um.
renaming via samba changes file permissions
I am quite willing to be convinced otherwise, but it seems to me that the problem arises when permissions are changed and then reset in step 4 (from above by ghisler). 120 (--x -w- ---) is consistently or'ed onto the existing attributes. My thoughts: From a 'file only' perspective, Windows has no concept of execute permissions, so the first --x is set. Windows also does not know about group permissions so group write access is apparently set to the same as user permissions. I don't know why group execute permissions are not set.
I just want TC to behave the same way as does Windows Explorer. Is that possible? I use TC all of the time, but this is a major pain when talking to UNIX.
I just want TC to behave the same way as does Windows Explorer. Is that possible? I use TC all of the time, but this is a major pain when talking to UNIX.