dump cannot do incremental backups when device name is too long

From: Martin Sugioarto <martin_at_sugioarto.com>
Date: Sun, 11 Sep 2011 10:54:17 +0200
Hi all,

I've discovered a small bug in dump. When dump reads
the /etc/dumpdates, at the moment the device name in the first column is
restricted to 32 characters.

With todays GEOM implementation, it's easy to make longer device names.

My device is named: "/dev/mirror/encrypted.elig.journal". And it is
written to dumpdates as "/dev/mirror/encrypted.elig.journ". Next time
you use dump, it reads in the truncated device and internally it won't
match the current dump device. The delta won't be calculated and you
will get a level "0" dump again. Additionally, dump writes garbage in
second and third column because of wrong formatting.

It's a pretty trivial fix, because only the format for printf and
sscanf causes the error (attached).

Let me explain the two line patch.

1) The input is extended from 32 to 256 characters.
2) I removed the width formatting from printf. You will get a fixed
column and it's hard to read. I am assuming that dump works correctly
and does not modify the device name anywhere.

Since I don't like this kind of parsing generally (sscanf), you are free
to improve the implementation in these places. I wanted to fix it as
simply as possible this time.

--
Martin



Received on Sun Sep 11 2011 - 06:54:27 UTC

This archive was generated by hypermail 2.4.0 : Wed May 19 2021 - 11:40:17 UTC