]> arthur.barton.de Git - bup.git/commit
restore: create fifos with mkfifo, not mknod
authorGreg Troxel <gdt@lexort.com>
Wed, 5 Jun 2019 20:55:32 +0000 (16:55 -0400)
committerRob Browning <rlb@defaultvalue.org>
Sun, 18 Aug 2019 17:03:46 +0000 (12:03 -0500)
commit6c6b3832cdf6f9b2196c4b264e18c5c410448b5e
treeae702ed69e6a3890784c5c32b4e3b841ce0b8b92
parentfea31d9a8673bac8f7e046662b4549391e2b93e7
restore: create fifos with mkfifo, not mknod

I recently did a restore of a large bup backup, about 34G worth.  All
worked well, including metadata, except that bup threw an exception on
restoring fifos (that I didn't need; they were in /var and were sockets
in use by daemons when the backup happened).

The problem was that mknod was being called for the fifo, and given only
two argumetns.  mknod(2) on NetBSD says it takes three arguments.
mkfifo takes two.  I am guessing that mknod in python calls mknod the OS
call, and on Linux somehow the third null argument works out somehow.
But it seems irregular to make a fifo with mknod.

I realize python is not POSIX, but mknod(2) requires three arguments:
  http://pubs.opengroup.org/onlinepubs/9699919799/functions/mknod.html

It would be nice to have a test of backing up and restoring a fifo; that
would have caught this.

The following patch makes my restore go smoothly.

Signed-off-by: Greg Troxel <gdt@lexort.com>
[rlb@defaultvalue.org: adjust commit summary]
Reviewed-by: Rob Browning <rlb@defaultvalue.org>
Tested-by: Rob Browning <rlb@defaultvalue.org>
lib/bup/metadata.py