From: Robert Millan Date: Mon, 9 Nov 2009 21:33:15 +0000 (+0000) Subject: Save & restore grub_fs_autoload_hook while we're in read_fs_list() X-Git-Tag: 1.98~211^2~1 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=47972a242007a3739afdda393adc88d0b6db5265;p=thirdparty%2Fgrub.git Save & restore grub_fs_autoload_hook while we're in read_fs_list() --- diff --git a/normal/autofs.c b/normal/autofs.c index cf552052a..d1ef761fb 100644 --- a/normal/autofs.c +++ b/normal/autofs.c @@ -61,8 +61,15 @@ read_fs_list (void) if (filename) { grub_file_t file; + grub_fs_autoload_hook_t tmp_autoload_hook; grub_sprintf (filename, "%s/fs.lst", prefix); + + /* This rules out the possibility that read_fs_list() is invoked + recursively when we call grub_file_open() below. */ + tmp_autoload_hook = grub_fs_autoload_hook; + grub_fs_autoload_hook = NULL; + file = grub_file_open (filename); if (file) { @@ -116,6 +123,7 @@ read_fs_list (void) } grub_file_close (file); + grub_fs_autoload_hook = tmp_autoload_hook; } grub_free (filename);