hidden dirs treated as files using recursive permissions

Advertisement

Brianswilson
Guest

hidden dirs treated as files using recursive permissions

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.
Description: Screen shots included.

Reply with quote

Advertisement

Brianswilson
Guest

Update.

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.
Description: Debug level 2 log file of the error message.

Reply with quote

Brianswilson
Donor
Joined:
Posts:
4
Location:
Atlanta, GA

Re: hidden dirs treated as files using recursive permissions

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.

Reply with quote

Advertisement

martin
Site Admin
martin avatar
Joined:
Posts:
40,476
Location:
Prague, Czechia

Re: hidden dirs treated as files using recursive permissions

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?

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?

Reply with quote

Brianswilson
Donor
Joined:
Posts:
4
Location:
Atlanta, GA

Re: hidden dirs treated as files using recursive permissions

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.

Reply with quote

martin
Site Admin
martin avatar
Joined:
Posts:
40,476
Location:
Prague, Czechia

Re: hidden dirs treated as files using recursive permissions

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.

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.

Reply with quote

Advertisement

You can post new topics in this forum