Topic "hidden dirs treated as files using recursive permissions"

Author Message
Brianswilson

Guest


WinSCP appears to be treating hidden directories as if they were files when the recursive option is used. When I Right Click, and select "Properties" to recursively set .ssh directory and file permissions to 0700 and 0600 respectively (.ssh directory initial permissions are 0755), the action fails and the .ssh directory is left with 0600 permissions.

I can select the directory individually (without selecting "Set group, owner and permissions recursively" option and change the directory permissions without an error. If I specify 0600 permissions and choose the "Add X to directories" option for the .ssh directory, without the "Set group, owner and permissions recursively" option, there is no error. Only when the recursive option is selected is there a permissions error.

I could not find a similar known issue so I’m reporting this here as a bug. The following screen shots show the action and its results.

Results error message:

Command 'chgrp -R "bwilson" ".ssh"' failed with return code 1 and error message
chgrp: cannot access `.ssh/.PUBLIC KEYS': Permission denied
chgrp: changing group of `.ssh/authorized_keys': Permission denied
chgrp: changing group of `.ssh/authorized_keys.bak': Permission denied
chgrp: cannot access `.ssh/.DO NOT REMOVE': Permission denied.


The .ssh directory is left with 0600 permissions when I click on the abort button.
WinSCP.doc (41 KB) [Download]

Description: Screen shots included.

Advertisements
Guest




WinSCP Version 5.5.4 (Build 4433) on Windows 7 Pro connected to a RedHat Linux system.
Brianswilson

Guest


WinSCP Version 5.5.4 (Build 4433) on Windows 7 Pro connected to a RedHat Linux system. New WinSCP installation. SCP protocol using GUI. See attached debug 2 session log.
WinSCP.log (11.84 KB) [Download]

Description: Debug level 2 log file of the error message.

martin
[View user's profile]
Site Admin
Joined: 2002-12-10
Posts: 25015
Location: Prague, Czechia
I assume that you are using Add X to directories option, right? With SCP protocol it does not work recursively (With other protocols it is).
See https://winscp.net/eng/docs/ui_permissions#other_options
_________________
Martin Prikryl
Brianswilson
[View user's profile]

Joined: 2014-08-20
Posts: 2
Location: Atlanta, GA
Thank you for the information. The documentation says the option should be grayed out for the SCP protocol; but when I use SCP, it remains active. Perhaps this needs to be looked at in the latest release?

Also the option leaves the .ssh directory with 0600 permissions, not the 0700 permissions that should be set for the selected directory (with the "Add X" option). Even if SCP won't operate recursively, it should work on the selected directory and leave it with 0700 permissions.
martin
[View user's profile]
Site Admin
Joined: 2002-12-10
Posts: 25015
Location: Prague, Czechia
Brianswilson wrote:
Thank you for the information. The documentation says the option should be grayed out for the SCP protocol; but when I use SCP, it remains active. Perhaps this needs to be looked at in the latest release?

Where does the documentation says that?

Quote:
Also the option leaves the .ssh directory with 0600 permissions, not the 0700 permissions that should be set for the selected directory (with the "Add X" option). Even if SCP won't operate recursively, it should work on the selected directory and leave it with 0700 permissions.

That's right. Can you please attach a screenshot of properties dialog before you submit it along with matching session log file?
_________________
Martin Prikryl
Brianswilson
[View user's profile]

Joined: 2014-08-20
Posts: 2
Location: Atlanta, GA
The log and screen shots were attached to earlier messages. I think that should be what you were asking for.

The documentation says (https://winscp.net/eng/docs/ui_permissions#other_options):
On [the] Properties dialog[,] the option is available only when there is at least one directory selected. Also it will not work for SCP protocol for sub-directories of [the] selected directories.

The checkbox is disabled, if you check “execute” permissions explicitly for all permission groups, as it makes it effectively useless.
[missing grammar supplied] Bold face is my choice for emphasis.

The "execute" check box was not disabled when I selected the "SCP" protocol option (perhaps I'm misreading meaning of this paragraph). This is minor, though annoying, and the documentation explains what is going on as far as the recursive changes to sub-directories and files under the .ssh directory.

The issue of the .ssh directory itself being left with 600 permissions when 700 was selected for directories is something I feel is an error, even if the SCP protocol is selected. It is not a high severity issue since there is an easy work around. I wouldn't make this a high priority issue either.
martin
[View user's profile]
Site Admin
Joined: 2002-12-10
Posts: 25015
Location: Prague, Czechia
Brianswilson wrote:
The log and screen shots were attached to earlier messages. I think that should be what you were asking for.

OK, sorry. I did not read your Word document carefully. With SCP protocol, when you check both "recursively" and "Add X to directories", WinSCP does two separate operations. First it recursively sets the selected permissions and then it adds X non-recursively. As the first operation failed and you hit Abort, the second operation was never done. Had you pressed Skip, it would continue.

Quote:
The documentation says (https://winscp.net/eng/docs/ui_permissions#other_options):
On [the] Properties dialog[,] the option is available only when there is at least one directory selected. Also it will not work for SCP protocol for sub-directories of [the] selected directories.

The checkbox is disabled, if you check “execute” permissions explicitly for all permission groups, as it makes it effectively useless.
[missing grammar supplied] Bold face is my choice for emphasis.

Correct. It says, "checkbox is disabled, if you check “execute” permissions explicitly for all permission groups". You did not check any "X" checkbox. So the Add X to directories was not disabled. Maybe it's not phrased clearly. Feel free to fix it.

Thanks for your grammar corrections, I have edited the page accordingly. Feel free to fix any grammar on the wiki.
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