From e2f1464f47588792494686ccb195fe6207ce416f Mon Sep 17 00:00:00 2001
From: Christian Ruppert <idl0r@gentoo.org>
Date: Thu, 8 Sep 2011 19:20:20 +0200
Subject: Use the real/actual path when looking for mounts

/proc/mounts contains real/actual paths so we should do the same in mountinfo.
---
 src/rc/mountinfo.c | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/src/rc/mountinfo.c b/src/rc/mountinfo.c
index 91cb9790..5bbee06b 100644
--- a/src/rc/mountinfo.c
+++ b/src/rc/mountinfo.c
@@ -387,6 +387,7 @@ mountinfo(int argc, char **argv)
 	regex_t *skip_point_regex = NULL;
 	RC_STRINGLIST *nodes;
 	RC_STRING *s;
+	char real_path[PATH_MAX + 1];
 	int opt;
 	int result;
 	bool quiet;
@@ -457,7 +458,10 @@ mountinfo(int argc, char **argv)
 		if (argv[optind][0] != '/')
 			eerrorx("%s: `%s' is not a mount point",
 			    argv[0], argv[optind]);
-		rc_stringlist_add(args.mounts, argv[optind++]);
+		if (realpath(argv[optind++], real_path) == NULL) {
+			eerrorx("%s: realpath() failed: %s", argv[0], strerror(errno));
+		}
+		rc_stringlist_add(args.mounts, real_path);
 	}
 	nodes = find_mounts(&args);
 	rc_stringlist_free(args.mounts);
-- 
cgit v1.2.3