summaryrefslogtreecommitdiff
path: root/trans/mtab.c
diff options
context:
space:
mode:
authorJustus Winter <4winter@informatik.uni-hamburg.de>2014-02-10 14:33:27 +0100
committerJustus Winter <4winter@informatik.uni-hamburg.de>2014-02-25 11:18:59 +0100
commit1b35145ee6592ba9e4017b7b2686edb312e79ad2 (patch)
treeee6d5d4b98d70dca8a063b5b7594a49dda0749bc /trans/mtab.c
parent8eb1240c18062bd3614ecba31f4c6a2dc6ea980d (diff)
trans/mtab: ignore translators that do not implement file_get_source
Previously, the mtab translator would guess the source of a filesystem translator from its last argument. This made all kinds of non-filesystem translators appear in /proc/mounts, causing severe problems due to umount --all removing vital passive translator records. Fix this by ignoring all translators that do not explicitly implement file_get_source. * trans/mtab.c (mtab_populate): Ignore translators that do not implement file_get_source.
Diffstat (limited to 'trans/mtab.c')
-rw-r--r--trans/mtab.c19
1 files changed, 6 insertions, 13 deletions
diff --git a/trans/mtab.c b/trans/mtab.c
index 9a2c5a6e..744c435e 100644
--- a/trans/mtab.c
+++ b/trans/mtab.c
@@ -423,19 +423,12 @@ mtab_populate (struct mtab *mtab, const char *path, int insecure)
string_t source;
err = file_get_source (node, source);
if (err)
- {
- if (err == EOPNOTSUPP)
- {
- /* Guess based on the last argument. */
- err = map_device_to_path (argv[count - 1], &src);
- if (err)
- goto errout;
- }
- else
- goto errout;
- }
- else
- src = source;
+ goto errout;
+
+ /* Guess based on the last argument. */
+ err = map_device_to_path (source, &src);
+ if (err)
+ goto errout;
entry_len = asprintf (&entry, "%s %s %s %s 0 0\n", src, path, type,
options? options: MNTOPT_DEFAULTS);