Bug#642527: libquota-perl: Quota::getqcarg() fails to detect root device if /etc/mtab is symlinked to /proc/self/mounts

2011-09-23 Thread Paul Hink
Package: libquota-perl
Version: 1.6.4+dfsg-1
Severity: important


If /etc/mtab is not a normal file but a symlink to /proc/self/mounts,
Quota::getqcarg() fails to detect the correct root device. It takes the
first entry matching / which is rootfs instead of the device
containing the real root partition:

| $ ls -la /etc/mtab
| lrwxrwxrwx 1 root root 17 Sep 17 14:57 /etc/mtab - /proc/self/mounts
| $ grep ' / ' /etc/mtab
| rootfs / rootfs rw 0 0
| /dev/vda1 / xfs 
rw,relatime,attr2,nobarrier,logbufs=8,logbsize=256k,usrquota,grpquota 0 0
| $ perl -e 'use Quota; print Quota::getqcarg(/) . \n;'
| rootfs
| $

The man page explicitly recommends to use the value returned by
Quota::getqcarg() as the $dev argument for Quota::query() and/or
Quota::setqlim(). This, in turn, makes query() and setqlim() fail for
the root filesystem.

-- System Information:
Debian Release: 6.0.2
  APT prefers stable-updates
  APT policy: (500, 'stable-updates'), (500, 'stable')
Architecture: i386 (x86_64)

Kernel: Linux 2.6.32-5-amd64 (SMP w/6 CPU cores)
Locale: LANG=C, LC_CTYPE=C (charmap=ANSI_X3.4-1968)
Shell: /bin/sh linked to /bin/bash

Versions of packages libquota-perl depends on:
ii  libc6  2.11.2-10 Embedded GNU C Library: Shared lib
ii  perl   5.10.1-17squeeze2 Larry Wall's Practical Extraction 
ii  perl-base [perlapi-5.1 5.10.1-17squeeze2 minimal Perl system

libquota-perl recommends no packages.

libquota-perl suggests no packages.

-- no debconf information



-- 
To UNSUBSCRIBE, email to debian-bugs-dist-requ...@lists.debian.org
with a subject of unsubscribe. Trouble? Contact listmas...@lists.debian.org



Bug#642527: libquota-perl: Quota::getqcarg() fails to detect root device if /etc/mtab is symlinked to /proc/self/mounts

2011-09-23 Thread gregor herrmann
On Fri, 23 Sep 2011 15:16:00 +0200, Paul Hink wrote:

 If /etc/mtab is not a normal file but a symlink to /proc/self/mounts,
 Quota::getqcarg() fails to detect the correct root device. It takes the
 first entry matching / which is rootfs instead of the device
 containing the real root partition:

This seems to be fixed in 1.6.6:

Changes in 1.6.6 (June 2011)
- Ignore rootfs filesystem in Quota::getqcarg() on Linux, which always
  is a duplicate.  Thanks to abaturin for providing this patch.

Cf. http://search.cpan.org/diff?from=Quota-1.6.4to=Quota-1.6.6#Quota.pm
 
Cheers,
gregor

-- 
 .''`.   Homepage: http://info.comodo.priv.at/ - OpenPGP key ID: 0x8649AA06
 : :' :  Debian GNU/Linux user, admin,  developer - http://www.debian.org/
 `. `'   Member of VIBE!AT  SPI, fellow of Free Software Foundation Europe
   `-NP: Various Artists: Fernando Sor Variations Sur Malbrough S En Va T 
En Guerre


signature.asc
Description: Digital signature