aboutsummaryrefslogtreecommitdiffstats
Commit message (Collapse)AuthorAgeFilesLines
* ldlinux: Dynamically alloc memory for kernel and initrd filenamesMatt Fleming2013-01-041-19/+45
| | | | | | | | | | | | Absolutely no bounds checking is performed when copying filenames to 'cmdline_buf' and 'initrd_name' which means that sufficiently long strings will scribble over the stack. At best, the files will simply fail to load because the name is garbled. Allocate space for the cmdline at runtime to avoid these overflow problems. Signed-off-by: Matt Fleming <matt.fleming@intel.com>
* ldlinux: Don't delete ldlinux.c32 with 'make clean'Matt Fleming2013-01-041-4/+6
| | | | | | | | | | | | | | | | | | | | | The documented command sequence for distributions wishing to package a Syslinux release is, make clean make installer Unfortunately, becaues ldlinux.c32 is deleted by 'make clean' the installer target fails like so, make[1]: *** No rule to make target `../com32/elflink/ldlinux/ldlinux.c32', needed by `ldlinuxc32_bin.c'. Stop. make: *** [installer] Error 2 Follow the example set by core/Makefile for ldlinux.sys, etc and add any build files that are required by the installers to $(BTARGET). $(BTARGET) only gets deleted when running 'make spotless'. Reported-by: László Házy <hazy_l@yahoo.com> Signed-off-by: Matt Fleming <matt.fleming@intel.com>
* elflink: set the sonames of shared librariesH. Peter Anvin2013-01-034-4/+4
| | | | | Set the sonames of shared libraries to the filename, so we don't end up with full pathnames embedded in the files.
* Delete 16-bit COMBOOT supportsyslinux-5.00Matt Fleming2012-12-0620-2443/+23
| | | | | | | | | | | 16-bit COMBOOT files are no longer supported by Syslinux in 5.00 so delete all references and change any 32-bit COMBOOT image references to mention ELF instead. Some of the COMBOOT stuff is still used internally so we can't nuke core/comboot.inc yet, but that will disappear in a future release. Signed-off-by: Matt Fleming <matt.fleming@intel.com>
* Symbol export whitelistMatt Fleming2012-12-0544-92/+103
| | | | | | | | | | | | | | | | Before modules were dynamically loaded the boundary between GPL and non-GPL code was implicit because of the separate link domains for each module. With dynamic modules we need an explicit whitelist of core symbols that non-GPL code can link against at runtime without needing to be re-licensed under the GPL. Mark such symbols with __export, so that it is explicitly clear which symbols in the core can be linked against by non-GPL code. Reduce the visibility of symbols in both the core and ldlinux.c32 with -fvisibility=hidden. __export changes the visibility to 'default'. Signed-off-by: Matt Fleming <matt.fleming@intel.com>
* core: Fix 'NoHalt'Matt Fleming2012-12-053-5/+3
| | | | | | Use the same variable in idle.c and ldlinux.c32. Signed-off-by: Matt Fleming <matt.fleming@intel.com>
* com32: Delete unused malloc.c and friendsMatt Fleming2012-12-054-383/+0
| | | | | | | | The memory alloc files haven't been referenced since commit 880f67714ec0 ("elflink: remove the malloc.c/free.c/realloc.c/zalloc.c from com32"). They live in the core now. Signed-off-by: Matt Fleming <matt.fleming@intel.com>
* Reduce the number of global variablesMatt Fleming2012-12-0516-270/+28
| | | | | | | | | | In preparation for strictly limiting the list of variables that are exported (global) in the core, delete any unused variables, rewrite variable declarations in C that are not referenced by asm and delete files that are no longer included in other asm files. Cc: H. Peter Anvin <hpa@zytor.com> Signed-off-by: Matt Fleming <matt.fleming@intel.com>
* comboot: Mark API functions obsoleteMatt Fleming2012-12-051-349/+37
| | | | | | | | | Starting with Syslinux 5.00 the COMBOOT API is obsolete and should not be used by any modules. It is still used internally for some things, such as the ADV code in ldlinux.c32, but that will change in the future. Signed-off-by: Matt Fleming <matt.fleming@intel.com>
* doc: Further explanation for the PATH directive and lookup rulesMatt Fleming2012-12-041-1/+29
| | | | | | | | The PATH directive can be quite confusing when coupled with the fact that the current working directory is always searched first when opening files. Signed-off-by: Matt Fleming <matt.fleming@intel.com>
* Revert "menu: Inherit parent menu title"Matt Fleming2012-12-041-3/+0
| | | | | | | | | | | | This reverts commit 6387f043f7f870e4f0b402dae0b921d99eb82c39. We got reports of this change causing regressions. The reverted commit only goes half way to providing proper parent menu title inheritance, and breaks other configs where the menu label or submenu tagname are used for the title. Reported-by: Ady <ady-sf@hotmail.com> Signed-off-by: Matt Fleming <matt.fleming@intel.com>
* ldlinux: Use get_msg_file() for F-keysMatt Fleming2012-12-041-17/+2
| | | | | | | | | The file that we display with the F-keys may contain background or foreground color codes and so needs to be interpreted by get_msg_file() instead of just printing the color codes as ascii to the screen with cat_file(). Signed-off-by: Matt Fleming <matt.fleming@intel.com>
* ldlinux: Remove default bold attribute typoMatt Fleming2012-12-041-1/+1
| | | | | | | | | commit 82cbb1bd4133 ("ldlinux: Move DISPLAY file handling out of the core") introduced a typo where the foreground color was always bold when displaying a DISPLAY file. Reported-by: Ady <ady-sf@hotmail.com> Signed-off-by: Matt Fleming <matt.fleming@intel.com>
* CLI: Don't always start the CLI at column 0Matt Fleming2012-12-041-3/+9
| | | | | | | | | | | If we print files with no newline then it looks better if the CLI prompt is printed immediately after the file content, rather than erasing the line and printing prompt at column 0. This mainly affects files with one line of text and no newline character. Signed-off-by: Matt Fleming <matt.fleming@intel.com>
* ldlinux: Move DISPLAY file handling out of the coresyslinux-5.00-pre13Matt Fleming2012-12-033-340/+215
| | | | | | | | | | | | | | The code that handles the DISPLAY directive was writing directly to the BIOS VGA page with __intcall(0x10). This caused corruption problems on the screen because the ansi library code was also writing to the screen. The correct way to fix this is to always use the ansi library code (via printf()) instead of going behind its back and using separate code paths to write to the screen. Reported-by: Ady <ady-sf@hotmail.com> Signed-off-by: Matt Fleming <matt.fleming@intel.com>
* stdio: Fix unhexchar() for hex digits > 9Matt Fleming2012-12-031-3/+3
| | | | | | | | | | There was a typographical error in commit 9f51b69d7c050 ("core: Reimplement lots asm code in C") which re-wrote the asm implementation of unhexchar() in C. We should be adding 10, not subtracting to get the equivalent decimal integer. Also be explicit about the sign of 'data' and 'num'. Signed-off-by: Matt Fleming <matt.fleming@intel.com>
* Merge branch 'searchdir_leak-5' of git://git.zytor.com/users/sha0/syslinux ↵Matt Fleming2012-11-301-108/+155
|\ | | | | | | | | | | | | | | | | into elflink-searchdir-leak Pull a change that fixes a resource leak from Shao Miller, * 'searchdir_leak-5' of git://git.zytor.com/users/sha0/syslinux: fs: Fix searchdir resource leak
| * fs: Fix searchdir resource leakShao Miller2012-11-291-108/+155
| | | | | | | | | | | | | | | | | | | | This is a significant rewrite of the generic lookup logic inside core/fs/fs.c's searchdir function. Previously, there was a memory leak if a path involved multiple directories. After a sufficiently large number of invocations, this could be observed. Reported-by: Ady <ady-sf@hotmail.com> Signed-off-by: Shao Miller <sha0.miller@gmail.com>
* | PATH: Use installation directory for 'PATH'Matt Fleming2012-11-302-4/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | Files in the installation directory should be able to be executed (along with their dependencies) from any directory in the file hierarchy. Using the installation directory as the default value for 'PATH' is the most sensible way to do this. The PATH config directive still allows other directories to be appended to the 'PATH' variable, which is useful when there are other directories containing modules. Signed-off-by: Matt Fleming <matt.fleming@intel.com>
* | ldlinux: Don't try reloading ldlinux.c32 unless it's likely to succeedMatt Fleming2012-11-302-1/+13
| | | | | | | | | | | | | | | | If we can't access ldlinux.c32 with findpath(), reloading it isn't going to work so don't unload it or any of the other modules. Instead return control to the caller. Signed-off-by: Matt Fleming <matt.fleming@intel.com>
* | module: Fix incorrect list_entry() useMatt Fleming2012-11-301-1/+1
|/ | | | | | | | Correct the bogus use of list_entry() that was introduced in commit 8f1c64acf9c6 ("module: Stop silently failing to load dependency modules"). Signed-off-by: Matt Fleming <matt.fleming@intel.com>
* CLI: Delete 'temp_cmdline' and put 'cmdline' on the stackMatt Fleming2012-11-291-17/+6
| | | | | | | | | | | | We don't need to preserve the contents of 'cmdline' across calls to edit_cmdline(). In fact, doing so causes things like the TAB key to not function properly because the previous command is used as a prefix to print_labels(), as though the user had typed it explicitly before hitting TAB. Delete 'temp_cmdline' because it no longer serves a purpose. Signed-off-by: Matt Fleming <matt.fleming@intel.com>
* module: Stop silently failing to load dependency modulessyslinux-5.00-pre12Matt Fleming2012-11-291-1/+11
| | | | | | | | | | | | | We should be checking the return value of spawn_load() when loading a module's dependencies and printing some kind of an error message if they fail to load (for instance if the file is missing) and returning an error to the caller. Track the most recently loaded module in 'head' before we begin loading dependencies. That way we can unload any dependencies in the error path that were successfully loaded. Signed-off-by: Matt Fleming <matt.fleming@intel.com>
* ldlinux: Complain to user on failure to perform file operationsMatt Fleming2012-11-293-4/+4
| | | | | | | | | | | | | | | If we fail to chdir or to execute a COM32 file we should inform the user so that they can debug the problem. We don't currently print anything if the user tries to execute a regular file, such as a config file, as an COM32 image. We also shouldn't be returning the exit value of the module from spawn_load(), because we have no way of doing anything useful with it, and just because a main() function returns -1 doesn't mean it failed to run. Modules need to take care of printing any error messages themselves. Signed-off-by: Matt Fleming <matt.fleming@intel.com>
* module: Append '/' to PATH strings if missingMatt Fleming2012-11-291-0/+4
| | | | | | | | We shouldn't be appending a filename to any path string that isn't terminated by a '/', otherwise we end up searching for files like '/isolinuxpwd.c32' Signed-off-by: Matt Fleming <matt.fleming@intel.com>
* ldlinux: Only append missing filename extensionsMatt Fleming2012-11-291-3/+6
| | | | | | | | | | | | Don't append an extension like ".c32" if the command already has one! This bug lead to "config.c32" being executed as "config.c32.c32" with the below config snippet, LABEL config COM32 config.c32 /configs/isolinux.cfg Reported-by: Ady <ady-sf@hotmail.com> Signed-off-by: Matt Fleming <matt.fleming@intel.com>
* Merge branch 'coverity' into elflinksyslinux-5.00-pre11Matt Fleming2012-11-2710-25/+32
|\
| * core/elflink: Fix off-by-one errorMatt Fleming2012-11-271-2/+3
| | | | | | | | | | | | | | | | We need to remember to allocate space for the terminating NULL in create_args_and_load() otherwise we will write a NUL-byte past the bounds of 'argv[]' to some random part of the stack. Signed-off-by: Matt Fleming <matt.fleming@intel.com>
| * module: Fix off-by-one error in findpath()Matt Fleming2012-11-271-2/+2
| | | | | | | | | | | | | | | | We need to make sure that 'path' still has enough space to write the trailing NUL-byte. Without this patch it's possible to write a NUL-byte past the end of the on-stack buffer. Signed-off-by: Matt Fleming <matt.fleming@intel.com>
| * module: Fix memory leak in spawn_load()Matt Fleming2012-11-271-10/+12
| | | | | | | | | | | | | | If for some reason we fail to load a module then we need to free the memory allocated to that module. Signed-off-by: Matt Fleming <matt.fleming@intel.com>
| * pxe: Don't leak inode on timeoutMatt Fleming2012-11-271-1/+3
| | | | | | | | Signed-off-by: Matt Fleming <matt.fleming@intel.com>
| * screensize: Dereference pointers when checking cols/rowsMatt Fleming2012-11-271-1/+1
| | | | | | | | | | | | | | | | Dereference 'rows' and 'cols' to check whether the data they point to is zero, which would indicate the screen size is bogus, instead of checking if they point to NULL. Signed-off-by: Matt Fleming <matt.fleming@intel.com>
| * hdt-cli: Correct malloc() size argumentMatt Fleming2012-11-271-1/+1
| | | | | | | | | | | | | | | | We need to be allocating sizeof(char *) (4) not sizeof(char) (1) for 'new_argv'. Cc: Erwan Velu <erwanaliasr1@gmail.com> Signed-off-by: Matt Fleming <matt.fleming@intel.com>
| * chainboot: Delete extraneous free() in chainboot_file()Matt Fleming2012-11-151-3/+1
| | | | | | | | | | | | | | We don't need to call free(buf) if we're jumping to the 'bail' label because 'buf' is always free'd there. Signed-off-by: Matt Fleming <matt.fleming@intel.com>
| * vesa: Fix double close() bug in vesacon_load_background()Matt Fleming2012-11-151-1/+0
| | | | | | | | | | | | | | We always call fclose() on 'fp' if fopen() was successful, so delete the extraneous fclose() call in read_jpeg_file(). Signed-off-by: Matt Fleming <matt.fleming@intel.com>
| * asprintf: Ensure we always call va_end(ap)Matt Fleming2012-11-151-2/+3
| | | | | | | | | | | | | | | | There's currently the potential for us to exit early from asprintf() without calling va_end(ap). Rearrange things so that we always make the call. Signed-off-by: Matt Fleming <matt.fleming@intel.com>
| * bufprintf: Add va_end() for our va_copy()Matt Fleming2012-11-151-2/+6
| | | | | | | | | | | | | | | | According to the stdarg(3) man page each invocation of va_copy() should be paired with an invocation of va_end(). Cc: Erwan Velu <erwanaliasr1@gmail.com> Signed-off-by: Matt Fleming <matt.fleming@intel.com>
* | Merge branch 'xfs-for-hpa' of git://zytor.com/users/pcacjr/syslinux into ↵Matt Fleming2012-11-2723-40/+5011
|\ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | merge/elflink/xfs Pull XFS filesystem driver from Paulo Alcantara, * 'xfs-for-hpa' of git://zytor.com/users/pcacjr/syslinux: (60 commits) xfs: Fix the way we check di_mode of an inode xfs: Cleanup previous commit xfs: Add xfs_readlink() xfs: Cleanup and remove some trailing whitespaces xfs: Add XFS_DINODE_FMT_BTREE support in xfs_next_extent() xfs: Cleanup and remove some trailing whitespaces xfs: Rework xfs_dir2_get_right_blk() xfs: cleanup unused structure xfs: Remove some trailing whitespaces xfs: Add full B+tree search support in xfs_dir2_node_find_entry() xfs: Add xfs_fmt_btree_find_entry() xfs: Fix memory leak in xfs_dir2_node_find_entry() function xfs: Cleanup xfs_readdir_dir2_leaf() function xfs: Implement xfs_readdir_dir2_node() function EXTLINUX: Add sanity check for XFS filesystems xfs: Add xfs_fmt_local_readdir() function xfs: Add xfs_fmt_local_find_entry() function xfs: Move readdir functions to another source file xfs: Remove trailing whitespace in xfs_dir2_isleaf() function xfs: Move dir2 functions to another source file ... Conflicts: extlinux/main.c
| * | xfs: Fix the way we check di_mode of an inodePaulo Alcantara2012-09-022-13/+13
| | | | | | | | | | | | | | | | | | | | | The previous way to judge the di_mode of an inode could not distinguish S_IFREG and S_IFLNK. Fix it to a better judgement. Signed-off-by: Paulo Alcantara <pcacjr@zytor.com>
| * | xfs: Cleanup previous commitPaulo Alcantara2012-09-022-21/+19
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Please Baozi, fix your editor! You keep putting f*cking trailing whitespaces in almost all patches yours. This patch cleanups, fixes some typo, fixes indentation and removes some trailing whitespaces from previous commit. Signed-off-by: Paulo Alcantara <pcacjr@zytor.com>
| * | xfs: Add xfs_readlink()Chen Baozi2012-09-024-0/+63
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | XFS's symbolic links to a file can be stored in one of two formats: "local" and "extents". The length of the symlink contents is always specified by the inode's di_size value. A symlink cannot be longer than 1024 characters. Signed-off-by: Chen Baozi <baozich@gmail.com> Signed-off-by: Paulo Alcantara <pcacjr@zytor.com>
| * | xfs: Cleanup and remove some trailing whitespacesPaulo Alcantara2012-09-022-8/+9
| | | | | | | | | | | | | | | | | | | | | This patch cleanups and removes some trailing whitespaces introduced in the previous commit. Signed-off-by: Paulo Alcantara <pcacjr@zytor.com>
| * | xfs: Add XFS_DINODE_FMT_BTREE support in xfs_next_extent()Chen Baozi2012-09-023-20/+69
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | XFS's extent B+Tree is organized in the key of offset. So we cannot traverse the tree to look up the given extent number. Luckily, the tree has been already threaded. So what we have to do is just to find the first extent’s leaf, then traverse in a "linked list". Signed-off-by: Chen Baozi <baozich@gmail.com> Signed-off-by: Paulo Alcantara <pcacjr@zytor.com>
| * | xfs: Cleanup and remove some trailing whitespacesPaulo Alcantara2012-09-021-4/+8
| | | | | | | | | | | | | | | | | | | | | This patch cleanups and removes some trailing whitespaces introduced in the previous commit. Signed-off-by: Paulo Alcantara <pcacjr@zytor.com>
| * | xfs: Rework xfs_dir2_get_right_blk()Chen Baozi2012-09-024-29/+237
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | In B+tree directory, besides the node/leaf blocks, all the extents which store xfs_bmbt_rec_t entries are also organized in B+tree. We need to rework xfs_dir2_get_right_blk() to make it workable in all cases. Signed-off-by: Chen Baozi <baozich@gmail.com> Signed-off-by: Paulo Alcantara <pcacjr@zytor.com>
| * | xfs: cleanup unused structureChen Baozi2012-09-021-14/+0
| | | | | | | | | | | | | | | | | | | | | These two structures are not used anywhere right now. Signed-off-by: Chen Baozi <baozich@gmail.com> Signed-off-by: Paulo Alcantara <pcacjr@zytor.com>
| * | xfs: Remove some trailing whitespacesPaulo Alcantara2012-09-021-2/+5
| | | | | | | | | | | | | | | | | | This patch removes some trailing whitespaces from previous commit. Signed-off-by: Paulo Alcantara <pcacjr@zytor.com>
| * | xfs: Add full B+tree search support in xfs_dir2_node_find_entry()Chen Baozi2012-09-021-54/+54
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | According to the manual, the difference between B+tree directory and node directory is that the node/leaf trees can be more than one level deep in the B+tree format. That is to say we do not need to reimplemented a completely new function in B+tree case. What we've done here is to modify xfs_dir2_node_find_entry() to support searching in a B+tree more than one level. Signed-off-by: Chen Baozi <baozich@gmail.com> Signed-off-by: Paulo Alcantara <pcacjr@zytor.com>
| * | xfs: Add xfs_fmt_btree_find_entry()Chen Baozi2012-09-021-0/+9
| | | | | | | | | | | | | | | | | | | | | Add the basic framework to handle B+Tree directory. Signed-off-by: Chen Baozi <baozich@gmail.com> Signed-off-by: Paulo Alcantara <pcacjr@zytor.com>
| * | xfs: Fix memory leak in xfs_dir2_node_find_entry() functionPaulo Alcantara2012-07-292-3/+3
| | | | | | | | | | | | | | | | | | | | | | | | If xfs_dir2_node_find_entry() wasn't able to find a data block, the leaf pointer were not being freed through the label "out", so we must use the label "out1" instead. Signed-off-by: Paulo Alcantara <pcacjr@zytor.com>