mirror of
https://github.com/certbot/certbot.git
synced 2026-06-03 22:08:07 -04:00
Simplify and make more clear comment on os.open.
This commit is contained in:
parent
afc21aa8ce
commit
1cc9cc7fb4
1 changed files with 5 additions and 7 deletions
|
|
@ -31,13 +31,11 @@ std_sys.modules[__name__ + '.path'] = path
|
|||
del ourselves, std_os, std_sys
|
||||
|
||||
|
||||
# The os.open function on Windows will have the same effect than a bare os.chown towards the given
|
||||
# mode, and will create a file with the same flaws that what have been described for os.chown.
|
||||
# So upon file creation, security.take_ownership will be called to ensure current user is the owner
|
||||
# of the file, and security.chmod will do the same thing than for the modified os.chown.
|
||||
# Internally, take_ownership will update the existing metadata of the file, to set the current
|
||||
# username (determined by the win32api module) as the owner of the file.
|
||||
# The os.open function on Windows has the same effect than a call to os.chown concerning the file
|
||||
# modes: these modes lack of a correct control over the permissions given to the file. Instead,
|
||||
# filesystem.open invokes filesystem.take_ownership and filesystem.chown to ensure that both owner
|
||||
# and permissions are correctly set.
|
||||
def open(*unused_args, **unused_kwargs): # pylint: disable=function-redefined
|
||||
"""Method os.open() is forbidden"""
|
||||
raise RuntimeError('Usage of os.open() is forbidden. ' # pragma: no cover
|
||||
raise RuntimeError('Usage of os.open() is forbidden. '
|
||||
'Use certbot.compat.filesystem.open() instead.')
|
||||
|
|
|
|||
Loading…
Reference in a new issue