From patchwork Fri May 24 21:52:09 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: =?utf-8?b?Sm9ra2UgSMOkbcOkbMOkaW5lbg==?= X-Patchwork-Id: 10960473 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 3C572933 for ; Fri, 24 May 2019 21:52:14 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 2B3D7289ED for ; Fri, 24 May 2019 21:52:14 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 1F10828A34; Fri, 24 May 2019 21:52:14 +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=-8.0 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,MAILING_LIST_MULTI,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id A5EB0289ED for ; Fri, 24 May 2019 21:52:13 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2404265AbfEXVwN (ORCPT ); Fri, 24 May 2019 17:52:13 -0400 Received: from 48.23.240.77.static.louhi.net ([77.240.23.48]:36278 "EHLO kolttonen.fi" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2404176AbfEXVwN (ORCPT ); Fri, 24 May 2019 17:52:13 -0400 Received: from 34-41-5D-CA-59-C7 (176-93-196-243.bb.dnainternet.fi [176.93.196.243]) (authenticated bits=0) by vcust561.louhi.net (8.14.7/8.14.7/0) with ESMTP id x4OLq1q3010766 (version=TLSv1/SSLv3 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO) for ; Sat, 25 May 2019 00:52:01 +0300 DKIM-Filter: OpenDKIM Filter v2.11.0 vcust561.louhi.net x4OLq1q3010766 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kolttonen.fi; s=mail; t=1558734721; bh=HI+scW3lnvLLst3Ph0gZHyxvXAFliSD8b9OA9ssI+LU=; h=Date:From:To:Subject:From; b=gY1D7R5ltyqztz9Q4Od2xvly67i+SyGAGfypeNqGgA5K1cgAKUFvKWCcg4/jECmu+ 6ZGlVZqGRBQ/xNZwJVNX35GqrAPXGnWaF4WUxWW0Y2tDj9VqiJHHTbpaYlffvzF+5g zAViNlJlm/T2tNLJ9DGP+hsAUr8HboD8bvsKcOXK0roBLG0/PoL2BP5BO4m42Of4Gs biHRemLXKVD65NcJUwdQufIIEdWSIbg4N6x9v2LeI9BszyRBnIACnl2ibML3TeyPXi GDOafXpRO1txzUbZ9mAEgDuj8w+2cxR7mLnYYgyeoCa5g9mWTqAPF0DfEP86Oa9Yov fubAlC5t6z6Sg== Date: Sat, 25 May 2019 00:52:09 +0300 (EEST) From: =?iso-8859-15?q?Jokke_H=E4m=E4l=E4inen?= To: selinux@vger.kernel.org Subject: [PATCH] More accurate error messages Message-ID: User-Agent: Alpine 2.21 (LFD 202 2017-01-01) MIME-Version: 1.0 Sender: selinux-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: selinux@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP diff --git a/libsepol/src/services.c b/libsepol/src/services.c index 303a138c..3758436f 100644 --- a/libsepol/src/services.c +++ b/libsepol/src/services.c @@ -1134,13 +1134,13 @@ int hidden sepol_compute_av_reason(sepol_security_id_t ssid, scontext = sepol_sidtab_search(sidtab, ssid); if (!scontext) { - ERR(NULL, "unrecognized SID %d", ssid); + ERR(NULL, "unrecognized source SID %d", ssid); rc = -EINVAL; goto out; } tcontext = sepol_sidtab_search(sidtab, tsid); if (!tcontext) { - ERR(NULL, "unrecognized SID %d", tsid); + ERR(NULL, "unrecognized target SID %d", tsid); rc = -EINVAL; goto out; } @@ -1170,13 +1170,13 @@ int hidden sepol_compute_av_reason_buffer(sepol_security_id_t ssid, scontext = sepol_sidtab_search(sidtab, ssid); if (!scontext) { - ERR(NULL, "unrecognized SID %d", ssid); + ERR(NULL, "unrecognized source SID %d", ssid); rc = -EINVAL; goto out; } tcontext = sepol_sidtab_search(sidtab, tsid); if (!tcontext) { - ERR(NULL, "unrecognized SID %d", tsid); + ERR(NULL, "unrecognized target SID %d", tsid); rc = -EINVAL; goto out; }