bareos: bareos-13.2 42fd0764

Author Committer Branch Timestamp Parent
Marco van Wieringen Marco van Wieringen bareos-13.2 2013-06-20 21:54 bareos-13.2 a5b918a8 Pending
Changeset 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
blocks.

Fixes 0000192: Restore of PKI encrypted data fails if some of the files
            should not be replaced
mod - src/filed/restore.c Diff File