This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author Michael.Felt
Recipients Arfrever, Jim.Jewett, Michael.Felt, benjamin.peterson, christian.heimes, georg.brandl, giampaolo.rodola, hynek, larry, milko.krachounov, neologix, pitrou, serhiy.storchaka, tarek, terry.reedy
Date 2018-08-15.11:01:09
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1534330869.85.0.56676864532.issue17180@psf.upfronthosting.co.za>
In-reply-to
Content
I am looking at this.

Based on the comments from a historical perspective - copyfile() needs to be calling the copy_mode function before any copying actually occurs.

As the dest is already open for writing it does not matter (on posix)
what mode it has later on.

Question: in copystat() there is a block that talks about chown() in the comments but in the code it only seems to be accessing chmod(). Should there (also) be a call to chown "if _SUPER"?

_SUPER = _POSIX and os.geteuid() == 0

basically - mode becomes:

    # remove setuid, setgid and sticky bits if _POSIX and not _SUPER
    mode = stat.S_IMODE(st.st_mode) & _REMOVE_HARMFUL_MASK if _POSIX and not _SUPER else stat.S_IMODE(st.st_mode)

Comments?
History
Date User Action Args
2018-08-15 11:01:10Michael.Feltsetrecipients: + Michael.Felt, georg.brandl, terry.reedy, pitrou, larry, giampaolo.rodola, christian.heimes, benjamin.peterson, tarek, Arfrever, milko.krachounov, neologix, hynek, Jim.Jewett, serhiy.storchaka
2018-08-15 11:01:09Michael.Feltsetmessageid: <1534330869.85.0.56676864532.issue17180@psf.upfronthosting.co.za>
2018-08-15 11:01:09Michael.Feltlinkissue17180 messages
2018-08-15 11:01:09Michael.Feltcreate