commit-grub
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[1826] 2008-08-23 Robert Millan <address@hidden>


From: Robert Millan
Subject: [1826] 2008-08-23 Robert Millan <address@hidden>
Date: Sat, 23 Aug 2008 12:19:45 +0000

Revision: 1826
          http://svn.sv.gnu.org/viewvc/?view=rev&root=grub&revision=1826
Author:   robertmh
Date:     2008-08-23 12:19:43 +0000 (Sat, 23 Aug 2008)

Log Message:
-----------
2008-08-23  Robert Millan  <address@hidden>

        * util/getroot.c (find_root_device): Skip anything that starts with
        a dot, not just directories.  This avoids things like /dev/.tmp.md0.

Modified Paths:
--------------
    trunk/grub2/ChangeLog
    trunk/grub2/util/getroot.c

Modified: trunk/grub2/ChangeLog
===================================================================
--- trunk/grub2/ChangeLog       2008-08-22 12:58:46 UTC (rev 1825)
+++ trunk/grub2/ChangeLog       2008-08-23 12:19:43 UTC (rev 1826)
@@ -1,3 +1,8 @@
+2008-08-23  Robert Millan  <address@hidden>
+
+       * util/getroot.c (find_root_device): Skip anything that starts with
+       a dot, not just directories.  This avoids things like /dev/.tmp.md0.
+
 2008-08-22  Felix Zielcke  <address@hidden>
          
        * util/update-grub.in (GRUB_GFXMODE): Export variable.

Modified: trunk/grub2/util/getroot.c
===================================================================
--- trunk/grub2/util/getroot.c  2008-08-22 12:58:46 UTC (rev 1825)
+++ trunk/grub2/util/getroot.c  2008-08-23 12:19:43 UTC (rev 1826)
@@ -196,7 +196,10 @@
     {
       struct stat st;
       
-      if (strcmp (ent->d_name, ".") == 0 || strcmp (ent->d_name, "..") == 0)
+      /* Avoid:
+        - dotfiles (like "/dev/.tmp.md0") since they could be duplicates.
+        - dotdirs (like "/dev/.static") since they could contain duplicates.  
*/
+      if (ent->d_name[0] == '.')
        continue;
 
       if (lstat (ent->d_name, &st) < 0)
@@ -207,11 +210,9 @@
        /* Don't follow symbolic links.  */
        continue;
       
-      if (S_ISDIR (st.st_mode) && ent->d_name[0] != '.')
+      if (S_ISDIR (st.st_mode))
        {
-         /* Find it recursively, but avoid dotdirs (like ".static") since they
-            could contain duplicates, which would later break the
-            pathname-based check */
+         /* Find it recursively.  */
          char *res;
 
          res = find_root_device (ent->d_name, dev);






reply via email to

[Prev in Thread] Current Thread [Next in Thread]