From patchwork Tue Nov 17 07:37:23 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Petr Lautrbach X-Patchwork-Id: 7633721 Return-Path: X-Original-To: patchwork-selinux@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork2.web.kernel.org (Postfix) with ESMTP id 17928BF90C for ; Tue, 17 Nov 2015 07:40:39 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 77F8120528 for ; Tue, 17 Nov 2015 07:40:38 +0000 (UTC) Received: from emvm-gh1-uea08.nsa.gov (emvm-gh1-uea08.nsa.gov [63.239.67.9]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 7B0BD2050B for ; Tue, 17 Nov 2015 07:40:37 +0000 (UTC) X-TM-IMSS-Message-ID: <3041c4840004e4ad@nsa.gov> Received: from tarius.tycho.ncsc.mil ([144.51.242.1]) by nsa.gov ([63.239.67.9]) with ESMTP (TREND IMSS SMTP Service 7.1) id 3041c4840004e4ad ; Tue, 17 Nov 2015 02:38:51 -0500 Received: from prometheus.infosec.tycho.ncsc.mil (prometheus [192.168.25.40]) by tarius.tycho.ncsc.mil (8.14.4/8.14.4) with ESMTP id tAH7bjkC028817; Tue, 17 Nov 2015 02:37:59 -0500 Received: from tarius.tycho.ncsc.mil (tarius.infosec.tycho.ncsc.mil [144.51.242.1]) by prometheus.infosec.tycho.ncsc.mil (8.15.2/8.15.2) with ESMTP id tAH7bf43014926 for ; Tue, 17 Nov 2015 02:37:41 -0500 Received: from goalie.tycho.ncsc.mil (goalie [144.51.242.250]) by tarius.tycho.ncsc.mil (8.14.4/8.14.4) with ESMTP id tAH7bf2X028815 for ; Tue, 17 Nov 2015 02:37:41 -0500 X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: A1B3AADl2EpWnBy3hNFeGQEDAQ4BAQEBg15vrzwBjQ2EDRmFd4FMTAEBAQEBARIBAQEBAQgLCQkhhWKBHjOILrtphlSGUIJWf4QSBY0biS6FHYgKgiSMQ41egi0BC1EdgUFxg0CBSgEBAQ X-IPAS-Result: A1B3AADl2EpWnBy3hNFeGQEDAQ4BAQEBg15vrzwBjQ2EDRmFd4FMTAEBAQEBARIBAQEBAQgLCQkhhWKBHjOILrtphlSGUIJWf4QSBY0biS6FHYgKgiSMQ41egi0BC1EdgUFxg0CBSgEBAQ X-IronPort-AV: E=Sophos;i="5.20,306,1444708800"; d="scan'208";a="4938658" Received: from emvm-gh1-uea08.nsa.gov ([63.239.67.9]) by goalie.tycho.ncsc.mil with ESMTP; 17 Nov 2015 02:37:31 -0500 X-TM-IMSS-Message-ID: <304083010004e4a7@nsa.gov> Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) by nsa.gov ([63.239.67.9]) with ESMTP (TREND IMSS SMTP Service 7.1; TLSv1/SSLv3 ADH-AES256-SHA (256/256)) id 304083010004e4a7 ; Tue, 17 Nov 2015 02:37:28 -0500 Received: from int-mx09.intmail.prod.int.phx2.redhat.com (int-mx09.intmail.prod.int.phx2.redhat.com [10.5.11.22]) by mx1.redhat.com (Postfix) with ESMTPS id C7F4E14CABA for ; Tue, 17 Nov 2015 07:37:28 +0000 (UTC) Received: from hulk.com (ovpn-204-22.brq.redhat.com [10.40.204.22]) by int-mx09.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id tAH7bR2L008177; Tue, 17 Nov 2015 02:37:27 -0500 From: Petr Lautrbach To: selinux@tycho.nsa.gov Subject: [PATCH] policycoreutils: Require at least one argument for 'semanage permissive -d' Date: Tue, 17 Nov 2015 08:37:23 +0100 Message-Id: <1447745843-15057-1-git-send-email-plautrba@redhat.com> X-Scanned-By: MIMEDefang 2.68 on 10.5.11.22 X-TM-AS-MML: disable X-BeenThere: selinux@tycho.nsa.gov X-Mailman-Version: 2.1.20 Precedence: list List-Id: "Security-Enhanced Linux \(SELinux\) mailing list" List-Post: List-Help: MIME-Version: 1.0 Errors-To: selinux-bounces@tycho.nsa.gov Sender: "Selinux" X-Spam-Status: No, score=-7.5 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Fixes: python ./semanage permissive -d Traceback (most recent call last): File "./semanage", line 925, in 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 --- 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)