setgid bit always unset when changing file permissions

Advertisement

berthierp
Joined:
Posts:
3

setgid bit always unset when changing file permissions

My Setup:
WinSCP 4.2.7 build 758 Running on Windows XP SP3.
SFTP session.

I am using directories with setgid bit set. I want to change the permissions of newly created directories to give write permission to the group (by default they have not). For this I right-click on the directory and change the permissions from the Properties dialog.

When I change the permissions of a directory that way, the setgid bit gets removed. In fact, there is no way to set the setgid bit, it just always gets turned off, whatever operation one does on permissions.

I have found a workaround by creating a custom command that executes chmod -R g+w "!" and applies on directories. This works fine.

Reply with quote

Advertisement

martin
Site Admin
martin avatar
Joined:
Posts:
41,518
Location:
Prague, Czechia

Re: setgid bit always unset when changing file permissions

It is possible that your SFTP server does not support the setgit bit and silently ignores the request to set it.

Reply with quote

berthierp
Joined:
Posts:
3

Re: setgid bit always unset when changing file permissions

martin wrote:

It is possible that your SFTP server does not support the setgit bit and silently ignores the request to set it.

I believe our server supports that bit very well, because we use that feature for years now (running Suse enterprise / openSuse).

Apparently does not ignore the request because the bit gets unset every time that I change any other permissions using WinSCP. If the bit was set, it gets unset, and if the bit was not set, no change. My thought was that WinSCP would force the bit to unset every time.

Reply with quote

martin
Site Admin
martin avatar
Joined:
Posts:
41,518
Location:
Prague, Czechia

Re: setgid bit always unset when changing file permissions

berthierp wrote:

I believe our server supports that bit very well, because we use that feature for years now (running Suse enterprise / openSuse).
I believe your server OS does, but your SFTP server does not.

Apparently does not ignore the request because the bit gets unset every time that I change any other permissions using WinSCP. If the bit was set, it gets unset, and if the bit was not set, no change. My thought was that WinSCP would force the bit to unset every time.
It does not.

Reply with quote

berthierp
Joined:
Posts:
3

Re: setgid bit always unset when changing file permissions

martin wrote:

berthierp wrote:

I believe our server supports that bit very well, because we use that feature for years now (running Suse enterprise / openSuse).
I believe your server OS does, but your SFTP server does not.

Yes you are right, we were using a openssh 4.6 server, which is know to have this Bug ( https://bugzilla.mindrot.org/show_bug.cgi?id=1310 ). Using another openssh version 5.2 fixes the problem (apparently it has been fixed in 5.1).

Thanks for the help!

Reply with quote

Advertisement

You can post new topics in this forum