Package: mount
Version: 2.13.1-2
Severity: minor
Tags: patch
In swapon man page, you can read the following statement :
"-e When -a is used with swapon, -e makes swapon silently skip devices that
do not exist."
But in fact, if swapon encounters a non existant device, it outputs a little
error message :
-8<--
$ sudo bash -c 'echo "/dev/foo none swap sw 0 0" >> /etc/fstab'
$ sudo swapon -a -e
swapon: cannot canonicalize /dev/foo: No such file or directory
-8<--
It can be fixed with the following patch :
-8<--
~/src/debian/util-linux-2.13.1$ diff -PruN mount/swapon.c.orig mount/swapon.c
--- mount/swapon.c.orig 2008-03-10 22:36:04.000000000 +0100
+++ mount/swapon.c 2008-03-10 22:37:16.000000000 +0100
@@ -125,8 +125,11 @@
char canonical[PATH_MAX + 2];
if (!myrealpath(fname, canonical, PATH_MAX + 1)) {
- fprintf(stderr, _("%s: cannot canonicalize %s: %s\n"),
- progname, fname, strerror(errno));
+ /* stays quiet if told to be so */
+ if (!ifexists) {
+ fprintf(stderr, _("%s: cannot canonicalize %s: %s\n"),
+ progname, fname, strerror(errno));
+ }
strncpy(canonical, fname, PATH_MAX + 1);
*(canonical + (PATH_MAX + 1)) = '\0';
}
-8<--
-- System Information:
Debian Release: lenny/sid
APT prefers unstable
APT policy: (500, 'unstable')
Architecture: amd64 (x86_64)
Kernel: Linux 2.6.24-1-amd64 (SMP w/2 CPU cores)
Locale: LANG=en_US.UTF-8, LC_CTYPE=en_US.UTF-8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/bash
Versions of packages mount depends on:
ii libblkid1 1.40.7-1 block device id library
ii libc6 2.7-9 GNU C Library: Shared libraries
ii libselinux1 2.0.35-1 SELinux shared libraries
ii libuuid1 1.40.7-1 universally unique id library
mount recommends no packages.
--
Arthur Petitpierre <[EMAIL PROTECTED]>
--
To UNSUBSCRIBE, email to [EMAIL PROTECTED]
with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]