Remove intermediate files on en/decryption failure
This commit is contained in:
parent
899280efdf
commit
5d5b680405
3
buku
3
buku
@ -234,6 +234,7 @@ class BukuCrypt:
|
||||
print('File encrypted')
|
||||
sys.exit(0)
|
||||
except Exception as e:
|
||||
os.remove(encfile)
|
||||
LOGERR(e)
|
||||
sys.exit(1)
|
||||
|
||||
@ -329,9 +330,11 @@ class BukuCrypt:
|
||||
os.remove(encfile)
|
||||
print('File decrypted')
|
||||
except struct.error:
|
||||
os.remove(dbfile)
|
||||
LOGERR('Tainted file')
|
||||
sys.exit(1)
|
||||
except Exception as e:
|
||||
os.remove(dbfile)
|
||||
LOGERR(e)
|
||||
sys.exit(1)
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user