This patch fix object variable to __object in semanage. object is a keyword and also an object in Python what could cause issues. >From 58c66622a5c344597722b726df9496411d4414dc Mon Sep 17 00:00:00 2001 From: Leonidas Da Silva Barbosa <leosilva@xxxxxxxxxxxxxxxxxx> Date: Fri, 4 Oct 2013 14:04:35 -0300 Subject: [PATCH] policycoreutils: semanage: changed object var name to __object to avoid issues with Python object --- policycoreutils/semanage/semanage | 74 +++++++++++++++++++-------------------- 1 file changed, 37 insertions(+), 37 deletions(-) diff --git a/policycoreutils/semanage/semanage b/policycoreutils/semanage/semanage index 6e33c85..6260914 100644 --- a/policycoreutils/semanage/semanage +++ b/policycoreutils/semanage/semanage @@ -216,10 +216,10 @@ Object-specific Options (see above): if len(argv) == 0: return - object = argv[0] + __object = argv[0] option_dict=get_options() - if object not in option_dict.keys(): - usage(_("Invalid parameter %s not defined") % object) + if __object not in option_dict.keys(): + usage(_("Invalid parameter %s not defined") % __object) args = argv[1:] @@ -258,8 +258,8 @@ Object-specific Options (see above): usage(_("Options Error %s ") % error.msg) for o, a in gopts: - if o not in option_dict[object]: - sys.stderr.write(_("%s not valid for %s objects\n") % ( o, object) ); + if o not in option_dict[__object]: + sys.stderr.write(_("%s not valid for %s objects\n") % ( o, __object) ); return for o,a in gopts: @@ -348,40 +348,40 @@ Object-specific Options (see above): value = "off" modify = True - if object == "login": + if __object == "login": OBJECT = seobject.loginRecords(store) - if object == "user": + if __object == "user": OBJECT = seobject.seluserRecords(store) - if object == "port": + if __object == "port": OBJECT = seobject.portRecords(store) - if object == "interface": + if __object == "interface": OBJECT = seobject.interfaceRecords(store) - if object == "node": + if __object == "node": OBJECT = seobject.nodeRecords(store) - if object == "fcontext": + if __object == "fcontext": OBJECT = seobject.fcontextRecords(store) - if object == "boolean": + if __object == "boolean": OBJECT = seobject.booleanRecords(store) if use_file: modify = True - if object == "module": + if __object == "module": OBJECT = seobject.moduleRecords(store) - if object == "permissive": + if __object == "permissive": OBJECT = seobject.permissiveRecords(store) - if object == "dontaudit": + if __object == "dontaudit": OBJECT = seobject.dontauditClass(store) if list: - if object == "boolean": + if __object == "boolean": OBJECT.list(heading, locallist, use_file) else: OBJECT.list(heading, locallist) @@ -394,7 +394,7 @@ Object-specific Options (see above): if extract: for i in OBJECT.customized(): - print "%s %s" % (object, str(i)) + print "%s %s" % (__object, str(i)) return if len(cmds) != 1: @@ -402,61 +402,61 @@ Object-specific Options (see above): target = cmds[0] - if object == "dontaudit": + if __object == "dontaudit": OBJECT.toggle(target) return if add: - if object == "login": + if __object == "login": OBJECT.add(target, seuser, serange) return - if object == "user": + if __object == "user": OBJECT.add(target, roles.split(), selevel, serange, prefix) return - if object == "port": + if __object == "port": OBJECT.add(target, proto, serange, setype) return - if object == "interface": + if __object == "interface": OBJECT.add(target, serange, setype) return - if object == "module": + if __object == "module": OBJECT.add(target) return - if object == "node": + if __object == "node": OBJECT.add(target, mask, proto, serange, setype) return - if object == "fcontext": + if __object == "fcontext": if equal == "": OBJECT.add(target, setype, ftype, serange, seuser) else: OBJECT.add_equal(target, equal) return - if object == "permissive": + if __object == "permissive": OBJECT.add(target) return if modify: - if object == "boolean": + if __object == "boolean": OBJECT.modify(target, value, use_file) return - if object == "login": + if __object == "login": OBJECT.modify(target, seuser, serange) return - if object == "user": + if __object == "user": rlist = roles.split() OBJECT.modify(target, rlist, selevel, serange, prefix) return - if object == "module": + if __object == "module": if enable: OBJECT.enable(target) elif disable: @@ -465,19 +465,19 @@ Object-specific Options (see above): OBJECT.modify(target) return - if object == "port": + if __object == "port": OBJECT.modify(target, proto, serange, setype) return - if object == "interface": + if __object == "interface": OBJECT.modify(target, serange, setype) return - if object == "node": + if __object == "node": OBJECT.modify(target, mask, proto, serange, setype) return - if object == "fcontext": + if __object == "fcontext": if equal == "": OBJECT.modify(target, setype, ftype, serange, seuser) else: @@ -485,13 +485,13 @@ Object-specific Options (see above): return if delete: - if object == "port": + if __object == "port": OBJECT.delete(target, proto) - elif object == "fcontext": + elif __object == "fcontext": OBJECT.delete(target, ftype) - elif object == "node": + elif __object == "node": OBJECT.delete(target, mask, proto) else: -- 1.8.3.1 -- selinux mailing list selinux@xxxxxxxxxxxxxxxxxxxxxxx https://admin.fedoraproject.org/mailman/listinfo/selinux