~psusi/ubuntu/saucy/grub2/fix-dmraid

« back to all changes in this revision

Viewing changes to util/grub-mount.c

  • Committer: Package Import Robot
  • Author(s): Colin Watson
  • Date: 2012-10-12 17:14:04 UTC
  • Revision ID: package-import@ubuntu.com-20121012171404-ot7x738859u6iwsb
Tags: 2.00-7ubuntu10
Ignore symlink traversal failures in grub-mount readdir (LP: #1051306).

Show diffs side-by-side

added added

removed removed

Lines of Context:
292
292
        file = grub_file_open (tmp);
293
293
        free (tmp);
294
294
        if (! file)
295
 
          return translate_error ();
 
295
          {
 
296
            /* We cannot handle symlinks properly yet, and symlinks to
 
297
               directories will cause us to reach here.  Symlink loops or
 
298
               dangling symlinks will also cause an error.  For the
 
299
               meantime, while treating these as zero-length files is wrong,
 
300
               it's better than failing the whole readdir call by returning
 
301
               translate_error ().
 
302
 
 
303
               Ultimately, we should be able to tell from the
 
304
               grub_dirhook_info that this is a symlink, and fill in the
 
305
               attributes of the symlink rather than its target.  */
 
306
            grub_errno = GRUB_ERR_NONE;
 
307
            return 0;
 
308
          }
296
309
        st.st_size = file->size;
297
310
        grub_file_close (file);
298
311
      }