bareos: bareos-12.4 ae186120
|0000192: Restore of PKI encrypted data fails if some of the files should not be replaced
|Restore of encrypted data fails when not all files are created.
We should check if a file is actually extracted when checking
if we encounter an unexpected STREAM_ENCRYPTED_SESSION_DATA.
The rctx.cs is setup by a call to crypto_session_decode()
and that session lingers until its teared down by
close_previous_stream() but that only occurs when the next
file is actually extracted. So if we extract one encrypted
file and not the one after that the rctx.cs will not be cleared
until we hit the next extracted file or the end of the restore.
So we should only handle the session at all when we extract
the file as otherwise it makes absolutely no sense to even
consider the encrypted session data stream at all as we will
be skipping the file extract anyway and skip all encrypted data
Fixes 0000192: Restore of PKI encrypted data fails if some of the files
should not be replaced
|mod - src/filed/restore.c