[syslinux] Nested SYSLINUX configurations -- error using CONFIG directive

Rich Mahn rich at lat.com
Wed Mar 30 18:46:17 PDT 2011


--------
Rich Mahn <rich at lat.com> wrote:

> > >> > > >> There seems to be an error using '..' in the append portion of the
> > >> > > >> CONFIG directive.

I have identified the cause of this problem.  The pm_is_config_file
routine in newconfig.c calls mangle_name before calling chdir.  Through
mangle_name, the new directory is passed through vfat_mangle_name, which
strips off trailing '/' and '.' characters, removing the desired new
directory "..".  As a result we also see that we can specify a directory
"abc" as "abc...././.." and it will work quite well.  pwd will show it
as "abc".

I'm not sure what the correct solution to this is.  I'm not familiar
enough with fat and vfat to say whether we should be removing all
trailing '.' and '/' characters or not.  Or maybe they should be
special-cased.  Also, if we permit ".." in this location, we can get pwd
looking like "A/B/../B/../.." instead of "/".  If it weren't for
syhmbolic links in some filesystems, I would say the correct solution
would be to scan the long directory string and remove the ".." portions
along with the preceeding non-".." portions, giving a nice pwd value.
We could also remove the "." portions as well.

If I can get some guidance on this, I'll put together a patch to correct
this anomaly.

Thanks for all the help you people gave me to find this.

Rich




More information about the Syslinux mailing list