[syslinux:elflink] ldlinux: Parse ALLOWOPTIONS directive

syslinux-bot for Matt Fleming matt.fleming at intel.com
Fri May 4 12:15:06 PDT 2012


Commit-ID:  51bb012b6da85fc4c473b997c4516d29a20a7756
Gitweb:     http://www.syslinux.org/commit/51bb012b6da85fc4c473b997c4516d29a20a7756
Author:     Matt Fleming <matt.fleming at intel.com>
AuthorDate: Thu, 3 May 2012 13:54:14 +0100
Committer:  Matt Fleming <matt.fleming at intel.com>
CommitDate: Thu, 3 May 2012 14:52:17 +0100

ldlinux: Parse ALLOWOPTIONS directive

Specifying the ALLOWOPTIONS directive doesn't have any effect at the
moment. Fix this so that if ALLOWOPTIONS 0 is used then command line
arguments are ignored.

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

---
 com32/elflink/ldlinux/ldlinux.c    |    6 ++++++
 com32/elflink/ldlinux/readconfig.c |    2 +-
 2 files changed, 7 insertions(+), 1 deletions(-)

diff --git a/com32/elflink/ldlinux/ldlinux.c b/com32/elflink/ldlinux/ldlinux.c
index c9ec9ac..f11a65c 100644
--- a/com32/elflink/ldlinux/ldlinux.c
+++ b/com32/elflink/ldlinux/ldlinux.c
@@ -164,6 +164,12 @@ static void load_kernel(const char *command_line)
 	if (!allowimplicit)
 		goto bad_implicit;
 
+	/* Insert a null character to ignore any user-specified options */
+	if (!allowoptions) {
+		char *p = (char *)find_command(kernel);
+		*p = '\0';
+	}
+
 	type = parse_kernel_type(kernel);
 	if (type == KT_KERNEL) {
 		const char *ext;
diff --git a/com32/elflink/ldlinux/readconfig.c b/com32/elflink/ldlinux/readconfig.c
index 885c81a..1a8434c 100644
--- a/com32/elflink/ldlinux/readconfig.c
+++ b/com32/elflink/ldlinux/readconfig.c
@@ -1090,7 +1090,7 @@ do_include:
 	    ontimeout = refstrdup(skipspace(p + 9));
 	    ontimeoutlen = strlen(ontimeout);
 	} else if (looking_at(p, "allowoptions")) {
-	    m->allowedit = !!atoi(skipspace(p + 12));
+	    allowoptions = !!atoi(skipspace(p + 12));
 	} else if (looking_at(p, "ipappend")) {
 	    if (ld.label)
 		ld.ipappend = atoi(skipspace(p + 8));


More information about the Syslinux-commits mailing list