Util-Linux package development
 help / color / mirror / Atom feed
* [PATCH] libmnt: fix undefined sources
@ 2011-08-07  0:10 Davidlohr Bueso
  2011-08-08 11:54 ` Karel Zak
  0 siblings, 1 reply; 2+ messages in thread
From: Davidlohr Bueso @ 2011-08-07  0:10 UTC (permalink / raw)
  To: Karel Zak; +Cc: util-linux

From: Davidlohr Bueso <dave@gnu.org>

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@gnu.org>
---
 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




^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH] libmnt: fix undefined sources
  2011-08-07  0:10 [PATCH] libmnt: fix undefined sources Davidlohr Bueso
@ 2011-08-08 11:54 ` Karel Zak
  0 siblings, 0 replies; 2+ messages in thread
From: Karel Zak @ 2011-08-08 11:54 UTC (permalink / raw)
  To: Davidlohr Bueso; +Cc: util-linux

On Sat, Aug 06, 2011 at 08:10:26PM -0400, Davidlohr Bueso wrote:
>  libmount/src/cache.c |    2 --
>  1 files changed, 0 insertions(+), 2 deletions(-)

 Applied, thanks.

-- 
 Karel Zak  <kzak@redhat.com>
 http://karelzak.blogspot.com

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2011-08-08 11:54 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-08-07  0:10 [PATCH] libmnt: fix undefined sources Davidlohr Bueso
2011-08-08 11:54 ` Karel Zak

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox