when using chmod sftp client command it appears that setuid / setgid bits are not handled on the server-side. that when I sftp> chmod 2775 afile I would expect afile to show: -rwxrwsr-x 1 openssh isgreat 0 2007-04-25 00:19 afile but I get: -rwxrwxr-x 1 openssh isgreat 0 2007-04-25 00:19 afile just as if I had typed: "chmod 775 afile " on server-side. As far as I understand sftp-server.c code is seems that chmod(name, a->perm & 0777); is responsible for this behavior.
Looks as the same bug as #1176
*** Bug 1176 has been marked as a duplicate of this bug. ***
I think we can make a decision one way or the other before the openssh-5.1 release, so put this bug on the tracking list.
The masking in sftp-server has been relaxed so it will be possible to explicitly set set[ug]id/sticky bits in OpenSSH 5.1. Thanks!
Mass update RESOLVED->CLOSED after release of openssh-5.1