(>= 1.2.12-1) (cf. #625728).
* Move powerpc-ibm-utils and powerpc-utils dependencies from
grub-ieee1275-bin to grub-ieee1275 (closes: #693400).
+ * Merge from Ubuntu:
+ - Ignore symlink traversal failures in grub-mount readdir
+ (LP: #1051306).
-- Colin Watson <cjwatson@debian.org> Thu, 27 Sep 2012 13:25:46 +0100
--- /dev/null
+Description: Ignore symlink traversal failures in grub-mount readdir
+Author: Colin Watson <cjwatson@ubuntu.com>
+Forwarded: https://lists.gnu.org/archive/html/grub-devel/2012-10/msg00021.html
+Last-Update: 2012-10-12
+
+Index: b/util/grub-mount.c
+===================================================================
+--- a/util/grub-mount.c
++++ b/util/grub-mount.c
+@@ -292,7 +292,20 @@
+ file = grub_file_open (tmp);
+ free (tmp);
+ if (! file)
+- return translate_error ();
++ {
++ /* We cannot handle symlinks properly yet, and symlinks to
++ directories will cause us to reach here. Symlink loops or
++ dangling symlinks will also cause an error. For the
++ meantime, while treating these as zero-length files is wrong,
++ it's better than failing the whole readdir call by returning
++ translate_error ().
++
++ Ultimately, we should be able to tell from the
++ grub_dirhook_info that this is a symlink, and fill in the
++ attributes of the symlink rather than its target. */
++ grub_errno = GRUB_ERR_NONE;
++ return 0;
++ }
+ st.st_size = file->size;
+ grub_file_close (file);
+ }
tftp_endianness.patch
install_locale_langpack.patch
mkconfig_nonexistent_loopback.patch
+mount_readdir_symlink_failures.patch
file = grub_file_open (tmp);
free (tmp);
if (! file)
- return translate_error ();
+ {
+ /* We cannot handle symlinks properly yet, and symlinks to
+ directories will cause us to reach here. Symlink loops or
+ dangling symlinks will also cause an error. For the
+ meantime, while treating these as zero-length files is wrong,
+ it's better than failing the whole readdir call by returning
+ translate_error ().
+
+ Ultimately, we should be able to tell from the
+ grub_dirhook_info that this is a symlink, and fill in the
+ attributes of the symlink rather than its target. */
+ grub_errno = GRUB_ERR_NONE;
+ return 0;
+ }
st.st_size = file->size;
grub_file_close (file);
}