New submission from Eryk Sun <eryk...@gmail.com>:

shutil.chown is defined in Windows even though it's only written for Unix and 
only documented as available in Unix. Defining it should be skipped on Windows.

Possibly in 3.8 shutil.chown could be implemented on Windows by calling a new 
os.set_owner function that supports user/group names and SID strings. It could 
copy how icacls.exe allows using SDDL aliases and string SIDs that begin with 
an asterisk (e.g. "*BA" and "*S-1-32-544" for BUILTIN\Administrators). If the 
string starts with an asterisk, get the SID via ConvertStringSidToSid. 
Otherwise get the SID via LookupAccountName. Then to modify the file's user and 
group, try to enable SeRestorePrivilege for the current thread and call 
Set[Named]SecurityInfo.

----------
components: IO, Library (Lib), Windows
messages: 314436
nosy: eryksun, paul.moore, steve.dower, tim.golden, zach.ware
priority: normal
severity: normal
stage: needs patch
status: open
title: shutil.chown on Windows
type: behavior
versions: Python 3.6, Python 3.7, Python 3.8

_______________________________________
Python tracker <rep...@bugs.python.org>
<https://bugs.python.org/issue33140>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to