diff mbox

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

Message ID 1447745843-15057-1-git-send-email-plautrba@redhat.com (mailing list archive)
State Accepted
Headers show

Commit Message

Petr Lautrbach Nov. 17, 2015, 7:37 a.m. UTC
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>
---
 policycoreutils/semanage/semanage | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

James Carter Nov. 19, 2015, 9:25 p.m. UTC | #1
On 11/17/2015 02:37 AM, Petr Lautrbach wrote:
> 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>

Applied.

Thanks,
Jim

> ---
>   policycoreutils/semanage/semanage | 2 +-
>   1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/policycoreutils/semanage/semanage b/policycoreutils/semanage/semanage
> index 8097208..ed48c11 100644
> --- a/policycoreutils/semanage/semanage
> +++ b/policycoreutils/semanage/semanage
> @@ -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)
>
>
>
diff mbox

Patch

diff --git a/policycoreutils/semanage/semanage b/policycoreutils/semanage/semanage
index 8097208..ed48c11 100644
--- a/policycoreutils/semanage/semanage
+++ b/policycoreutils/semanage/semanage
@@ -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)