[PATCH] libmnt: fix undefined sources

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



From: Davidlohr Bueso <dave@xxxxxxx>

The path resolving function breaks when handling undefined sources ("none") used by pseudo-filesystems. The assertion is causing the samples/mount program
to abort:

dave@offbook:~/projects/util-linux-good/libmount/samples$ ./mount
/dev/sda3 on / type ext4 (rw,errors=remount-ro,commit=0)
proc on /proc type proc (rw,noexec,nosuid,nodev)
lt-mount: cache.c:464: mnt_resolve_path: Assertion `path' failed.
Aborted

/etc/mtab:

/dev/sda3 / ext4 rw,errors=remount-ro,commit=0 0 0
proc /proc proc rw,noexec,nosuid,nodev 0 0
none /sys sysfs rw,noexec,nosuid,nodev 0 0
fusectl /sys/fs/fuse/connections fusectl rw 0 0
none /sys/kernel/debug debugfs rw 0 0
...

Instead of this assert on NULL we can simply return NULL and let mnt_pretty_path do the work.

Signed-off-by: Davidlohr Bueso <dave@xxxxxxx>
---
 libmount/src/cache.c |    2 --
 1 files changed, 0 insertions(+), 2 deletions(-)

diff --git a/libmount/src/cache.c b/libmount/src/cache.c
index 802d072..41aa4fe 100644
--- a/libmount/src/cache.c
+++ b/libmount/src/cache.c
@@ -461,8 +461,6 @@ char *mnt_resolve_path(const char *path, struct libmnt_cache *cache)
 	char *key = NULL;
 	char *value = NULL;
 
-	assert(path);
-
 	/*DBG(CACHE, mnt_debug_h(cache, "resolving path %s", path));*/
 
 	if (!path)
-- 
1.7.4.1



--
To unsubscribe from this list: send the line "unsubscribe util-linux" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [Netdev]     [Ethernet Bridging]     [Linux Wireless]     [Kernel Newbies]     [Security]     [Linux for Hams]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux RAID]     [Linux Admin]     [Samba]

  Powered by Linux