From patchwork Thu Jun 13 15:59:03 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: 10992609 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 C619713AF for ; Thu, 13 Jun 2019 15:59:08 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id B534D2267B for ; Thu, 13 Jun 2019 15:59:08 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id A990522B27; Thu, 13 Jun 2019 15:59:08 +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 561DD23B24 for ; Thu, 13 Jun 2019 15:59:08 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1732645AbfFMP7H (ORCPT ); Thu, 13 Jun 2019 11:59:07 -0400 Received: from 48.23.240.77.static.louhi.net ([77.240.23.48]:37830 "EHLO kolttonen.fi" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1731464AbfFMP7G (ORCPT ); Thu, 13 Jun 2019 11:59:06 -0400 Received: from 34-41-5D-CA-59-C7 (82-203-159-32.bb.dnainternet.fi [82.203.159.32]) (authenticated bits=0) by vcust561.louhi.net (8.14.7/8.14.7/0) with ESMTP id x5DFwTCR030721 (version=TLSv1/SSLv3 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO) for ; Thu, 13 Jun 2019 18:58:30 +0300 DKIM-Filter: OpenDKIM Filter v2.11.0 vcust561.louhi.net x5DFwTCR030721 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kolttonen.fi; s=mail; t=1560441510; bh=kFIqmoF1y1FmmcCtfN0cG3SJeQ30V50WPy1BzAZ1ND8=; h=Date:From:To:Subject:From; b=0xAxUTEbr/NHASNu05SC8o8GfKLJJisv9NXUtgh65X5SnhUIVszGBVboWM8F71q91 SVuV6v+6aFKithbzKiTV70CWyEBmDoH6uiDFaSEG1P3L2UahB3mCcEk2lteU/6IW8E rtVoBb2OnJu1j4HGbObMjCRiNHNabJv6NNRzOwl1pagLejmIHArHskLqibeh33BeZE 17rynwU+E1eGEuJ+0v0fJidQ115Q036q4fFLrE9KMlyrkP295WeTgWvYQyXPIr217r yRGSi4VRW5H7x8X+N+XgJuPfn7L3IAJQLNzTFAPZa6tCtzTvJqz6vaPoDWVO0s5SiI glS5WMVsOKtKQ== Date: Thu, 13 Jun 2019 18:59:03 +0300 (EEST) From: =?iso-8859-15?q?Jokke_H=E4m=E4l=E4inen?= To: selinux@vger.kernel.org Subject: [PATCH 1/3] libsepol: 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 When reporting errors, differetiate between source and target SIDs. Signed-off-by: Unto Sten --- libsepol/src/services.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) 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; }