A restore issue creates a tar file that can damage the system
Fabio Muzzi <liste <at> kurgan.org>
2014-06-19 22:32:54 GMT
I have experienced an issue while restoring a directory with backuppc
version 3.1.0 from Debian. I know that it's an old version, but I have
not been able to find anything about this issue, so I suppose it exists
also in newer versions.
I have a server that does a local backup (and restore) using tar.
I was trying to restore a local directory using a restore in place on
the system itself.
I went to the web interface, browsed the backups, found that the
directory I wanted to restore seemed to exist in the latest backup (it
does not, in fact, but more on this later) and so selected the checkbox
for it, and went on to restore it.
I don' know why, but the directory did NOT exist in that backup, but
only in the previous one. I still don't understand how can it be that
the web interface shows it also in the latest backup, but this is not
the real issue.
The real issue is that the backuppc_tarCreate command issued from the
web interface, not finding the directory I wanted to restore, generated
a tar file that contains something very wrong, while it sould have
simply failed with an error.
Here is the log of the failed restore:
Running: /usr/bin/env LC_ALL=C /usr/bin/sudo /bin/tar -x -p
--numeric-owner --same-owner -v -f - -C /
Running: /usr/share/backuppc/bin/BackupPC_tarCreate -h localhost -n 1391
-s / -t -r /var/vmail/geldue.it/valentina.tomba -p
Xfer PIDs are now 7844,7845
tarCreate: Done: 0 files, 0 bytes, 1 dirs, 0 specials, 0 errors
And here is the content of the generated tar file, that got restored by
tar (I have run the same command by hand and redirected its output to a
test file to get this output).
$ tar tvf test.tar
drwx------ mail/mail 0 2014-06-12 16:43 ./
As you can see, instead of the expected directory (and files), owned in
fact by mail.mail, all I got was "./" owned by mail.mail and with mode 0700.
Restoring that tar on the system made the root directory owned by
mail.mail and with 0700 permission, which is WAY TOO WRONG.
I lost one hour trying to understand what happened to the server, and
another one trying to reproduce the error, which I did.
Here we've got 2 issues: the first is an error in some index that shows
a directory in backup 1391, while that directory is in fact in backup
1390 only. The second is that by restoring such directory from backup
1391 generates that damaging tar file, instead of an error and no output
file as it should. (restoring from 1390 generates a proper tar file).
I believe that BackupPC_tarCreate should absolutely be failsafe, and
should NOT generate a tar file when it cannot find the data that I ask
it to extract, instead of generating such a wrong tar file.
Sistemi Linux - Sicurezza informatica - Sistemi VoIP
HPCC Systems Open Source Big Data Platform from LexisNexis Risk Solutions
Find What Matters Most in Your Big Data with HPCC Systems
Open Source. Fast. Scalable. Simple. Ideal for Dirty Data.
Leverages Graph Analysis for Fast Processing & Easy Data Exploration
BackupPC-users mailing list
BackupPC-users <at> lists.sourceforge.net