Received: from mailman by lists.gnu.org with archive (Exim 4.43) id 1GNvxV-0006ab-Ak for mharc-grub-devel@gnu.org; Thu, 14 Sep 2006 14:29:09 -0400 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1GNvxS-0006X0-VT for grub-devel@gnu.org; Thu, 14 Sep 2006 14:29:07 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1GNvxS-0006We-Ey for grub-devel@gnu.org; Thu, 14 Sep 2006 14:29:06 -0400 Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1GNvxS-0006Wb-6y for grub-devel@gnu.org; Thu, 14 Sep 2006 14:29:06 -0400 Received: from [69.60.117.155] (helo=aybabtu.com) by monty-python.gnu.org with esmtps (TLS-1.0:RSA_AES_256_CBC_SHA:32) (Exim 4.52) id 1GNvzS-00031q-1V for grub-devel@gnu.org; Thu, 14 Sep 2006 14:31:10 -0400 Received: from 138.red-62-57-141.user.auna.net ([62.57.141.138] helo=khazad.dyndns.org) by aybabtu.com with esmtps (TLS-1.0:RSA_AES_256_CBC_SHA:32) (Exim 4.63) (envelope-from ) id 1GNvxH-0006Ri-NM for grub-devel@gnu.org; Thu, 14 Sep 2006 20:28:56 +0200 Received: from rmh by khazad.dyndns.org with local (Exim 4.63) (envelope-from ) id 1GNvyp-0005Mm-D1 for grub-devel@gnu.org; Thu, 14 Sep 2006 20:30:31 +0200 Date: Thu, 14 Sep 2006 20:30:31 +0200 From: Robert Millan To: grub-devel@gnu.org Message-ID: <20060914183031.GA20618@khazad.dyndns.org> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="XsQoSWH+UP9D9v3l" Content-Disposition: inline Organization: free as in freedom X-Message-Flag: Microsoft discourages use of Outlook. User-Agent: Mutt/1.5.13 (2006-08-11) Subject: [PATCH] avoid recursing into dotdirs X-BeenThere: grub-devel@gnu.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: The development of GRUB 2 List-Id: The development of GRUB 2 List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 14 Sep 2006 18:29:07 -0000 --XsQoSWH+UP9D9v3l Content-Type: text/plain; charset=us-ascii Content-Disposition: inline grub-probefs used to recurse into /dev/.static, then come up with /dev/.static/dev/hda as my root disk, which later fails to pass the pathname-based checks that expect things like /dev/[hsf]d[0-9]. 2006-09-14 Robert Millan * util/i386/pc/getroot.c: Don't recurse into dotdirs (e.g. ".static"). -- Robert Millan My spam trap is honeypot@aybabtu.com. Note: this address is only intended for spam harvesters. Writing to it will get you added to my black list. --XsQoSWH+UP9D9v3l Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename="03_avoid_recursing_into_dot_static.diff" 2006-09-14 Robert Millan * util/i386/pc/getroot.c: Don't recurse into dotdirs (e.g. ".static"). Index: util/i386/pc/getroot.c =================================================================== RCS file: /sources/grub/grub2/util/i386/pc/getroot.c,v retrieving revision 1.4 diff -u -r1.4 getroot.c --- util/i386/pc/getroot.c 4 Apr 2004 13:46:03 -0000 1.4 +++ util/i386/pc/getroot.c 14 Sep 2006 17:36:24 -0000 @@ -160,9 +160,11 @@ /* Don't follow symbolic links. */ continue; - if (S_ISDIR (st.st_mode)) + if (S_ISDIR (st.st_mode) && ent->d_name[0] != '.') { - /* Find it recursively. */ + /* Find it recursively, but avoid dotdirs (like ".static") since they + could contain duplicates, which would later break the pathname-based + check */ char *res; res = find_root_device (ent->d_name, dev); --XsQoSWH+UP9D9v3l--