]> git.ipfire.org Git - thirdparty/grub.git/commitdiff
2009-03-22 Yoshinori K. Okuji <okuji@enbug.org>
authorokuji <okuji@localhost>
Sun, 22 Mar 2009 10:45:06 +0000 (10:45 +0000)
committerokuji <okuji@localhost>
Sun, 22 Mar 2009 10:45:06 +0000 (10:45 +0000)
    * 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.

ChangeLog
commands/configfile.c
include/grub/env.h
kern/env.c

index 36d851db27dbb65a30b02c2f69f7c57750bbd842..633001594e7b2a5fe7e309507e40225b50e0d749 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,13 @@
+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.
+
 2009-03-22  Yoshinori K. Okuji  <okuji@enbug.org>
 
        * kern/env.c (grub_env_context_close): Fix memory leaks.
@@ -11,7 +21,8 @@
        (read_command_list): Prevent being executed twice.
        (read_fs_list): Likewise.
 
-       * include/grub/normal.h (grub_normal_execute): 
+       * include/grub/normal.h (grub_normal_execute): Updated the
+       prototype.
 
 2009-03-22  Pavel Roskin  <proski@gno.org>
 
index 4c85d3c3f90ca75a6094e8d1ca0950220cd9b046..37d02b6b8473c25bc4ca1c29fbb072bc28c30489 100644 (file)
@@ -36,7 +36,7 @@ grub_cmd_source (grub_command_t cmd, int argc, char **args)
   if (new_env)
     {
       grub_cls ();
-      grub_env_context_open ();
+      grub_env_context_open (1);
     }
 
   grub_normal_execute (args[0], 1, ! new_env);
index 36c1e8739db04b82ec668fb49151261871f7c586..440185a59d78871665fb56c67d27e9922328fae6 100644 (file)
@@ -1,6 +1,6 @@
 /*
  *  GRUB  --  GRand Unified Bootloader
- *  Copyright (C) 2003,2005,2006,2007  Free Software Foundation, Inc.
+ *  Copyright (C) 2003,2005,2006,2007,2009  Free Software Foundation, Inc.
  *
  *  GRUB is free software: you can redistribute it and/or modify
  *  it under the terms of the GNU General Public License as published by
@@ -60,7 +60,7 @@ void EXPORT_FUNC(grub_env_iterate) (int (*func) (struct grub_env_var *var));
 grub_err_t EXPORT_FUNC(grub_register_variable_hook) (const char *name,
                                                     grub_env_read_hook_t read_hook,
                                                     grub_env_write_hook_t write_hook);
-grub_err_t EXPORT_FUNC(grub_env_context_open) (void);
+grub_err_t EXPORT_FUNC(grub_env_context_open) (int export);
 grub_err_t EXPORT_FUNC(grub_env_context_close) (void);
 grub_err_t EXPORT_FUNC(grub_env_export) (const char *name);
 
index 5c69e280b2867e1f543fa2ad794223c758ae1147..d8447b9955920937f6443972a6b8816ec02f626e 100644 (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)
                {