mirror of
https://github.com/certbot/certbot.git
synced 2026-07-27 00:00:44 +02:00
Make sure the pluginstorage file gets truncated when writing to it (#6062)
This commit is contained in:
committed by
Brad Warren
parent
e2d6faa8a9
commit
f19ebab441
@@ -84,7 +84,8 @@ class PluginStorage(object):
|
||||
raise errors.PluginStorageError(errmsg)
|
||||
try:
|
||||
with os.fdopen(os.open(self._storagepath,
|
||||
os.O_WRONLY | os.O_CREAT, 0o600), 'w') as fh:
|
||||
os.O_WRONLY | os.O_CREAT | os.O_TRUNC,
|
||||
0o600), 'w') as fh:
|
||||
fh.write(serialized)
|
||||
except IOError as e:
|
||||
errmsg = "Could not write PluginStorage data to file {0} : {1}".format(
|
||||
|
||||
Reference in New Issue
Block a user