From patchwork Tue Sep 27 15:51:12 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Miroslav Grepl X-Patchwork-Id: 9352133 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id B82F06077B for ; Tue, 27 Sep 2016 15:52:17 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id A992A291F2 for ; Tue, 27 Sep 2016 15:52:17 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 9E5242928A; Tue, 27 Sep 2016 15:52:17 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-4.2 required=2.0 tests=BAYES_00, RCVD_IN_DNSWL_MED autolearn=ham version=3.3.1 Received: from emsm-gh1-uea11.nsa.gov (smtp.nsa.gov [8.44.101.9]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id ED1A1291F2 for ; Tue, 27 Sep 2016 15:52:16 +0000 (UTC) X-IronPort-AV: E=Sophos;i="5.30,405,1470700800"; d="scan'208";a="19590837" IronPort-PHdr: =?us-ascii?q?9a23=3A+V5/Ch3nvyHynRVesmDT+DRfVm0co7zxezQtwd8Z?= =?us-ascii?q?segSIvad9pjvdHbS+e9qxAeQG96KsbQd1qGG7+jJYi8p2d65qncMcZhBBVcuqP?= =?us-ascii?q?49uEgeOvODElDxN/XwbiY3T4xoXV5h+GynYwAOQJ6tL2PbrnD61zMOABK3bVMz?= =?us-ascii?q?fbWvXNePxJTrn8mJuLTrKz1SgzS8Zb4gZD6Xli728vcsvI15N6wqwQHIqHYbM8?= =?us-ascii?q?5fxGdvOE7B102kvpT4wYRnuxh0l7phspcYEPayQ6NtVrFcDTI7I0gp9cbrsl/F?= =?us-ascii?q?VgLJ6XwCAUsMlR8dJgnf6wr+V4m5nTH3ru41jCyVJ8DuSZguVDii5rstQxjt3n?= =?us-ascii?q?RUfwUl+X3a35QjxJlQpwis8lkmm4M=3D?= X-IPAS-Result: =?us-ascii?q?A2H+BAD5lOpX/wHyM5BdHAEBBAEBCgEBGAEFAQsBgxQBAQE?= =?us-ascii?q?BAR6BU7p/JYdlTAEBAQEBAQEBAgECWyeCMgQDEwWCGAI3FCAOAwkCFwghCAgDA?= =?us-ascii?q?S0VHwsFGASILL5xJYY3hiKCRgIRAWiFEgWONItCj2AKiX2FbQKQaFSFCHCEKQ8?= =?us-ascii?q?XYYEnAQEB?= Received: from unknown (HELO tarius.tycho.ncsc.mil) ([144.51.242.1]) by emsm-gh1-uea11.nsa.gov with ESMTP; 27 Sep 2016 15:52:14 +0000 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 u8RFpNRq016439; Tue, 27 Sep 2016 11:51:34 -0400 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 u8RFpM4D270061 for ; Tue, 27 Sep 2016 11:51:22 -0400 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 u8RFpLrO016437 for ; Tue, 27 Sep 2016 11:51:21 -0400 X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: A1BMAQBQlOpXhxy3hNFdHAEBBAEBCgEBgz8BAQEBAYFxpTKCBQGPPoQVFIYKgWBMAQIBAQEBAQITAQEBCgsJCRmGEDCBIYhNvxaGN4YigkZ8hRIFjjSLQo9gCo9qApBogx5hgV08NIQpgi4BAQE X-IPAS-Result: A1BMAQBQlOpXhxy3hNFdHAEBBAEBCgEBgz8BAQEBAYFxpTKCBQGPPoQVFIYKgWBMAQIBAQEBAQITAQEBCgsJCRmGEDCBIYhNvxaGN4YigkZ8hRIFjjSLQo9gCo9qApBogx5hgV08NIQpgi4BAQE X-IronPort-AV: E=Sophos;i="5.30,405,1470715200"; d="scan'208";a="5731414" Received: from emsm-gh1-uea11.corp.nsa.gov (HELO emsm-gh1-uea11.nsa.gov) ([10.208.41.37]) by goalie.tycho.ncsc.mil with ESMTP; 27 Sep 2016 11:51:20 -0400 IronPort-PHdr: =?us-ascii?q?9a23=3AzMoathIv41kqGJei2tmcpTZWNBhigK39O0sv0rFi?= =?us-ascii?q?tYgUKf/xwZ3uMQTl6Ol3ixeRBMOAuqgC0red4/yocFdDyK7JiGoFfp1IWk1Nou?= =?us-ascii?q?QttCtkPvS4D1bmJuXhdS0wEZcKflZk+3amLRodQ56mNBXsq3G/pQQfBg/4fVIs?= =?us-ascii?q?YL+kQMiL0o/ni6ibwN76W01wnj2zYLd/fl2djD76kY0ou7ZkMbs70RDTo3FFKK?= =?us-ascii?q?x8zGJsIk+PzV6nvp/jtM0rzyMFoP8l9shdQY3mbq84SvpeFz1gPGcrt+PxshyW?= =?us-ascii?q?aAqV4WAYW3tevQBFGwyNuBT1RJrptgPgu+Z90TXcNsrzG+NnEQ++5rtmHUe7wB?= =?us-ascii?q?wMMCQ0pTna?= X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: =?us-ascii?q?A0GVAQD5lOpXhxy3hNFdHAEBBAEBCgEBG?= =?us-ascii?q?AEFAQsBgxQBAQEBAYFxpTKCBQGPPoQVFIYKgWBMAQEBAQEBAQECAQIQAQEBCgs?= =?us-ascii?q?JCRkvgjIYgxcwgSGITb8WhjeGIoJGfIUSBY40i0KPYAqPagKQaIN/gV08NIQpg?= =?us-ascii?q?i4BAQE?= X-IPAS-Result: =?us-ascii?q?A0GVAQD5lOpXhxy3hNFdHAEBBAEBCgEBGAEFAQsBgxQBAQE?= =?us-ascii?q?BAYFxpTKCBQGPPoQVFIYKgWBMAQEBAQEBAQECAQIQAQEBCgsJCRkvgjIYgxcwg?= =?us-ascii?q?SGITb8WhjeGIoJGfIUSBY40i0KPYAqPagKQaIN/gV08NIQpgi4BAQE?= X-IronPort-AV: E=Sophos;i="5.30,405,1470700800"; d="scan'208";a="19590795" Received: from mx1.redhat.com ([209.132.183.28]) by emsm-gh1-uea11.nsa.gov with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 27 Sep 2016 15:51:20 +0000 Received: from int-mx14.intmail.prod.int.phx2.redhat.com (int-mx14.intmail.prod.int.phx2.redhat.com [10.5.11.27]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id E018BC008AEC for ; Tue, 27 Sep 2016 15:51:18 +0000 (UTC) Received: from localhost.localdomain.com (ovpn-200-19.brq.redhat.com [10.40.200.19]) by int-mx14.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id u8RFpHlj023781; Tue, 27 Sep 2016 11:51:18 -0400 From: Miroslav Grepl To: selinux@tycho.nsa.gov Subject: [PATCH] libsemanage: Do not always print a module name warning Date: Tue, 27 Sep 2016 17:51:12 +0200 Message-Id: <20160927155113.19322-1-mgrepl@redhat.com> X-Scanned-By: MIMEDefang 2.68 on 10.5.11.27 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.32]); Tue, 27 Sep 2016 15:51:18 +0000 (UTC) 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-Virus-Scanned: ClamAV using ClamSMTP From: Miroslav Grep 7a728e46 commit supposed to add a warning when a module name is different than a filename, but this warning is printed always. This commit fixes it. Fixes: $ semodule -X 400 -i testmod.pp Warning: SELinux userspace will refer to the module from testmod.pp as testmod rather than testmod Signed-off-by: Miroslav Grepl --- libsemanage/src/direct_api.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/libsemanage/src/direct_api.c b/libsemanage/src/direct_api.c index 4320f43..3719cb1 100644 --- a/libsemanage/src/direct_api.c +++ b/libsemanage/src/direct_api.c @@ -1619,7 +1619,9 @@ static int semanage_direct_install_file(semanage_handle_t * sh, if ((retval = parse_module_headers(sh, data, data_len, &module_name, &version)) != 0) goto cleanup; - fprintf(stderr, "Warning: SELinux userspace will refer to the module from %s as %s rather than %s\n", install_filename, module_name, filename); + if (strcmp(module_name, filename) != 0) + fprintf(stderr, "Warning: SELinux userspace will refer to the module from %s as %s rather than %s\n", install_filename, module_name, filename); + free(version); } retval = semanage_direct_install(sh, data, data_len, module_name, lang_ext);