Package: util-linux
Version: 2.27.1-6
Severity: normal
File: /sbin/sfdisk
Tags: upstream

In jessie, sfdisk would exit with 0 and print nothing when invoked
on e.g. a LV containing an ext4 filesystem. Tools like backupninja
use the output from --list to iterate over all devices and --dump
the partition table for each. For a device that has no partition
table, the result would simply be empty, but no error reported
— which I think is the correct response:

  # sfdisk -d /dev/mapper/vg-root; echo $?
  0

Unfortunately, commit 8a8d204cd112b3e18bce9c9611495f870bd3b24b (I
think) modified the behaviour of --dump:

  # sfdisk -d /dev/mapper/vg-root; echo $?
  /dev/mapper/vg-root: device contains a valid 'ext4' signature; it is strongly 
recommended to wipe the device with wipefs(8) if this is unexpected, in order 
to avoid possible collisions
  sfdisk: failed to dump partition table: Success
  1

Apart from the sillyness to append "Success" to the last line,
I also don't think the exit code is correct. There is no partition
table, so return an empty result and be done with it.

If upstream disagrees with this, then maybe a flag could be
introduced to override this behaviour, or --list could be told to
only return devices with partition tables.

Thanks,

-- System Information:
Debian Release: stretch/sid
  APT prefers unstable
  APT policy: (500, 'unstable'), (1, 'experimental')
Architecture: amd64 (x86_64)

Kernel: Linux 4.4.0-1-amd64 (SMP w/8 CPU cores)
Locale: LANG=en_NZ, LC_CTYPE=en_NZ.UTF-8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/dash
Init: systemd (via /run/systemd/system)

Versions of packages util-linux depends on:
ii  libblkid1       2.27.1-6
ii  libc6           2.22-3
ii  libfdisk1       2.27.1-6
ii  libmount1       2.27.1-6
ii  libncursesw5    6.0+20160213-1
ii  libpam0g        1.1.8-3.2
ii  libselinux1     2.4-3+b1
ii  libsmartcols1   2.27.1-6
ii  libsystemd0     229-2
ii  libtinfo5       6.0+20160213-1
ii  libudev1        229-2
ii  libuuid1        2.27.1-6
ii  sysvinit-utils  2.88dsf-59.3
ii  zlib1g          1:1.2.8.dfsg-2+b1

util-linux recommends no packages.

Versions of packages util-linux suggests:
ii  dosfstools          3.0.28-2
ii  kbd                 2.0.3-2
ii  util-linux-locales  2.27.1-6

-- debconf-show failed


-- 
 .''`.   martin f. krafft <madduck@d.o> @martinkrafft
: :'  :  proud Debian developer
`. `'`   http://people.debian.org/~madduck
  `-  Debian - when you have better things to do than fixing systems

Attachment: digital_signature_gpg.asc
Description: Digital signature (see http://martin-krafft.net/gpg/sig-policy/999bbcc4/current)

Reply via email to