aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChristian Ruppert <idl0r@gentoo.org>2011-09-08 19:20:20 +0200
committerChristian Ruppert <idl0r@gentoo.org>2011-09-08 19:20:20 +0200
commite2f1464f47588792494686ccb195fe6207ce416f (patch)
tree53ccaeff3c0bcae71134ab0d5faaae5898916a4b
parent5df9dc1af534e85236ee72fe24bb31f73aeeb265 (diff)
Use the real/actual path when looking for mounts
/proc/mounts contains real/actual paths so we should do the same in mountinfo.
-rw-r--r--src/rc/mountinfo.c6
1 files changed, 5 insertions, 1 deletions
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);