[MERGE] sftp transport: do not chmod a dir when unecessary (fix suid and sgid problems).
Harald Meland
harald.meland at usit.uio.no
Wed Jul 9 10:10:42 BST 2008
[John Arbash Meinel]
> I would probably just do:
>
> if stat.st_mode & 07000:
... or even '& 06000', as the "sticky" bit is neither suid nor sgid.
> warning('The server has a suid or sgid bit set on %s.'
> ' If you want to preserve it, use umask ...')
If I've understood the sftp behaviour correctly, these bits will be
cleared by the chmod() done immediately below this warning. Maybe the
warning message ought to more clearly indicate that fact:
warning('About to chmod %s over sftp, which will result in its'
' suid or sgid bits being cleared. If you want to'
' preserve those bits, change your environment on the'
' server to use umask ...')
--
Harald
More information about the bazaar
mailing list