1
Description: Ignore symlink traversal failures in grub-mount readdir
2
Author: Colin Watson <cjwatson@ubuntu.com>
3
Forwarded: Message-ID: <20121012160954.GH17188@riva.dynamic.greenend.org.uk>
4
Last-Update: 2012-10-12
6
Index: b/util/grub-mount.c
7
===================================================================
8
--- a/util/grub-mount.c
9
+++ b/util/grub-mount.c
11
file = grub_file_open (tmp);
14
- return translate_error ();
16
+ /* We cannot handle symlinks properly yet, and symlinks to
17
+ directories will cause us to reach here. Symlink loops or
18
+ dangling symlinks will also cause an error. For the
19
+ meantime, while treating these as zero-length files is wrong,
20
+ it's better than failing the whole readdir call by returning
23
+ Ultimately, we should be able to tell from the
24
+ grub_dirhook_info that this is a symlink, and fill in the
25
+ attributes of the symlink rather than its target. */
26
+ grub_errno = GRUB_ERR_NONE;
29
st.st_size = file->size;
30
grub_file_close (file);