Topic "Directory permissions."

Author Message
Przemek

Guest


Hello,

I have a problem with directory permissions. I would like to set the rights to just created directory to "rwxrwx---" but everything what I have done, hasn't made the permissions to requested. Also when I have copied directories they haven't been set with correct permissions.

Here is what I have done:
I have set the checkbox "Set permissions" in "Upload options. I have set there also "rw-" for owner and "rw-" for group and "---" for others. I have set also "Add X to directories" checkbox. When I created the directory the permissions were "rwxr-xr-x". When I copied the directory the permissions were "rwxr-x---". That rights were set using SFTP (v3)protocol. During using SCP protocol when I copied the directory the right were set to "rwxrwx---" (correctly) but when I created the directory then the rights were "rwxr-xr-x" as with SFTP.

My question is: do I make something wrong or is that a problem with winscp (or maybe ssh server)?

Settings:
Redhat linux 9.0 with OpenSSH 3.8p1 (umask set to rwxrwx---)
WinSCP 3.6.1 build 221
Advertisements
martin
[View user's profile]
Site Admin
Joined: 2002-12-10
Posts: 25034
Location: Prague, Czechia
Przemek wrote:
When I created the directory the permissions were "rwxr-xr-x".

That do you mean by "When I created the directory"? If you mean "Create directory" command, note that it is not affected by the "Upload" options.

I'll also check WinSCP for the problem with the upload.

Note that as a temporary woraround you may set your preferred permissions with "Properties" command after upload.
_________________
Martin Prikryl
Przemek

Guest


Thank you for quick answer. My comments below the quotes.

prikryl wrote:
Przemek wrote:
When I created the directory the permissions were "rwxr-xr-x".

That do you mean by "When I created the directory"? If you mean "Create directory" command, note that it is not affected by the "Upload" options.

I ment if I pressed F7 and then input the directory name and pressed "ok".
I found also one more problem. If I set upload preferences to e.g. "rw-rw----" and in the window that appears after pressing F5 I uncheck "Set permission" check box then the rights are set regardless the state of the "Set permission" check box to "rw-rw----".

prikryl wrote:

I'll also check WinSCP for the problem with the upload.

Note that as a temporary woraround you may set your preferred permissions with "Properties" command after upload.

For me it is ok but there are people that will not take care or forget about that (standard users that always say there is problem with the server) and the problem is that some other people will not have correct access to files and directories.
martin
[View user's profile]
Site Admin
Joined: 2002-12-10
Posts: 25034
Location: Prague, Czechia
Przemek wrote:
I ment if I pressed F7 and then input the directory name and pressed "ok".

Option to specify initial permissions for new directory is on the wishlist. Currently the server assigns some default permissions.
Quote:
I found also one more problem. If I set upload preferences to e.g. "rw-rw----" and in the window that appears after pressing F5 I uncheck "Set permission" check box then the rights are set regardless the state of the "Set permission" check box to "rw-rw----".

If you uncheck "set permissions", the server assigns default permissions to new files (the same case as with new directories). If you specify other permissions like "rw-rw-rw-" and uncheck "set permissions" on upload confirmation window, the right should be again rw-rw----, as it is probably the default permissions for your server. If that's not true, let me know.

Back to the directory upload problem: When client creates new file/directory with SFTP protocol, it may specify its initial permissions. I have already found that OpenSSH SFTP server does not reflect permissions of new uploaded files specified this way, so I have changed it to set permissions explicitly after the file is completely uploaded and closed. So far I have not noticed that the same problem applies to new-directories as well. I have implemented the workaround already in the same manner as with files. Thanks. If you want I may provide you "fixed" version (contact me on my email address).
_________________
Martin Prikryl
Advertisements

You can post new topics in this forum






Search Site

What is WinSCP?

It is award-winning SFTP client, SCP client, FTPS client and FTP client integrated into one software program for file transfer to FTP server or secure SFTP server. [More]

And it's free!

Donate

About donations

$9   $19   $49   $99

About donations

Recommend

WinSCP Privacy Policy

WinSCP License