diff -up xen-3.1.0-src/tools/pygrub/src/GrubConf.py.noexec xen-3.1.0-src/tools/pygrub/src/GrubConf.py --- xen-3.1.0-src/tools/pygrub/src/GrubConf.py.noexec 2007-09-25 15:20:14.000000000 -0400 +++ xen-3.1.0-src/tools/pygrub/src/GrubConf.py 2007-09-25 15:20:25.000000000 -0400 @@ -101,7 +101,7 @@ class GrubImage(object): if self.commands.has_key(com): if self.commands[com] is not None: - exec("%s = r\"%s\"" %(self.commands[com], arg.strip())) + setattr(self, self.commands[com], arg.strip()) else: logging.info("Ignored image directive %s" %(com,)) else: @@ -142,11 +142,11 @@ class GrubImage(object): initrd = property(get_initrd, set_initrd) # set up command handlers - commands = { "title": "self.title", - "root": "self.root", - "rootnoverify": "self.root", - "kernel": "self.kernel", - "initrd": "self.initrd", + commands = { "title": "title", + "root": "root", + "rootnoverify": "root", + "kernel": "kernel", + "initrd": "initrd", "chainloader": None, "module": None} @@ -195,7 +195,7 @@ class GrubConfigFile(object): (com, arg) = grub_exact_split(l, 2) if self.commands.has_key(com): if self.commands[com] is not None: - exec("%s = r\"%s\"" %(self.commands[com], arg.strip())) + setattr(self, self.commands[com], arg.strip()) else: logging.info("Ignored directive %s" %(com,)) else: @@ -208,7 +208,7 @@ class GrubConfigFile(object): (com, arg) = grub_exact_split(line, 2) if self.commands.has_key(com): if self.commands[com] is not None: - exec("%s = r\"%s\"" %(self.commands[com], arg.strip())) + setattr(self, self.commands[com], arg.strip()) else: logging.info("Ignored directive %s" %(com,)) else: @@ -236,12 +236,12 @@ class GrubConfigFile(object): splash = property(get_splash, set_splash) # set up command handlers - commands = { "default": "self.default", - "timeout": "self.timeout", - "fallback": "self.fallback", - "hiddenmenu": "self.hiddenmenu", - "splashimage": "self.splash", - "password": "self.password" } + commands = { "default": "default", + "timeout": "timeout", + "fallback": "fallback", + "hiddenmenu": "hiddenmenu", + "splashimage": "splash", + "password": "password" } for c in ("bootp", "color", "device", "dhcp", "hide", "ifconfig", "pager", "partnew", "parttype", "rarp", "serial", "setkey", "terminal", "terminfo", "tftpserver", "unhide"): diff -up xen-3.1.0-src/tools/pygrub/src/LiloConf.py.noexec xen-3.1.0-src/tools/pygrub/src/LiloConf.py --- xen-3.1.0-src/tools/pygrub/src/LiloConf.py.noexec 2007-09-25 15:20:18.000000000 -0400 +++ xen-3.1.0-src/tools/pygrub/src/LiloConf.py 2007-09-25 15:20:23.000000000 -0400 @@ -30,7 +30,7 @@ class LiloImage(object): if self.commands.has_key(com): if self.commands[com] is not None: - exec("%s = r\'%s\'" %(self.commands[com], re.sub('^"(.+)"$', r"\1", arg.strip()))) + setattr(self, self.commands[com], re.sub('^"(.+)"$', r"\1", arg.strip())) else: logging.info("Ignored image directive %s" %(com,)) else: @@ -56,12 +56,12 @@ class LiloImage(object): initrd = property(get_initrd, set_initrd) # set up command handlers - commands = { "label": "self.title", - "root": "self.root", - "rootnoverify": "self.root", - "image": "self.kernel", - "initrd": "self.initrd", - "append": "self.args", + commands = { "label": "title", + "root": "root", + "rootnoverify": "root", + "image": "kernel", + "initrd": "initrd", + "append": "args", "read-only": None, "chainloader": None, "module": None} @@ -111,7 +111,7 @@ class LiloConfigFile(object): (com, arg) = GrubConf.grub_exact_split(l, 2) if self.commands.has_key(com): if self.commands[com] is not None: - exec("%s = r\"%s\"" %(self.commands[com], arg.strip())) + setattr(self, self.commands[com], arg.strip()) else: logging.info("Ignored directive %s" %(com,)) else: