On 14.08.2012 22:54, Harald Becker wrote: [] > My request is, to have Busybox mountpoint give at least same result as > upstream ... not more, but not less!
> ... so just see how GNU mountpoint does the check (can't do it > currently here on my absolutely overloaded notebook, hacking on this > to get away from this situation). Which GNU mountpoint utility (aka "upstream") you're talking about? On my (debian) system, /bin/mountpoint comes from sysvinit package, it is written by Miquel van Smoorenburg, and it has exactly the same problem with bind mounts. I'm interested to know which "GNU" mountpoint utility you're talking about. As for "reliability", /proc/self/mounts (or /proc/self/mountinfo which is exactly of the same nature in this context) may have complex structure describing complex structure of mounts on the sytem, when you can have nested cross-mounts - so the utility will have to build whole tree (or graph) of mounts to understand this structure. Also, again due to this same bind mounts, or (sym)links, or due to mount --move or something else, the path given to `mountpoint' utility might be not the same path recorded in /proc/mounts (or mountinfo - again, does not matter), it might be some alternative path leading to the same directory. So our great mountpoint utility will need to very carefully canonicalize the given argument first, before looking it up in mounts (or mountinfo), and there is no single way to canonicalize a given path generally. So parsing mounts (or mountinfo) is inherently unreliable, even after somehow overcoming the problem with special characters in pathnames. We should have some much more reliable interface here, and kernel does not provide it. So any utility which tries to detect such bind mounts is broken in one or another way. Thanks, /mjt _______________________________________________ busybox mailing list [email protected] http://lists.busybox.net/mailman/listinfo/busybox
