Bug 16493 - Bogus anaconda /etc/fstab LOOP parsing
Bogus anaconda /etc/fstab LOOP parsing
Status: CLOSED RAWHIDE
Product: Red Hat Raw Hide
Classification: Retired
Component: anaconda (Show other bugs)
1.0
ia64 Linux
low Severity low
: ---
: ---
Assigned To: Michael Fulbright
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2000-08-17 23:57 EDT by Need Real Name
Modified: 2008-05-01 11:37 EDT (History)
0 users

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2000-08-21 12:15:21 EDT
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)

  None (edit)
Description Need Real Name 2000-08-17 23:57:30 EDT
The line of code in instimage/usr/lib/anaconda-7.0/fstab.py
that tries to parse the "# LOOP1: /dev/%s %s /redhat.img\n"
lines appears bogus:

    if fields[0] == "#" and len(fields)>4 and fields[2:6] == "LOOP":

Shouldn't that be:

    if fields[0] == "#" and len(fields)>4 and fields[1][2:6] == "LOOP":

(as an aside - I'm curious as to what this LOOP stuff is).
Comment 1 Need Real Name 2000-08-18 00:05:19 EDT
Oops - still not right - not only was field number unchosen, but the
char offset within the field off - try:

    if fields[0] == "#" and len(fields)>4 and fields[1][0:4] == "LOOP":
Comment 2 Michael Fulbright 2000-08-18 11:05:03 EDT
fields is just a string, it is not an array of parsed whiteseparated fields.

The loop statement is referring to the loopback file install we support where
you can install Linux to a
large file within a FAT fs.
Comment 3 Need Real Name 2000-08-18 15:16:18 EDT
Thanks for explaining what the LOOP stuff was in /etc/fstab, and for
the quick response.

However, I am surprised that you state:
  "fields is just a string, it is not an array of parsed whiteseparated fields."

I see the following code in fstab.py:
	fields = string.split (line)
	...
	if fields[0] == "#" and len(fields)>4 and fields[2:6] == "LOOP":
	...
	if (fields[0][0:7] != "/dev/hd" and 

Looks to me like:
    1) fields is being set to an list of strings, and
    2) it is even being accessed as such, twice on the very
       line in question, in the terms:
	fields[0] == "#" and len(fields)>4
    3) it continues to be accessed as such every where else
	it is accessed in this routine.

Perhaps you meant "line", not "fields", as in:
    if fields[0] == "#" and len(fields)>4 and line[2:6] == "LOOP":
                                              ^^^^
Comment 4 Michael Fulbright 2000-08-21 12:15:18 EDT
My apologies, I read over the code too quickly and you are correct.  I have
verified we have your suggested fix applied against our current codebase.

Thanks!

Note You need to log in before you can comment on or make changes to this bug.