Bug 1310 - chmod sftp command and setgid/setuid bit
Summary: chmod sftp command and setgid/setuid bit
Status: CLOSED FIXED
Alias: None
Product: Portable OpenSSH
Classification: Unclassified
Component: sftp-server (show other bugs)
Version: -current
Hardware: All Linux
: P3 normal
Assignee: Assigned to nobody
URL: http://marc.info/?t=117745570300006&r...
Keywords:
: 1176 (view as bug list)
Depends on:
Blocks: V_5_1
  Show dependency treegraph
 
Reported: 2007-04-25 15:38 AEST by Eric NOULARD
Modified: 2008-07-22 12:18 AEST (History)
3 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Eric NOULARD 2007-04-25 15:38:28 AEST
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.
Comment 1 Frederik Deweerdt 2007-04-26 18:33:08 AEST
Looks as the same bug as #1176
Comment 2 Frederik Deweerdt 2007-04-26 19:01:03 AEST
*** Bug 1176 has been marked as a duplicate of this bug. ***
Comment 3 Damien Miller 2008-06-12 18:19:37 AEST
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.
Comment 4 Damien Miller 2008-06-26 16:11:15 AEST
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!
Comment 5 Damien Miller 2008-07-22 12:18:47 AEST
Mass update RESOLVED->CLOSED after release of openssh-5.1