mirror of
https://github.com/ansible-collections/community.general.git
synced 2024-09-14 20:13:21 +02:00
add os.fsync() so that the shredding data (hopefully) hits the drive
This commit is contained in:
parent
946b82bef7
commit
7193d27acc
1 changed files with 2 additions and 1 deletions
|
@ -235,9 +235,10 @@ class VaultEditor:
|
|||
passes = 3
|
||||
with open(tmp_path, "w") as fh:
|
||||
for _ in range(int(passes)):
|
||||
fh.seek(0, 0)
|
||||
data = generate_data(ld)
|
||||
fh.write(data)
|
||||
fh.seek(0, 0)
|
||||
os.fsync(fh)
|
||||
os.remove(tmp_path)
|
||||
|
||||
def _edit_file_helper(self, filename, existing_data=None, force_save=False):
|
||||
|
|
Loading…
Reference in a new issue