policycoreutils: Require at least one argument for 'semanage permissive -d'

Fixes: python ./semanage permissive -d
Traceback (most recent call last):
  File "./semanage", line 925, in <module>
    do_parser()
  File "./semanage", line 904, in do_parser
    args.func(args)
  File "./semanage", line 708, in handlePermissive
    OBJECT.delete(args.type)
  File "/selinux.git/policycoreutils/semanage/seobject.py", line 479, in delete
    for n in name.split():
AttributeError: 'NoneType' object has no attribute 'split'

Signed-off-by: Petr Lautrbach <plautrba@redhat.com>
This commit is contained in:
Petr Lautrbach 2015-11-17 08:37:23 +01:00 committed by James Carter
parent 8922ff887f
commit 97d067376a

View File

@ -721,7 +721,7 @@ def setupPermissiveParser(subparsers):
parser_add_noheading(permissiveParser, "permissive")
parser_add_noreload(permissiveParser, "permissive")
parser_add_store(permissiveParser, "permissive")
permissiveParser.add_argument('type', nargs='?', default=None, help=_('type'))
permissiveParser.add_argument('type', nargs='+', default=None, help=_('type'))
permissiveParser.set_defaults(func=handlePermissive)