1 |
commit: e2f1464f47588792494686ccb195fe6207ce416f |
2 |
Author: Christian Ruppert <idl0r <AT> gentoo <DOT> org> |
3 |
AuthorDate: Thu Sep 8 17:20:20 2011 +0000 |
4 |
Commit: Christian Ruppert <idl0r <AT> gentoo <DOT> org> |
5 |
CommitDate: Thu Sep 8 17:20:20 2011 +0000 |
6 |
URL: http://git.overlays.gentoo.org/gitweb/?p=proj/openrc.git;a=commit;h=e2f1464f |
7 |
|
8 |
Use the real/actual path when looking for mounts |
9 |
|
10 |
/proc/mounts contains real/actual paths so we should do the same in mountinfo. |
11 |
|
12 |
--- |
13 |
src/rc/mountinfo.c | 6 +++++- |
14 |
1 files changed, 5 insertions(+), 1 deletions(-) |
15 |
|
16 |
diff --git a/src/rc/mountinfo.c b/src/rc/mountinfo.c |
17 |
index 91cb979..5bbee06 100644 |
18 |
--- a/src/rc/mountinfo.c |
19 |
+++ b/src/rc/mountinfo.c |
20 |
@@ -387,6 +387,7 @@ mountinfo(int argc, char **argv) |
21 |
regex_t *skip_point_regex = NULL; |
22 |
RC_STRINGLIST *nodes; |
23 |
RC_STRING *s; |
24 |
+ char real_path[PATH_MAX + 1]; |
25 |
int opt; |
26 |
int result; |
27 |
bool quiet; |
28 |
@@ -457,7 +458,10 @@ mountinfo(int argc, char **argv) |
29 |
if (argv[optind][0] != '/') |
30 |
eerrorx("%s: `%s' is not a mount point", |
31 |
argv[0], argv[optind]); |
32 |
- rc_stringlist_add(args.mounts, argv[optind++]); |
33 |
+ if (realpath(argv[optind++], real_path) == NULL) { |
34 |
+ eerrorx("%s: realpath() failed: %s", argv[0], strerror(errno)); |
35 |
+ } |
36 |
+ rc_stringlist_add(args.mounts, real_path); |
37 |
} |
38 |
nodes = find_mounts(&args); |
39 |
rc_stringlist_free(args.mounts); |