[PXEXT] Add PXENV_FILE_EXEC call to PXE extensions API.

This allows pxelinux to execute arbitrary gPXE commands.  This is
remarkably unsafe (not least because some of the commands will assume
full ownership of memory and do nasty things like edit the e820 map
underneath the calling pxelinux), but it does allow access to the
"sanboot" command.
This commit is contained in:
Michael Brown
2008-03-04 18:16:30 +00:00
parent b08a6f5300
commit b62f2325ba
4 changed files with 67 additions and 1 deletions

View File

@@ -96,6 +96,7 @@ union pxenv_call {
PXENV_EXIT_t ( * file_select ) ( struct s_PXENV_FILE_SELECT * );
PXENV_EXIT_t ( * file_read ) ( struct s_PXENV_FILE_READ * );
PXENV_EXIT_t ( * get_file_size ) ( struct s_PXENV_GET_FILE_SIZE * );
PXENV_EXIT_t ( * file_exec ) ( struct s_PXENV_FILE_EXEC * );
};
/**
@@ -294,6 +295,10 @@ __cdecl void pxe_api_call ( struct i386_all_regs *ix86 ) {
pxenv_call.get_file_size = pxenv_get_file_size;
param_len = sizeof ( pxenv_any.get_file_size );
break;
case PXENV_FILE_EXEC:
pxenv_call.file_exec = pxenv_file_exec;
param_len = sizeof ( pxenv_any.file_exec );
break;
default:
DBG ( "PXENV_UNKNOWN_%hx", opcode );
pxenv_call.unknown = pxenv_unknown;