aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael Brown <mcb30@ipxe.org>2012-08-13 22:14:57 +0100
committerMichael Brown <mcb30@ipxe.org>2012-08-13 22:14:57 +0100
commitd0bd3834633c1bb56b7cdbd7202db2925f3b5738 (patch)
treec070843b8dbc6e9af13e1605ef4e2c96df162f1f
parentd97c6a321e8c542877d5f702900929b267325851 (diff)
downloadipxe-d0bd3834633c1bb56b7cdbd7202db2925f3b5738.zip
ipxe-d0bd3834633c1bb56b7cdbd7202db2925f3b5738.tar.gz
ipxe-d0bd3834633c1bb56b7cdbd7202db2925f3b5738.tar.bz2
[comboot] Accept only ".cbt" as an extension for COMBOOT images
COMBOOT images are detected by looking for a ".com" or ".cbt" filename extension. There are widely-used files with a ".com" extension, such as "wdsnbp.com", which are PXE images rather than COMBOOT images. Avoid false detection of PXE images as COMBOOT images by accepting only a ".cbt" extension as indicating a COMBOOT image. Interestingly, this bug has been present for a long time but was frequently concealed because the filename was truncated to fit the fixed-length "name" field in struct image. (PXE binaries ending in ".com" tend to be related to Windows deployment products and so often use pathnames including backslashes, which iPXE doesn't recognise as a path separator and so treats as part of a very long filename.) Commit 1c127a6 ("[image] Simplify image management commands and internal API") made the image name a variable-length field, and so exposed this flaw in the COMBOOT image detection algorithm. Signed-off-by: Michael Brown <mcb30@ipxe.org>
-rw-r--r--src/arch/i386/image/comboot.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/arch/i386/image/comboot.c b/src/arch/i386/image/comboot.c
index 915ed2d..1ec0233 100644
--- a/src/arch/i386/image/comboot.c
+++ b/src/arch/i386/image/comboot.c
@@ -229,7 +229,7 @@ static int comboot_identify ( struct image *image ) {
++ext;
- if ( strcasecmp( ext, "com" ) && strcasecmp( ext, "cbt" ) ) {
+ if ( strcasecmp( ext, "cbt" ) ) {
DBGC ( image, "COMBOOT %p: unrecognized extension %s\n",
image, ext );
return -ENOEXEC;