#132 The configuration file format is fragile

v0.7.x (release)
closed-fixed
Henry N.
5
2008-09-11
2008-07-08
Adrien Beau
No

While experimenting with cofs, I made the following mistake:

# --- config start ---

# There is no need to bother creating an ISO-9660 image
# for the installation CD-ROM, we can directly point to
# the files downloaded from slackware.at thanks to cofs.
cofs0= C:\Linux\archive\slackware-12.1\www.slackware.at\data\slackware-12.1
#cofs1=D:\ #cofs2=D:\temp

# --- config end ---

The mistake is the space left after the equal sign in the cofs0 line.

coLinux parses this config file as if "cofs0=" was on a line by itself, and then independantly parses C:\Linux\... (being an unknown entity, it is passed as-is to the Linux kernel command line).

The cofs path being empty, is considered a path relative to the configuration file location, so we end up with cofs0 directly pointing to the configuration directory. (A somewhat dangerous configuration I would say, since it also often contains the filesystem images.)

Maybe the parser should be improved so that it ignores the whitespace characters right before and after the first equal sign in the configuration file lines? At least a warning should be added to colinux-daemon.txt.

Discussion

  • Adrien Beau

    Adrien Beau - 2008-07-08

    Logged In: YES
    user_id=787269
    Originator: YES

    My cofs0 line was broken in two when I posted the bug report. Like I described, in the config file, I had cofs0= and the C:\Linux path on the same line, separated by a space.

     
  • Henry N.

    Henry N. - 2008-07-09
    • assigned_to: nobody --> henryn
     
  • Henry N.

    Henry N. - 2008-07-09

    Logged In: YES
    user_id=579204
    Originator: NO

    Hello Adrien.

    many thanks for your bug reports. We will fix it next.

    Bebbo, the function GetPrivateProfileString is not usable here. The command parser should not depend on Windows platform. We have also coLinux for Linux and a (very long) plan was more platforms. But the second makes more priority: All not parsed arguments must be forward to Linux kernel command line, for example a simple "ro" or "root=/dev/...".

    Henry

     
  • Henry N.

    Henry N. - 2008-09-11

    Fixed in SVN revision 1120.

     
  • Henry N.

    Henry N. - 2008-09-11
    • labels: --> Configuration
    • status: open --> closed-fixed