2009-03-22 Yoshinori K. Okuji <okuji@enbug.org>

* kern/env.c (grub_env_context_open): Added an argument to specify
    whether a new context inherits exported variables from current
    one. This is useful when making a sandbox to interpret a config
    file.
    All callers updated.

    * include/grub/env.h (grub_env_context_open): Updated the prototype.
This commit is contained in:
okuji 2009-03-22 10:45:06 +00:00
parent b28bbc4ef5
commit 42a5b3fcc7
4 changed files with 17 additions and 6 deletions

View file

@ -75,7 +75,7 @@ grub_env_find (const char *name)
}
grub_err_t
grub_env_context_open (void)
grub_env_context_open (int export)
{
struct grub_env_context *context;
int i;
@ -95,7 +95,7 @@ grub_env_context_open (void)
for (var = context->prev->vars[i]; var; var = var->next)
{
if (var->type == GRUB_ENV_VAR_GLOBAL)
if (export && var->type == GRUB_ENV_VAR_GLOBAL)
{
if (grub_env_set (var->name, var->value) != GRUB_ERR_NONE)
{