From patchwork Fri May 20 13:08:44 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Christian_G=C3=B6ttsche?= X-Patchwork-Id: 12856814 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 62879C433FE for ; Fri, 20 May 2022 13:08:57 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1349697AbiETNI4 (ORCPT ); Fri, 20 May 2022 09:08:56 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:41492 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1349693AbiETNIz (ORCPT ); Fri, 20 May 2022 09:08:55 -0400 Received: from mail-ed1-x52f.google.com (mail-ed1-x52f.google.com [IPv6:2a00:1450:4864:20::52f]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id BB0EA1632AC for ; Fri, 20 May 2022 06:08:53 -0700 (PDT) Received: by mail-ed1-x52f.google.com with SMTP id i40so10729263eda.7 for ; Fri, 20 May 2022 06:08:53 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=googlemail.com; s=20210112; h=from:to:subject:date:message-id:mime-version :content-transfer-encoding; bh=hhF+tWQjOPpI2OiFwo2RDcVdwaDVEsXYnduE/AEjPbo=; b=mxPx1FZGIW6FyJZ5SKMKCI+aTb9SqaiPPehpBOAWbC01Pn/w+H/588tl0/9w4XCZa2 /f8qDuJg9B0rjGXH2pPjfiTtt/kjiZ/cYbS7BZdmonbJOfkn/8h6omqABdRytb64JWMR 5CuBxM5PCmcUfcC/0C+al9fUnRsclLcIlHmF7bUJGLDNXy963yptK8C9AbvRqNvcULQo GKYeXBE6ga7QKSRHRUC1Krb8QzVa7OI/Y+paeoVov+saoL3u0IrRNcA+0T7nHmLuuPC2 dJHTvjMf4UYpTKzgYpmUdMtxZYKxRg5j4bKXDZXxwvuBsarEF4aJKif4hlSLzgmVYSJE HMsg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:subject:date:message-id:mime-version :content-transfer-encoding; bh=hhF+tWQjOPpI2OiFwo2RDcVdwaDVEsXYnduE/AEjPbo=; b=N8o2IcNlGdKEMeWXLzAaIyVdhwDPNkDGazJW7nDuUdDhNKKMkqa1Z1sHcyvqjzRbSH ptcwFd8id068iyvWLdG/INGkLB77YAD/TH7X/bUJxFUeS4BT4XrUdBO7go+PDehDIWc2 UqwRqeWCA2lM86yqjxJp3JetGw8mQ6LS0h2wxJIhmRIbZ7zWAqC1YwWmK54TnCEDCTZD Ny5Ib9AUEf/7Floq2QooQqjwob1Cxt2+UIKCCwQynAD2lViTllMFn2Tm5qJl8vWSLhgs A6YyBvYP+cpNU1kA9/M2n7F9wCx4XikbU5UDnxQsAn2hOMUeZY5EzgUCcLlXMc83b5gY Lgng== X-Gm-Message-State: AOAM530AYA7T/0NSkjosPhpX6XVESM/RxS2ybL1eS6DvpNmJZwiYpg6x GtPYorGSjzkAPsv1mWGdRe/EFb+Vkv4= X-Google-Smtp-Source: ABdhPJwMr0fm6YXv492CHSEP5Qcdv9Xj03aDVArRokx5ccrNqVyZTC0ahwPoNtByfdVw4uK4rBkVWw== X-Received: by 2002:a05:6402:27cd:b0:427:bf42:44cb with SMTP id c13-20020a05640227cd00b00427bf4244cbmr10848943ede.276.1653052132295; Fri, 20 May 2022 06:08:52 -0700 (PDT) Received: from debianHome.localdomain (dynamic-077-008-251-125.77.8.pool.telefonica.de. [77.8.251.125]) by smtp.gmail.com with ESMTPSA id hs33-20020a1709073ea100b006feb71acbb3sm160154ejc.105.2022.05.20.06.08.51 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 20 May 2022 06:08:51 -0700 (PDT) From: =?utf-8?q?Christian_G=C3=B6ttsche?= To: selinux@vger.kernel.org Subject: [PATCH 1/4] libselinux: add man page redirections Date: Fri, 20 May 2022 15:08:44 +0200 Message-Id: <20220520130847.10958-1-cgzones@googlemail.com> X-Mailer: git-send-email 2.36.1 MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: selinux@vger.kernel.org The following interfaces are documented but do not have a redirection: - context_str(3) - security_get_checkreqprot(3) - security_set_boolean_list(3) - selinux_sepgsql_context_path(3) - setexecfilecon(3) Signed-off-by: Christian Göttsche Acked-by: James Carter --- libselinux/man/man3/context_str.3 | 1 + libselinux/man/man3/security_get_checkreqprot.3 | 1 + libselinux/man/man3/security_set_boolean_list.3 | 1 + libselinux/man/man3/selinux_sepgsql_context_path.3 | 1 + libselinux/man/man3/setexecfilecon.3 | 1 + 5 files changed, 5 insertions(+) create mode 100644 libselinux/man/man3/context_str.3 create mode 100644 libselinux/man/man3/security_get_checkreqprot.3 create mode 100644 libselinux/man/man3/security_set_boolean_list.3 create mode 100644 libselinux/man/man3/selinux_sepgsql_context_path.3 create mode 100644 libselinux/man/man3/setexecfilecon.3 diff --git a/libselinux/man/man3/context_str.3 b/libselinux/man/man3/context_str.3 new file mode 100644 index 00000000..f4f03a6d --- /dev/null +++ b/libselinux/man/man3/context_str.3 @@ -0,0 +1 @@ +.so man3/context_new.3 diff --git a/libselinux/man/man3/security_get_checkreqprot.3 b/libselinux/man/man3/security_get_checkreqprot.3 new file mode 100644 index 00000000..d59e5c2c --- /dev/null +++ b/libselinux/man/man3/security_get_checkreqprot.3 @@ -0,0 +1 @@ +.so man3/security_getenforce.3 diff --git a/libselinux/man/man3/security_set_boolean_list.3 b/libselinux/man/man3/security_set_boolean_list.3 new file mode 100644 index 00000000..29731efa --- /dev/null +++ b/libselinux/man/man3/security_set_boolean_list.3 @@ -0,0 +1 @@ +.so man3/security_load_booleans.3 diff --git a/libselinux/man/man3/selinux_sepgsql_context_path.3 b/libselinux/man/man3/selinux_sepgsql_context_path.3 new file mode 100644 index 00000000..175a611a --- /dev/null +++ b/libselinux/man/man3/selinux_sepgsql_context_path.3 @@ -0,0 +1 @@ +.so man3/selinux_binary_policy_path.3 diff --git a/libselinux/man/man3/setexecfilecon.3 b/libselinux/man/man3/setexecfilecon.3 new file mode 100644 index 00000000..b2e6ab81 --- /dev/null +++ b/libselinux/man/man3/setexecfilecon.3 @@ -0,0 +1 @@ +.so man3/getexeccon.3 From patchwork Fri May 20 13:08:45 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Christian_G=C3=B6ttsche?= X-Patchwork-Id: 12856815 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 6CB9BC433F5 for ; Fri, 20 May 2022 13:08:58 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1345583AbiETNI5 (ORCPT ); Fri, 20 May 2022 09:08:57 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:41494 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1349694AbiETNIz (ORCPT ); Fri, 20 May 2022 09:08:55 -0400 Received: from mail-ej1-x62c.google.com (mail-ej1-x62c.google.com [IPv6:2a00:1450:4864:20::62c]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id B682B1632AB for ; Fri, 20 May 2022 06:08:54 -0700 (PDT) Received: by mail-ej1-x62c.google.com with SMTP id f21so1870632ejh.11 for ; Fri, 20 May 2022 06:08:54 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=googlemail.com; s=20210112; h=from:to:subject:date:message-id:in-reply-to:references:mime-version :content-transfer-encoding; bh=Q0EUWFdytUcHJEHqsWdttuqMXD+RgVp3fYdL2P+BxU4=; b=JTD2JFz+C4s+MZ6eo0jnSxxx5F0arp7ZfYXaNe3ivpED1aVJu+CzzhR5bkn4PYn4+B iIvGQtHtavzy57vPb3+rQVR5u8oxfma2GKAsB7x+8oD25JKjdI2RDV2gB1BwfhaRNcqB I8nn0Qbte4nRAoEo+0FmDPOAn3n2k3+OxsTdVFKoMD5Ym3gte0ElWrI775HGmaQJjuMY 1Tgy3YfZcdZa79hLo+/D82dkinuM5U0+HLK1tClq3qi0tWJAB51wIpvb0ZYsNG4uNkKa Af23y/I+JSj9UcfGZIyBcCMRh7clpN7OvCaK1lhkTsLSDW6WGIZi8s7Bvhig/fO1ESUu O3xQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=Q0EUWFdytUcHJEHqsWdttuqMXD+RgVp3fYdL2P+BxU4=; b=dE4RJLbQA+hPhqiAOlNGh3IPnNd6gqrp8Co/wMaQ3OYFkLn2XxFezq1r0r71HHyjRj OEyXAdR5h5uQr7ZNqGiCju9NE28vk16ZVGn9hJ/8sLHf5KMNZDoU1j86aDp7pyMFQs9j tmPHWqUAYGk3eyuUPr+WLAuoTf6J45TD08XBSBVn3wVyFM4FvqFSQgriEmIw2SzkAqhp tW1hsHOwhJJooTY0xTMQe+WkX2wmwaULuxDNg/s0jNgbrrKerRQcVt14Wjx5Ntl5WRE4 ZcjDOmsYWM2Ne96fG6PdyJeRvAlZfALpzdrUfROrl+RrQWLrALhZat+hYBATThdSsvKW BiiQ== X-Gm-Message-State: AOAM530zi3Q9qSYWLgIfwHaIpm6J7W7cdVkL67wG9FhmX+YI/iJK/m2j wS/cJ0ptfN5bCtIJ/fIQW+IG6CnMA30= X-Google-Smtp-Source: ABdhPJz5K0h16dIKZv0qdrzkrIR6YxPthBq9BOv9lyU7+yllIui0ay2zBeVKaNtiIizexut6IsP3jA== X-Received: by 2002:a17:907:1c8a:b0:6e9:2a0d:d7b7 with SMTP id nb10-20020a1709071c8a00b006e92a0dd7b7mr8516007ejc.572.1653052133231; Fri, 20 May 2022 06:08:53 -0700 (PDT) Received: from debianHome.localdomain (dynamic-077-008-251-125.77.8.pool.telefonica.de. [77.8.251.125]) by smtp.gmail.com with ESMTPSA id hs33-20020a1709073ea100b006feb71acbb3sm160154ejc.105.2022.05.20.06.08.52 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 20 May 2022 06:08:52 -0700 (PDT) From: =?utf-8?q?Christian_G=C3=B6ttsche?= To: selinux@vger.kernel.org Subject: [PATCH 2/4] libselinux: enclose macro definition in parenthesis Date: Fri, 20 May 2022 15:08:45 +0200 Message-Id: <20220520130847.10958-2-cgzones@googlemail.com> X-Mailer: git-send-email 2.36.1 In-Reply-To: <20220520130847.10958-1-cgzones@googlemail.com> References: <20220520130847.10958-1-cgzones@googlemail.com> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: selinux@vger.kernel.org Avoid potential precedence issues. Signed-off-by: Christian Göttsche --- libselinux/include/selinux/avc.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libselinux/include/selinux/avc.h b/libselinux/include/selinux/avc.h index 9b23357a..4bbd2382 100644 --- a/libselinux/include/selinux/avc.h +++ b/libselinux/include/selinux/avc.h @@ -24,7 +24,7 @@ struct security_id { }; typedef struct security_id *security_id_t; -#define SECSID_WILD (security_id_t)NULL /* unspecified SID */ +#define SECSID_WILD ((security_id_t)NULL) /* unspecified SID */ /** * avc_sid_to_context - get copy of context corresponding to SID. From patchwork Fri May 20 13:08:46 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Christian_G=C3=B6ttsche?= X-Patchwork-Id: 12856817 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 542AEC433EF for ; Fri, 20 May 2022 13:09:03 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1349694AbiETNJC (ORCPT ); Fri, 20 May 2022 09:09:02 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:41540 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1349693AbiETNI7 (ORCPT ); Fri, 20 May 2022 09:08:59 -0400 Received: from mail-ed1-x534.google.com (mail-ed1-x534.google.com [IPv6:2a00:1450:4864:20::534]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 544D51632B3 for ; Fri, 20 May 2022 06:08:55 -0700 (PDT) Received: by mail-ed1-x534.google.com with SMTP id c12so10708172eds.10 for ; Fri, 20 May 2022 06:08:55 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=googlemail.com; s=20210112; h=from:to:subject:date:message-id:in-reply-to:references:mime-version :content-transfer-encoding; bh=4Dk3zB+WfskNYnsoK5lRUri5bHkHXJE7wAl8aVxVDDk=; b=GcMaBEtXaa3JnymiOhTuU9bYcRAXrFByk/rWBJyzIHhx3Nx9S9ag0lnWHqzFRdfw+/ hyIVFhISks7fRsMeOfzwv3THqGOsHz+h4iI1LImZ5ozBeHKnRImHV3+3YlBxTSQCwoII MRjtzJM+bsHFnOuGIXKZQ7jry2ZfVPRebJBhoBL5zI8Ig4kcCuAZCej43rGFmlgs0v3r ZLjdIyqdoQjaOmzCBr76yoKQSjIlmEGoAYy2wJp3IiYw8Qr65PnMnY9H/ZvdMj2fxeuo Vhy2JwkgqmLLHBmpaYJFbm4q346aVipWWBLqUdhUpTU7aBYs0+zJVXkoGfwDFfFaE+lg nA+w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=4Dk3zB+WfskNYnsoK5lRUri5bHkHXJE7wAl8aVxVDDk=; b=eg5WoxHGuksGylnzausTDYv6henfrubCp992RfCq/HERBVNGmF1KaWTOKeS47fEKuR Cq1g/SMpfC8qRUhOtkdB8A7/Xb4xstRhOQ7OEvA9utfB5pkAOahGG8e2+djJaqo6xliI 13FD+zUAAn2BtIiWiV1V/raAkHdI9uRD3DNmlje197yxpFbuszE4ijyoc8lbd9KO2lrk v7/IbeXehVPgtMhndcKb2iQVfm/SiQe7AZ/FF79+zeTmkcZBtA1tJL0necdyaU/omZDm NVZG62nOptleGNKti7aKd++3FVqb/9+T2NtdW2M4XN1q4a9FATv9YFqClx59iYHmq6Wn zC4A== X-Gm-Message-State: AOAM533qp6RcHz+CLxsDwWr1l5M92k4zC4P7+uI6ga37P2xl+3q23b4o +VXYlkdbkPMXpYIHDkeHGz3A6GG1xEs= X-Google-Smtp-Source: ABdhPJzm4BKQ8iXFpyBwZvgjYpEfQF4ZzSs410digkRpBAqgKcoKhFp1GQlthI/+B+Nr1JOcNjybfw== X-Received: by 2002:a05:6402:3484:b0:428:1a5e:3d48 with SMTP id v4-20020a056402348400b004281a5e3d48mr11002675edc.401.1653052133873; Fri, 20 May 2022 06:08:53 -0700 (PDT) Received: from debianHome.localdomain (dynamic-077-008-251-125.77.8.pool.telefonica.de. [77.8.251.125]) by smtp.gmail.com with ESMTPSA id hs33-20020a1709073ea100b006feb71acbb3sm160154ejc.105.2022.05.20.06.08.53 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 20 May 2022 06:08:53 -0700 (PDT) From: =?utf-8?q?Christian_G=C3=B6ttsche?= To: selinux@vger.kernel.org Subject: [PATCH 3/4] libselinux: name parameters in context.h Date: Fri, 20 May 2022 15:08:46 +0200 Message-Id: <20220520130847.10958-3-cgzones@googlemail.com> X-Mailer: git-send-email 2.36.1 In-Reply-To: <20220520130847.10958-1-cgzones@googlemail.com> References: <20220520130847.10958-1-cgzones@googlemail.com> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: selinux@vger.kernel.org Signed-off-by: Christian Göttsche --- libselinux/include/selinux/context.h | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/libselinux/include/selinux/context.h b/libselinux/include/selinux/context.h index 949fb1e1..1fb3a69c 100644 --- a/libselinux/include/selinux/context.h +++ b/libselinux/include/selinux/context.h @@ -17,7 +17,7 @@ extern "C" { /* Return a new context initialized to a context string */ - extern context_t context_new(const char *); + extern context_t context_new(const char *str); /* * Return a pointer to the string value of the context_t @@ -25,24 +25,24 @@ extern "C" { * for the same context_t* */ - extern char *context_str(context_t); + extern char *context_str(context_t con); /* Free the storage used by a context */ - extern void context_free(context_t); + extern void context_free(context_t con); /* Get a pointer to the string value of a context component */ - extern const char *context_type_get(context_t); - extern const char *context_range_get(context_t); - extern const char *context_role_get(context_t); - extern const char *context_user_get(context_t); + extern const char *context_type_get(context_t con); + extern const char *context_range_get(context_t con); + extern const char *context_role_get(context_t con); + extern const char *context_user_get(context_t con); /* Set a context component. Returns nonzero if unsuccessful */ - extern int context_type_set(context_t, const char *); - extern int context_range_set(context_t, const char *); - extern int context_role_set(context_t, const char *); - extern int context_user_set(context_t, const char *); + extern int context_type_set(context_t con, const char *type); + extern int context_range_set(context_t con, const char *range); + extern int context_role_set(context_t con, const char *role); + extern int context_user_set(context_t con, const char *user); #ifdef __cplusplus } From patchwork Fri May 20 13:08:47 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Christian_G=C3=B6ttsche?= X-Patchwork-Id: 12856816 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id CA974C433F5 for ; Fri, 20 May 2022 13:09:02 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1349704AbiETNJC (ORCPT ); Fri, 20 May 2022 09:09:02 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:41542 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1349694AbiETNI7 (ORCPT ); Fri, 20 May 2022 09:08:59 -0400 Received: from mail-ej1-x632.google.com (mail-ej1-x632.google.com [IPv6:2a00:1450:4864:20::632]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 365631632AC for ; Fri, 20 May 2022 06:08:56 -0700 (PDT) Received: by mail-ej1-x632.google.com with SMTP id y13so14793597eje.2 for ; Fri, 20 May 2022 06:08:56 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=googlemail.com; s=20210112; h=from:to:subject:date:message-id:in-reply-to:references:mime-version :content-transfer-encoding; bh=LF3QUQYE9OdQCax0pir/nh180w2c/4Uy4faBw5baxDg=; b=JiPkj0d4Cl5xHmXkypFja/xl50SsTZyAztT0cIFC9+tPZWb9pl9BLxMwuXggNSKNVt gitU3R8JLZs4Zv3CqXkreIAO7OC2HY4xKUUkCRUdSM59uY8FVRmOagmaeZs4TQwmNkdF jyOl22FZX1hveczJgr2H5LcNx7Uj/4p/5Q3jznliEc+WfTEKV13RIWbz921MLZWxIKFG hDWuh/sg2+JjBV2WZyrQ3yW9+S7ayphvb1GRHe5AhrBwF/udprmBEE+excde5L70KmlZ LQrkoS1C2bHPfNQRGYzBDfXcab2mgW7xiW3vbNvRU40xkyA5JtzYtSChEpq8tBOG75Wp EZuA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=LF3QUQYE9OdQCax0pir/nh180w2c/4Uy4faBw5baxDg=; b=CdXhucKgS0j32JNvYpIcWeDDpd4gYheR62ujtLbqYyzj3oKyYDfoYY5WU/bF9AauPV CTKggtqhHSwkd1N8Y94KyQ8qLX1TMpNj1WEW+8WvBo2hHV6c8T7ZYvyKwRp/zB1hCVak CMn6ZcJ8hpauhZFwJkk4GCavLtBXRntKC0A4Ikc4kbKi97aKdNCt7a577dssJFKt4eQN 0vvJf7r2hKFGUm44EpZT7EemBStV78IojowJAzsfJNsG17Z/1iHScR+m3ciizNsUdQE1 VzEWSPc/PH7bxqGmXUObh0wHN0KoFClBs18ZTMZc3jd/wdLQEgigqORaiNKJWb3afDWd jWRg== X-Gm-Message-State: AOAM531enD/2L0xD/m3LLZvqxiv9imbWQurk1OGw5XWHjW3PpYfwBmRw Hbk5ZWqCaQO0SWeBDRj54UWvgWCoZlE= X-Google-Smtp-Source: ABdhPJxrwbZCDSEaOzYEXBLvzE3rtezwvcvngMwEnfzHNqesUOC0d7HNK9/mPqQFhNVrgdAOiSwiqQ== X-Received: by 2002:a17:907:1c08:b0:6fe:8983:e192 with SMTP id nc8-20020a1709071c0800b006fe8983e192mr8650605ejc.444.1653052134733; Fri, 20 May 2022 06:08:54 -0700 (PDT) Received: from debianHome.localdomain (dynamic-077-008-251-125.77.8.pool.telefonica.de. [77.8.251.125]) by smtp.gmail.com with ESMTPSA id hs33-20020a1709073ea100b006feb71acbb3sm160154ejc.105.2022.05.20.06.08.53 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 20 May 2022 06:08:54 -0700 (PDT) From: =?utf-8?q?Christian_G=C3=B6ttsche?= To: selinux@vger.kernel.org Subject: [PATCH 4/4] libselinux: declare parameter of security_load_policy(3) const Date: Fri, 20 May 2022 15:08:47 +0200 Message-Id: <20220520130847.10958-4-cgzones@googlemail.com> X-Mailer: git-send-email 2.36.1 In-Reply-To: <20220520130847.10958-1-cgzones@googlemail.com> References: <20220520130847.10958-1-cgzones@googlemail.com> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: selinux@vger.kernel.org security_load_policy(3) takes a read-only memory address for a binary policy to be loaded. Signed-off-by: Christian Göttsche --- libselinux/include/selinux/selinux.h | 2 +- libselinux/man/man3/security_load_policy.3 | 2 +- libselinux/src/load_policy.c | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/libselinux/include/selinux/selinux.h b/libselinux/include/selinux/selinux.h index ae98a92e..47af9953 100644 --- a/libselinux/include/selinux/selinux.h +++ b/libselinux/include/selinux/selinux.h @@ -279,7 +279,7 @@ extern int security_validatetrans_raw(const char *scon, const char *newcon); /* Load a policy configuration. */ -extern int security_load_policy(void *data, size_t len); +extern int security_load_policy(const void *data, size_t len); /* Get the context of an initial kernel security identifier by name. Caller must free via freecon */ diff --git a/libselinux/man/man3/security_load_policy.3 b/libselinux/man/man3/security_load_policy.3 index af561636..b2da0256 100644 --- a/libselinux/man/man3/security_load_policy.3 +++ b/libselinux/man/man3/security_load_policy.3 @@ -5,7 +5,7 @@ security_load_policy \- load a new SELinux policy .SH "SYNOPSIS" .B #include .sp -.BI "int security_load_policy(void *" data ", size_t "len ); +.BI "int security_load_policy(const void *" data ", size_t "len ); .sp .BI "int selinux_mkload_policy(int " preservebools ");" .sp diff --git a/libselinux/src/load_policy.c b/libselinux/src/load_policy.c index d8c715ed..17918e8b 100644 --- a/libselinux/src/load_policy.c +++ b/libselinux/src/load_policy.c @@ -23,7 +23,7 @@ #define MNT_DETACH 2 #endif -int security_load_policy(void *data, size_t len) +int security_load_policy(const void *data, size_t len) { char path[PATH_MAX]; int fd, ret;