From patchwork Thu Jan 31 19:48:23 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Petr Lautrbach X-Patchwork-Id: 10791381 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 6FE601390 for ; Thu, 31 Jan 2019 19:48:35 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 6852031793 for ; Thu, 31 Jan 2019 19:48:35 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 59CA1317A4; Thu, 31 Jan 2019 19:48:35 +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=-7.9 required=2.0 tests=BAYES_00,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 0346931793 for ; Thu, 31 Jan 2019 19:48:35 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727189AbfAaTse (ORCPT ); Thu, 31 Jan 2019 14:48:34 -0500 Received: from mx1.redhat.com ([209.132.183.28]:38392 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726994AbfAaTse (ORCPT ); Thu, 31 Jan 2019 14:48:34 -0500 Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.phx2.redhat.com [10.5.11.15]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 9017D796E2 for ; Thu, 31 Jan 2019 19:48:34 +0000 (UTC) Received: from workstation.redhat.com (unknown [10.40.205.62]) by smtp.corp.redhat.com (Postfix) with ESMTP id CE3E15D787; Thu, 31 Jan 2019 19:48:33 +0000 (UTC) From: Petr Lautrbach To: selinux@vger.kernel.org Cc: Petr Lautrbach Subject: [PATCH 1/2] libselinux: set an appropriate errno in booleans.c Date: Thu, 31 Jan 2019 20:48:23 +0100 Message-Id: <20190131194824.4944-1-plautrba@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.15 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.25]); Thu, 31 Jan 2019 19:48:34 +0000 (UTC) Sender: selinux-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: selinux@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Fixes: $ mkdir booleans $ sudo mount --bind ./booleans /sys/fs/selinux/booleans $ sudo getsebool -a getsebool: Unable to get boolean names: Success Signed-off-by: Petr Lautrbach Acked-by: Nicolas Iooss --- libselinux/src/booleans.c | 1 + 1 file changed, 1 insertion(+) diff --git a/libselinux/src/booleans.c b/libselinux/src/booleans.c index b3ea3623..a6d46fea 100644 --- a/libselinux/src/booleans.c +++ b/libselinux/src/booleans.c @@ -55,6 +55,7 @@ int security_get_boolean_names(char ***names, int *len) snprintf(path, sizeof path, "%s%s", selinux_mnt, SELINUX_BOOL_DIR); *len = scandir(path, &namelist, &filename_select, alphasort); if (*len <= 0) { + errno = ENOENT; return -1; } From patchwork Thu Jan 31 19:48:24 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Petr Lautrbach X-Patchwork-Id: 10791383 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 932A013B5 for ; Thu, 31 Jan 2019 19:48:36 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 8C12431793 for ; Thu, 31 Jan 2019 19:48:36 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 80BFD317A4; Thu, 31 Jan 2019 19:48:36 +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=-7.9 required=2.0 tests=BAYES_00,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 15D0431793 for ; Thu, 31 Jan 2019 19:48:36 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728020AbfAaTsf (ORCPT ); Thu, 31 Jan 2019 14:48:35 -0500 Received: from mx1.redhat.com ([209.132.183.28]:57672 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726994AbfAaTsf (ORCPT ); Thu, 31 Jan 2019 14:48:35 -0500 Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.phx2.redhat.com [10.5.11.15]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id A060789AE6 for ; Thu, 31 Jan 2019 19:48:35 +0000 (UTC) Received: from workstation.redhat.com (unknown [10.40.205.62]) by smtp.corp.redhat.com (Postfix) with ESMTP id DD39554504; Thu, 31 Jan 2019 19:48:34 +0000 (UTC) From: Petr Lautrbach To: selinux@vger.kernel.org Cc: Petr Lautrbach Subject: [PATCH 2/2] libselinux: Change matchpathcon usage to match with matchpathcon manpage Date: Thu, 31 Jan 2019 20:48:24 +0100 Message-Id: <20190131194824.4944-2-plautrba@redhat.com> In-Reply-To: <20190131194824.4944-1-plautrba@redhat.com> References: <20190131194824.4944-1-plautrba@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.15 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.26]); Thu, 31 Jan 2019 19:48:35 +0000 (UTC) Sender: selinux-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: selinux@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Signed-off-by: Petr Lautrbach Acked-by: Nicolas Iooss --- libselinux/utils/matchpathcon.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libselinux/utils/matchpathcon.c b/libselinux/utils/matchpathcon.c index 67e4a433..9756d7d9 100644 --- a/libselinux/utils/matchpathcon.c +++ b/libselinux/utils/matchpathcon.c @@ -14,7 +14,7 @@ static __attribute__ ((__noreturn__)) void usage(const char *progname) { fprintf(stderr, - "usage: %s [-N] [-n] [-f file_contexts] [ -P policy_root_path ] [-p prefix] [-Vq] path...\n", + "usage: %s [-V] [-N] [-n] [-m type] [-f file_contexts_file] [-p prefix] [-P policy_root_path] filepath...\n", progname); exit(1); }