- Add "allowoptions" command
authorhpa <hpa>
Sat, 29 May 2004 22:11:23 +0000 (22:11 +0000)
committerhpa <hpa>
Sat, 29 May 2004 22:11:23 +0000 (22:11 +0000)
- Fix the handling of x0x IP addresses

NEWS
isolinux.asm
keywords
keywords.inc
ldlinux.asm
pxelinux.asm
syslinux.doc
ui.inc

diff --git a/NEWS b/NEWS
index de8f1da..279c54e 100644 (file)
--- 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
index aebc6d4..04d829c 100644 (file)
@@ -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
index 28efdbc..2287c82 100644 (file)
--- a/keywords
+++ b/keywords
@@ -13,6 +13,7 @@ prompt
 say
 serial
 timeout
+allowoptions
 ontimeout
 onerror
 f0
index 7496dab..44c64c6 100644 (file)
@@ -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<<FILENAME_MAX_LG2)
                keyword f2,        pc_fkey,     FKeyName+(1<<FILENAME_MAX_LG2)
                keyword f3,        pc_fkey,     FKeyName+(2<<FILENAME_MAX_LG2)
index 675b3e1..85bace0 100644 (file)
@@ -214,6 +214,10 @@ TextColorReg       resb 17                 ; VGA color registers for text mode
 VGAFileBuf     resb 13                 ; Unmangled VGA image name
 VGAFileBufEnd  equ $
 VGAFileMBuf    resb 11                 ; Mangled VGA image name
+                alignb 4               ; For the good of REP MOVSD
+command_line   resb max_cmd_len+2      ; Command line buffer
+default_cmd    resb max_cmd_len+1      ; "default" command line
+kern_cmd_len   equ $-command_line
 
                section .text
                 org 7C00h
@@ -1451,6 +1455,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
@@ -1463,12 +1468,8 @@ linuxauto_cmd    db 'linux auto',0
 linuxauto_len   equ $-linuxauto_cmd
 boot_image      db 'BOOT_IMAGE='
 boot_image_len  equ $-boot_image
-                align 4, db 0          ; For the good of REP MOVSD
-command_line   equ $
-default_cmd    equ $+(max_cmd_len+2)
-ldlinux_end    equ default_cmd+(max_cmd_len+1)
-kern_cmd_len    equ ldlinux_end-command_line
-ldlinux_len    equ ldlinux_end-ldlinux_magic
+ldlinux_end    equ $
+ldlinux_len    equ $-ldlinux_magic
 ;
 ; Put the getcbuf right after the code, aligned on a sector boundary
 ;
@@ -1482,6 +1483,6 @@ vgafontbuf        equ 0E000h
 ; This is a compile-time assert that we didn't run out of space
 %ifndef DEPEND
 %if (getcbuf+trackbufsize) > vgafontbuf
-%error "Out of memory, better reorganize something..."
+%error "Out of memory, better reorganize something..."
 %endif
 %endif
index ffbeed1..3b8a818 100644 (file)
@@ -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
index 571d078..e7f5898 100644 (file)
@@ -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 (file)
--- 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]