[syslinux:elflink] pxe: chdir to Path Prefix (DHCP Option 210) to open config

syslinux-bot for Matt Fleming matt.fleming at intel.com
Wed Feb 13 04:48:06 PST 2013

Commit-ID:  bf8ffe81f7247de7582cc23722212b7d5f795e52
Gitweb:     http://www.syslinux.org/commit/bf8ffe81f7247de7582cc23722212b7d5f795e52
Author:     Matt Fleming <matt.fleming at intel.com>
AuthorDate: Wed, 13 Feb 2013 12:34:52 +0000
Committer:  Matt Fleming <matt.fleming at intel.com>
CommitDate: Wed, 13 Feb 2013 12:34:52 +0000

pxe: chdir to Path Prefix (DHCP Option 210) to open config

This is an addition to commit 282fe9da42e ("elflink: Use
CurrentDirName for initial PATH if valid") which tried to fix the case
when booting PXELINUX with DHCP options 209 and 210. Unfortunately,
it's not useful to play games with PATH and we really do need to chdir
to the Path Prefix before opening the config file because the config
file may be specified with a path relative to the Path Prefix.

Just do the chdir() and be done with it.

Signed-off-by: Matt Fleming <matt.fleming at intel.com>

 core/fs/pxe/pxe.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/core/fs/pxe/pxe.c b/core/fs/pxe/pxe.c
index ae44cff..f96c6d0 100644
--- a/core/fs/pxe/pxe.c
+++ b/core/fs/pxe/pxe.c
@@ -1065,6 +1065,7 @@ static int pxe_open_config(struct com32_filedata *filedata)
     char *last;
     int tries = 8;
+    chdir(path_prefix);
     if (DHCPMagic & 0x02) {
         /* We got a DHCP option, try it first */
 	if (open_file(ConfigName, filedata) >= 0)

More information about the Syslinux-commits mailing list