From: hpa Date: Sat, 29 May 2004 22:11:23 +0000 (+0000) Subject: - Add "allowoptions" command X-Git-Tag: syslinux-3.11~427 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=975a4c3b343c09a340d95f1a2a4ece3556c57a10;p=profile%2Fivi%2Fsyslinux.git - Add "allowoptions" command - Fix the handling of x0x IP addresses --- diff --git a/NEWS b/NEWS index de8f1da..279c54e 100644 --- a/NEWS +++ b/NEWS @@ -12,6 +12,10 @@ Changes in 2.10: severe bugs in certain Award BIOSes; from Knut Petersen. * SYSLINUX: Fix for the nomtools installed, from Frederic Pasteleurs. + * PXELINUX: Fix handling of IP numbers in the ranges + 100-109 and 200-209. + * ALL: New option "allowoptions" (defaults to 1), which + controls if options are allowed on the command line or not. Changes in 2.09: * SYSLINUX: Remove residual setuid crap from diff --git a/isolinux.asm b/isolinux.asm index aebc6d4..04d829c 100644 --- a/isolinux.asm +++ b/isolinux.asm @@ -1750,6 +1750,7 @@ initrd_ptr dw 0 ; Initial ramdisk pointer/flag VKernelCtr dw 0 ; Number of registered vkernels ForcePrompt dw 0 ; Force prompt AllowImplicit dw 1 ; Allow implicit kernels +AllowOptions dw 1 ; User-specified options allowed SerialPort dw 0 ; Serial port base (or 0 for no serial port) VGAFontSize dw 16 ; Defaults to 16 byte font UserFont db 0 ; Using a user-specified font diff --git a/keywords b/keywords index 28efdbc..2287c82 100644 --- a/keywords +++ b/keywords @@ -13,6 +13,7 @@ prompt say serial timeout +allowoptions ontimeout onerror f0 diff --git a/keywords.inc b/keywords.inc index 7496dab..44c64c6 100644 --- a/keywords.inc +++ b/keywords.inc @@ -59,6 +59,7 @@ keywd_table: keyword timeout, pc_timeout keyword ontimeout, pc_ontimeout keyword onerror, pc_onerror + keyword allowoptions, pc_setint16, AllowOptions keyword f1, pc_fkey, FKeyName+(0< vgafontbuf -%error "Out of memory, better reorganize something..." +; %error "Out of memory, better reorganize something..." %endif %endif diff --git a/pxelinux.asm b/pxelinux.asm index ffbeed1..3b8a818 100644 --- a/pxelinux.asm +++ b/pxelinux.asm @@ -2034,8 +2034,11 @@ gendotquad: mov cx,4 .genchar: push eax - cmp al,100 - jb .lt100 + cmp al,10 ; < 10? + jb .lt10 ; If so, skip first 2 digits + + cmp al,100 ; < 100 + jb .lt100 ; If so, skip first digit aam 100 ; Now AH = 100-digit; AL = remainder @@ -2044,9 +2047,6 @@ gendotquad: inc di .lt100: - cmp al,10 - jb .lt10 - aam 10 ; Now AH = 10-digit; AL = remainder add ah,'0' @@ -2550,6 +2550,7 @@ initrd_ptr dw 0 ; Initial ramdisk pointer/flag VKernelCtr dw 0 ; Number of registered vkernels ForcePrompt dw 0 ; Force prompt AllowImplicit dw 1 ; Allow implicit kernels +AllowOptions dw 1 ; User-specified options allowed SerialPort dw 0 ; Serial port base (or 0 for no serial port) VGAFontSize dw 16 ; Defaults to 16 byte font UserFont db 0 ; Using a user-specified font diff --git a/syslinux.doc b/syslinux.doc index 571d078..e7f5898 100644 --- a/syslinux.doc +++ b/syslinux.doc @@ -211,6 +211,12 @@ IMPLICIT flag_val If flag_val is 0, do not load a kernel image unless it has been explicitly named in a LABEL statement. The default is 1. +ALLOWOPTIONS flag_val + If flag_val is 0, the user is not allowed to specify any + arguments on the kernel command line. The only options + recognized are those specified in an APPEND statement. The + default is 1. + TIMEOUT timeout Indicates how long to wait at the boot: prompt until booting automatically, in units of 1/10 s. The timeout is cancelled as diff --git a/ui.inc b/ui.inc index f98020c..8883381 100644 --- a/ui.inc +++ b/ui.inc @@ -215,6 +215,16 @@ clin_is_wsp: and al,al clin_opt_ptr: dec si ; Point to first nonblank mov [CmdOptPtr],si ; Save ptr to first option ; +; If "allowoptions 0", put a null character here in order to ignore any +; user-specified options. +; + mov ax,[AllowOptions] + and ax,ax + jnz clin_opt_ok + mov [si],al +clin_opt_ok: + +; ; Now check if it is a "virtual kernel" ; mov cx,[VKernelCtr]