From patchwork Mon Apr 29 16:31:17 2024 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: 13647357 X-Patchwork-Delegate: plautrba@redhat.com Received: from server02.seltendoof.de (server02.seltendoof.de [168.119.48.163]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id E49012F25 for ; Mon, 29 Apr 2024 16:31:34 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=168.119.48.163 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1714408297; cv=none; b=hRFabshN3dbgwRVWCpzlezfpgXRpVkH4D+aW4xRHFYU6d45glRJ/g7nJBdL4tTLgDZqvA6DmUCyNZjh7/dYeUcsHAdJ8NGnpoSH3FE/N0mX11mR86Z3NuiTAHqGQUDQPyL1tmuoZJlQhwFrdVE3MQEeqP92C25x9cz1Y7WjbUWw= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1714408297; c=relaxed/simple; bh=4jx6IFb7Jnk2qHAI6WtCObOAbC/yp65QCwvQxJ7DCKI=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version:Content-Type; b=APS6901Xkh72A5ZwQ3t3gbVhSUcDAf394pp9kYuIzJajkHD+LeP29VfggaUnc/jNkcl5LxNptD5KEiAgiRvYlNr8OXj9Wu/lN0EnFyBiEAX+duydDwL9Y4ROg8VXrEmLUPwivOazphL2NDHkJk/hqr+dMET0pgW+RDgWYImyW4c= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=seltendoof.de; spf=pass smtp.mailfrom=seltendoof.de; dkim=pass (2048-bit key) header.d=seltendoof.de header.i=@seltendoof.de header.b=bpDoYlbI; arc=none smtp.client-ip=168.119.48.163 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=seltendoof.de Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=seltendoof.de Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=seltendoof.de header.i=@seltendoof.de header.b="bpDoYlbI" From: =?utf-8?q?Christian_G=C3=B6ttsche?= DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=seltendoof.de; s=2023072701; t=1714408285; h=from:from:reply-to:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=QNSLkeZhj4T5NYT9kGk/QXIuzrRgomeqYZapPph7v+g=; b=bpDoYlbIt3DjTHuuiZapRxJ5Dg4KabMGBtKguuwei/bNmTxhzmN/0mX0Tol0cD2w6YcMuE km1zhiY7LMrGgPwkvGhEX0K0sLhICK2AB1yKDNpV+gBmCzFgrEpSvrPFlZzOvncJPDVtGk fvT5qqbYJYo4CICO9VJ6UYwHuFwd0k37d/Jue1TaWF5iCTj+IjLTqEyaABuOUTi2sPuq5S 7oPvKy4pL6F2bnT6+Vzg/xo0u6xKArxicRsCNlmuyVHMjcbRwXGuGihJEzwDCQv/dJF1U5 FS/jzscxyfZsBdQ6668cTm4brsInIqUeaF9Wq/Exl2ZWLWl4eFtZWFVbCxPcRw== To: selinux@vger.kernel.org Cc: =?utf-8?q?Christian_G=C3=B6ttsche?= Subject: [PATCH 1/5] libselinux/man: correct file extension of man pages Date: Mon, 29 Apr 2024 18:31:17 +0200 Message-ID: <20240429163122.63181-1-cgoettsche@seltendoof.de> Reply-To: cgzones@googlemail.com Precedence: bulk X-Mailing-List: selinux@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 From: Christian Göttsche Set the correct file extension .3 (instead of .c) for the security_validatetrans(3) and security_validatetrans_raw(3) man pages. Signed-off-by: Christian Göttsche Acked-by: James Carter --- .../man3/{security_validatetrans.c => security_validatetrans.3} | 0 ...{security_validatetrans_raw.c => security_validatetrans_raw.3} | 0 2 files changed, 0 insertions(+), 0 deletions(-) rename libselinux/man/man3/{security_validatetrans.c => security_validatetrans.3} (100%) rename libselinux/man/man3/{security_validatetrans_raw.c => security_validatetrans_raw.3} (100%) diff --git a/libselinux/man/man3/security_validatetrans.c b/libselinux/man/man3/security_validatetrans.3 similarity index 100% rename from libselinux/man/man3/security_validatetrans.c rename to libselinux/man/man3/security_validatetrans.3 diff --git a/libselinux/man/man3/security_validatetrans_raw.c b/libselinux/man/man3/security_validatetrans_raw.3 similarity index 100% rename from libselinux/man/man3/security_validatetrans_raw.c rename to libselinux/man/man3/security_validatetrans_raw.3 From patchwork Mon Apr 29 16:31:18 2024 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: 13647360 X-Patchwork-Delegate: plautrba@redhat.com Received: from server02.seltendoof.de (server02.seltendoof.de [168.119.48.163]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id E49AADDCD for ; Mon, 29 Apr 2024 16:31:34 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=168.119.48.163 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1714408298; cv=none; b=bxNFLGRkHAHbcPlB7oVZ0fQBk9WqzDvYoB22DY+Tyt0QUZ4SPatMZ/5w8qQ/B5JBHTpVyS78BrpoiIutGv6Jh1frSXsH3UvqfhGtay0T/xbY7m1Jp3l0LM2Cn+3lhF4wEwe34KR53vpT7VX4R1QZ3OavMmTywC05tRTGtf2la2o= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1714408298; c=relaxed/simple; bh=rTal/q4ghqT7cebwWpOAqJ89DKx379P1Kr54bzwuoX0=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=LO7Zz53sJafXOnpDmh4PqCZsEh+bH3CdMgn1R4ZHQHSki1KGjDSihQyAZ0Hh3VEORA4khCUOJqYR2qj0YnAWrMh5NaMymmAHMHBfPHOrsWLdFX8Ald4PrI3C/KvVEAuj1XRfouKZHFWN4+IqWytrO9NkADAhGLbQ19HAH9YAW/Q= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=seltendoof.de; spf=pass smtp.mailfrom=seltendoof.de; dkim=pass (2048-bit key) header.d=seltendoof.de header.i=@seltendoof.de header.b=iAQE/iUD; arc=none smtp.client-ip=168.119.48.163 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=seltendoof.de Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=seltendoof.de Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=seltendoof.de header.i=@seltendoof.de header.b="iAQE/iUD" From: =?utf-8?q?Christian_G=C3=B6ttsche?= DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=seltendoof.de; s=2023072701; t=1714408287; h=from:from:reply-to:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=b1HUhJK5Bwccwd+BmaVdJnm6u8u0waWo9On4SQkcM30=; b=iAQE/iUDOyde2lsnUKyUmP/syy45oQ6feeCmWEpfcGjm00qja8E08uUwfTSamroTV7njTK yEnyI1exHGZx5PlvKLQAC8inZ5az+N5I4fQ7lz5yk+vJpkRCLKV1zewSF9y2zi3RpV554t 3v1FIZEaLS2C1NxXAdF3tqR5ZpLfvUhPMaIyYBQ/xDrjSwx9AOWHXT+7YZoxP0p4S0gsNR GijPNpBJ+w67/LeLnebE7EHXXOIs+rIV8xe/ZL324ATQIyAJ/iGvQNYoMXZKK/TTZHng7R EBE43MIlMT+KxQ/KmWmUWzhIWFiIQx8mhvsMwwHwN8JAQIwWV713/xwSqVKOGA== To: selinux@vger.kernel.org Cc: =?utf-8?q?Christian_G=C3=B6ttsche?= Subject: [PATCH 2/5] libselinux/man: sync const qualifiers Date: Mon, 29 Apr 2024 18:31:18 +0200 Message-ID: <20240429163122.63181-2-cgoettsche@seltendoof.de> In-Reply-To: <20240429163122.63181-1-cgoettsche@seltendoof.de> References: <20240429163122.63181-1-cgoettsche@seltendoof.de> Reply-To: cgzones@googlemail.com Precedence: bulk X-Mailing-List: selinux@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 From: Christian Göttsche Sync the const qualifiers of parameters with the actual implementation. Signed-off-by: Christian Göttsche --- libselinux/man/man3/avc_context_to_sid.3 | 2 +- libselinux/man/man3/getfscreatecon.3 | 4 ++-- libselinux/man/man3/getkeycreatecon.3 | 4 ++-- libselinux/man/man3/getsockcreatecon.3 | 4 ++-- libselinux/man/man3/init_selinuxmnt.3 | 2 +- libselinux/man/man3/is_context_customizable.3 | 2 +- libselinux/man/man3/selinux_raw_context_to_color.3 | 2 +- 7 files changed, 10 insertions(+), 10 deletions(-) diff --git a/libselinux/man/man3/avc_context_to_sid.3 b/libselinux/man/man3/avc_context_to_sid.3 index 5532d6c5..4586b999 100644 --- a/libselinux/man/man3/avc_context_to_sid.3 +++ b/libselinux/man/man3/avc_context_to_sid.3 @@ -10,7 +10,7 @@ avc_context_to_sid, avc_sid_to_context, avc_get_initial_sid \- obtain and manipu .br .B #include .sp -.BI "int avc_context_to_sid(char *" ctx ", security_id_t *" sid ");" +.BI "int avc_context_to_sid(const char *" ctx ", security_id_t *" sid ");" .sp .BI "int avc_sid_to_context(security_id_t " sid ", char **" ctx ");" .sp diff --git a/libselinux/man/man3/getfscreatecon.3 b/libselinux/man/man3/getfscreatecon.3 index c6faadc1..47ec30f4 100644 --- a/libselinux/man/man3/getfscreatecon.3 +++ b/libselinux/man/man3/getfscreatecon.3 @@ -9,9 +9,9 @@ getfscreatecon, setfscreatecon \- get or set the SELinux security context used f .sp .BI "int getfscreatecon_raw(char **" con ); .sp -.BI "int setfscreatecon(char *" context ); +.BI "int setfscreatecon(const char *" context ); .sp -.BI "int setfscreatecon_raw(char *" context ); +.BI "int setfscreatecon_raw(const char *" context ); . .SH "DESCRIPTION" .BR getfscreatecon () diff --git a/libselinux/man/man3/getkeycreatecon.3 b/libselinux/man/man3/getkeycreatecon.3 index 7887b9b8..0ef27be7 100644 --- a/libselinux/man/man3/getkeycreatecon.3 +++ b/libselinux/man/man3/getkeycreatecon.3 @@ -9,9 +9,9 @@ getkeycreatecon, setkeycreatecon \- get or set the SELinux security context used .sp .BI "int getkeycreatecon_raw(char **" con ); .sp -.BI "int setkeycreatecon(char *" context ); +.BI "int setkeycreatecon(const char *" context ); .sp -.BI "int setkeycreatecon_raw(char *" context ); +.BI "int setkeycreatecon_raw(const char *" context ); . .SH "DESCRIPTION" .BR getkeycreatecon () diff --git a/libselinux/man/man3/getsockcreatecon.3 b/libselinux/man/man3/getsockcreatecon.3 index 9223f60f..9795fb65 100644 --- a/libselinux/man/man3/getsockcreatecon.3 +++ b/libselinux/man/man3/getsockcreatecon.3 @@ -9,9 +9,9 @@ getsockcreatecon, setsockcreatecon \- get or set the SELinux security context us .sp .BI "int getsockcreatecon_raw(char **" con ); .sp -.BI "int setsockcreatecon(char *" context ); +.BI "int setsockcreatecon(const char *" context ); .sp -.BI "int setsockcreatecon_raw(char *" context ); +.BI "int setsockcreatecon_raw(const char *" context ); . .SH "DESCRIPTION" .BR getsockcreatecon () diff --git a/libselinux/man/man3/init_selinuxmnt.3 b/libselinux/man/man3/init_selinuxmnt.3 index 8466f9ff..6c83698a 100644 --- a/libselinux/man/man3/init_selinuxmnt.3 +++ b/libselinux/man/man3/init_selinuxmnt.3 @@ -7,7 +7,7 @@ init_selinuxmnt \- initialize the global variable selinux_mnt .sp .BI "static void fini_selinuxmnt(void);" .sp -.BI "void set_selinuxmnt(char *" mnt ");" +.BI "void set_selinuxmnt(const char *" mnt ");" . .SH "DESCRIPTION" .BR init_selinuxmnt () diff --git a/libselinux/man/man3/is_context_customizable.3 b/libselinux/man/man3/is_context_customizable.3 index c858a026..ca332dc4 100644 --- a/libselinux/man/man3/is_context_customizable.3 +++ b/libselinux/man/man3/is_context_customizable.3 @@ -5,7 +5,7 @@ is_context_customizable \- check whether SELinux context type is customizable by .SH "SYNOPSIS" .B #include .sp -.BI "int is_context_customizable(char *" scon ); +.BI "int is_context_customizable(const char *" scon ); . .SH "DESCRIPTION" This function checks whether the type of scon is in the diff --git a/libselinux/man/man3/selinux_raw_context_to_color.3 b/libselinux/man/man3/selinux_raw_context_to_color.3 index cfd564df..fb657f81 100644 --- a/libselinux/man/man3/selinux_raw_context_to_color.3 +++ b/libselinux/man/man3/selinux_raw_context_to_color.3 @@ -5,7 +5,7 @@ selinux_raw_context_to_color \- Return RGB color string for an SELinux security .SH "SYNOPSIS" .B #include .sp -.BI "int selinux_raw_context_to_color(char *" raw ", " +.BI "int selinux_raw_context_to_color(const char *" raw ", " .RS .BI "char **" color_str ");" .RE From patchwork Mon Apr 29 16:31:19 2024 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: 13647358 X-Patchwork-Delegate: plautrba@redhat.com Received: from server02.seltendoof.de (server02.seltendoof.de [168.119.48.163]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id E49553201 for ; Mon, 29 Apr 2024 16:31:34 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=168.119.48.163 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1714408298; cv=none; b=eojdANKIIMK2Kv7nLF4B8718f56ak2/5tUiam2In0ycHk+8nsStHAtpNgDx6422Qw2FTjZKehsfyLo3VHaRDloLr7lgUm9OJs8slhHLrny9+Ij1xXHDX77X5ctHLpAxu6MFba42HEqSdQhcJg7Zup4PT3MY+tISkHgIQn5qNZ54= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1714408298; c=relaxed/simple; bh=6499/ii48CkgrX12Lso9/KXHRZldY0iwa1WYK6BJNQM=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=otb9PlGVcUSFYs6CGUli1HoS6OUnCawbDbKDTXScqnChRUoNHCRYzt8k1o4bV+EgeTvZo2rVDT+DEZEdPglqqua9Y/YG9nsXdkKp/yxa/3lcmDhtEdZQ5Fbt7HXKsUlcTskS7bpCtpNA4z9Pt6MmrUV+22D/yfbSI0to+9yLV1E= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=seltendoof.de; spf=pass smtp.mailfrom=seltendoof.de; dkim=pass (2048-bit key) header.d=seltendoof.de header.i=@seltendoof.de header.b=eUSDgOAQ; arc=none smtp.client-ip=168.119.48.163 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=seltendoof.de Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=seltendoof.de Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=seltendoof.de header.i=@seltendoof.de header.b="eUSDgOAQ" From: =?utf-8?q?Christian_G=C3=B6ttsche?= DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=seltendoof.de; s=2023072701; t=1714408287; h=from:from:reply-to:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=Me4XeS2tn2r9weOFR6wllI1UqSR+ZZRRYcoLWWLAI9o=; b=eUSDgOAQwiRT1tId949KniZplYYbxliFCWMXiZYhiqNeZcZnHflLwaSruQ1jNd0LPmeVHA 9NDW0DsnIlmN/AAHmOM/DE85Ihy+PRaE4J1pC8W5APx/buu0+rsX6HE8bFzBOMnsZ3h6ig VtbyrooCs6eeDdaS1JtEyUSqB9M4xOTJ6WrbWTegZO70EHJMCNbIYn8jEIZgQdPsk3yhz6 ymXzX74o/LlfTuNlHpW92RH3BRHyo/glo/Ea4Tm2LswzJGALGOa4ZmFGnjemHWFnVl3rpz ywA99jphBk5C7Szj2D73qLlL9ztM7+lqNkLxW0G/8WVNgjWEGBKuMq+ZhgYuwg== To: selinux@vger.kernel.org Cc: =?utf-8?q?Christian_G=C3=B6ttsche?= Subject: [PATCH 3/5] libselinux/man: use void in synopses Date: Mon, 29 Apr 2024 18:31:19 +0200 Message-ID: <20240429163122.63181-3-cgoettsche@seltendoof.de> In-Reply-To: <20240429163122.63181-1-cgoettsche@seltendoof.de> References: <20240429163122.63181-1-cgoettsche@seltendoof.de> Reply-To: cgzones@googlemail.com Precedence: bulk X-Mailing-List: selinux@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 From: Christian Göttsche For functions that do not take any argument use consistently void instead of empty parenthesis. Signed-off-by: Christian Göttsche --- libselinux/man/man3/is_selinux_enabled.3 | 4 ++-- libselinux/man/man3/security_policyvers.3 | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/libselinux/man/man3/is_selinux_enabled.3 b/libselinux/man/man3/is_selinux_enabled.3 index a887b48c..16b7cd3c 100644 --- a/libselinux/man/man3/is_selinux_enabled.3 +++ b/libselinux/man/man3/is_selinux_enabled.3 @@ -8,9 +8,9 @@ is_selinux_mls_enabled \- check whether SELinux is enabled for (Multi Level Secu .SH "SYNOPSIS" .B #include .sp -.B int is_selinux_enabled(); +.B int is_selinux_enabled(void); .sp -.B int is_selinux_mls_enabled(); +.B int is_selinux_mls_enabled(void); . .SH "DESCRIPTION" .BR is_selinux_enabled () diff --git a/libselinux/man/man3/security_policyvers.3 b/libselinux/man/man3/security_policyvers.3 index 041ff3a7..b2f6185b 100644 --- a/libselinux/man/man3/security_policyvers.3 +++ b/libselinux/man/man3/security_policyvers.3 @@ -4,7 +4,7 @@ security_policyvers \- get the version of the SELinux policy .SH "SYNOPSIS" .B #include .sp -.B int security_policyvers(); +.B int security_policyvers(void); . .SH "DESCRIPTION" .BR security_policyvers () From patchwork Mon Apr 29 16:31:20 2024 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: 13647359 X-Patchwork-Delegate: plautrba@redhat.com Received: from server02.seltendoof.de (server02.seltendoof.de [168.119.48.163]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 8710184D0B for ; Mon, 29 Apr 2024 16:31:35 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=168.119.48.163 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1714408298; cv=none; b=tqpnrmp9wnSeXqwIPrwEoIEmes9wSP9irCiRD5vutqx+YKqtUtObkMIqXllSYFRS+a37Io6qGV0boJEkGCviRqnFGkcflRwNjrWlSaDvfpdzXvBiYEJvCm/3Y2UkxxdWqP6iZUFf/tlAKpR1ipFc3MBqY2jxbTx2c2JfBjI872Q= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1714408298; c=relaxed/simple; bh=2Ksz3HFsz8lv9fCcQGfjGu2bxdrckywQ2xdnE4tFWuw=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=Wq/+WdUD9j8aEMT92HkwTpXHwRaxOgvClRqhpoFC5r+rwarW8+fu69tXiof5KnSZhiQR0n3s1x3vgCkv8TgRC09uKd7xBPfDvEvORE4xJfvhk0cJpulMWY8HwKfyX/QWfXplE1oNyMSL4VvCtj8todzTP4aDi++AvEuGOqtlt1Y= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=seltendoof.de; spf=pass smtp.mailfrom=seltendoof.de; dkim=pass (2048-bit key) header.d=seltendoof.de header.i=@seltendoof.de header.b=nOA4GVMx; arc=none smtp.client-ip=168.119.48.163 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=seltendoof.de Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=seltendoof.de Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=seltendoof.de header.i=@seltendoof.de header.b="nOA4GVMx" From: =?utf-8?q?Christian_G=C3=B6ttsche?= DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=seltendoof.de; s=2023072701; t=1714408287; h=from:from:reply-to:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=hacdkDRiPTOZCSK+irBshyhb+T7/7yQsg34/4JXp39c=; b=nOA4GVMx85aX8T7vVjHavfqXXRlOi587IZ80vfu17konbGxcOH+rLqScW7/unWxt9mvfY5 JARW+p6vm+XE3VkAByKIARIUc+UhnNciWuXRWj/02fwaBSCTKFJLxT+S7Iv/JevUJJ3+mI /eA/18qOXxB/1EuQJhgl3DzbjzdQLDD/HNUIRoJtz1catT0ZJQgei+KANBtCre2Wrh0n33 Y/Lh9IShEs624QfM8KLbm9H+0qz3RWGGdN/xyFbl7/8Tn8NlFczhAFsRnqW88VJyUCltCZ S1C7vTc38t3oNRCGEuCgqLjA/Y8M01M7VLyyVb99asByLrGrzNldy2RDfOFY/A== To: selinux@vger.kernel.org Cc: =?utf-8?q?Christian_G=C3=B6ttsche?= Subject: [PATCH 4/5] libselinux/man: add format attribute for set_matchpathcon_printf(3) Date: Mon, 29 Apr 2024 18:31:20 +0200 Message-ID: <20240429163122.63181-4-cgoettsche@seltendoof.de> In-Reply-To: <20240429163122.63181-1-cgoettsche@seltendoof.de> References: <20240429163122.63181-1-cgoettsche@seltendoof.de> Reply-To: cgzones@googlemail.com Precedence: bulk X-Mailing-List: selinux@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 From: Christian Göttsche The parameter for set_matchpathcon_printf(3) is a function pointer that takes a format string with variable arguments. Add a GNU printf function attribute, if supported, to enable compilers checking for format string inconsistencies. Signed-off-by: Christian Göttsche --- libselinux/include/selinux/selinux.h | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/libselinux/include/selinux/selinux.h b/libselinux/include/selinux/selinux.h index a0948853..83ea871c 100644 --- a/libselinux/include/selinux/selinux.h +++ b/libselinux/include/selinux/selinux.h @@ -443,7 +443,11 @@ extern void selinux_flush_class_cache(void); /* Set the function used by matchpathcon_init when displaying errors about the file_contexts configuration. If not set, then this defaults to fprintf(stderr, fmt, ...). */ -extern void set_matchpathcon_printf(void (*f) (const char *fmt, ...)); +extern void set_matchpathcon_printf(void +#ifdef __GNUC__ + __attribute__ ((format(printf, 1, 2))) +#endif + (*f) (const char *fmt, ...)); /* Set the function used by matchpathcon_init when checking the validity of a context in the file contexts configuration. If not set, From patchwork Mon Apr 29 16:31:21 2024 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: 13647361 X-Patchwork-Delegate: plautrba@redhat.com Received: from server02.seltendoof.de (server02.seltendoof.de [168.119.48.163]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 870CA548EC for ; Mon, 29 Apr 2024 16:31:35 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=168.119.48.163 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1714408299; cv=none; b=uVLCii98vWyxn7D2U6nWMn9ogKtvUrBXh/oagAy/OSDQhHJhRvNll9IlWljFfkpeEfSXKf9vkZFHfo+mfpUjMSnEG2oR6Cgoj1eWYIzLnhqeGS0YyK9oSI25EpBXLyejIkpRZLetAUbNd+b/RH1nAu9FdVwHlSk03HB8cyVGgLg= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1714408299; c=relaxed/simple; bh=W+cSSzuBYlc8eO5ZzVm/xIkknQqC3v81HqO4SqkIQyo=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=CmWZVo2qQSFnFDeeer7x4Xg2YhESD/oi780V64yWYvVVNjHftWv/oKHMli9m89bJnQnM0tvrAkTKIigXMCM8Nl6mOBsW4tajmmEZHzfQE2sQZR0jydp13GMhS0kbogiB9Xe7xnRgU7biriKN+wdd+WtcRgrq5c4uxn8JnKW5L+I= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=seltendoof.de; spf=pass smtp.mailfrom=seltendoof.de; dkim=pass (2048-bit key) header.d=seltendoof.de header.i=@seltendoof.de header.b=N7bgGvm+; arc=none smtp.client-ip=168.119.48.163 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=seltendoof.de Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=seltendoof.de Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=seltendoof.de header.i=@seltendoof.de header.b="N7bgGvm+" From: =?utf-8?q?Christian_G=C3=B6ttsche?= DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=seltendoof.de; s=2023072701; t=1714408287; h=from:from:reply-to:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=yEx8KhJiTbJDB7GlODof8TZc2nBqt4YunESv2bgsXRw=; b=N7bgGvm+nJCaJJJWZUq/W2fg3bt9xCrGyZt+C/DyLl8KTLTfS68IsnOoRXeJG7/owsrqj3 Oss2NVjWR/Lmvqkomm+JcQskPP3dzwWF7tpgdqA8GYzqMjmdXaMPjUb6Cc7uIJkvM11WYb wSxy8d34xlZ3TEzV0zdSc3kT8mkcJuN0ZMHs9YlpgcHNA3ZL1wCTUxoBpK26dtS2zPhlDp e+x7KcIkVXyQT2FEeThYCFbUkcE0nj7byAnJ/UV3uPj1WPawhyv/yDy1NCHVPc/U3r7bwg lj19FnvsNOfsPPlXRwrtKauuYvO8k21sRxmzwToF5zejgFX1aWJO6E+xuUfwKg== To: selinux@vger.kernel.org Cc: =?utf-8?q?Christian_G=C3=B6ttsche?= Subject: [PATCH 5/5] libselinux: constify selinux_set_mapping(3) parameter Date: Mon, 29 Apr 2024 18:31:21 +0200 Message-ID: <20240429163122.63181-5-cgoettsche@seltendoof.de> In-Reply-To: <20240429163122.63181-1-cgoettsche@seltendoof.de> References: <20240429163122.63181-1-cgoettsche@seltendoof.de> Reply-To: cgzones@googlemail.com Precedence: bulk X-Mailing-List: selinux@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 From: Christian Göttsche The map parameter of selinux_set_mapping(3) is only read from and not modified, thus declare it const. Signed-off-by: Christian Göttsche --- libselinux/include/selinux/selinux.h | 2 +- libselinux/man/man3/selinux_set_mapping.3 | 2 +- libselinux/src/mapping.c | 4 ++-- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/libselinux/include/selinux/selinux.h b/libselinux/include/selinux/selinux.h index 83ea871c..61c1422b 100644 --- a/libselinux/include/selinux/selinux.h +++ b/libselinux/include/selinux/selinux.h @@ -413,7 +413,7 @@ struct security_class_mapping { * starting at 1, and have one security_class_mapping structure entry * per define. */ -extern int selinux_set_mapping(struct security_class_mapping *map); +extern int selinux_set_mapping(const struct security_class_mapping *map); /* Common helpers */ diff --git a/libselinux/man/man3/selinux_set_mapping.3 b/libselinux/man/man3/selinux_set_mapping.3 index a1f82e5a..bb48eb43 100644 --- a/libselinux/man/man3/selinux_set_mapping.3 +++ b/libselinux/man/man3/selinux_set_mapping.3 @@ -15,7 +15,7 @@ struct security_class_mapping { }; .fi .sp -.BI "int selinux_set_mapping(struct security_class_mapping *" map ");" +.BI "int selinux_set_mapping(const struct security_class_mapping *" map ");" . .SH "DESCRIPTION" .BR selinux_set_mapping () diff --git a/libselinux/src/mapping.c b/libselinux/src/mapping.c index dd2f1039..d863e449 100644 --- a/libselinux/src/mapping.c +++ b/libselinux/src/mapping.c @@ -31,7 +31,7 @@ static security_class_t current_mapping_size = 0; */ int -selinux_set_mapping(struct security_class_mapping *map) +selinux_set_mapping(const struct security_class_mapping *map) { size_t size = sizeof(struct selinux_mapping); security_class_t i, j; @@ -64,7 +64,7 @@ selinux_set_mapping(struct security_class_mapping *map) /* Store the raw class and permission values */ j = 0; while (map[j].name) { - struct security_class_mapping *p_in = map + (j++); + const struct security_class_mapping *p_in = map + (j++); struct selinux_mapping *p_out = current_mapping + j; p_out->value = string_to_security_class(p_in->name);