All of lore.kernel.org
 help / color / mirror / Atom feed
From: Daniel Burgener <dburgener@linux.microsoft.com>
To: stable@vger.kernel.org
Cc: stephen.smalley.work@gmail.com, paul@paul-moore.com,
	selinux@vger.kernel.org, jmorris@namei.org, sashal@kernel.org
Subject: [PATCH v5.4 v2 3/4] selinux: Standardize string literal usage for selinuxfs directory names
Date: Fri, 16 Oct 2020 09:48:34 -0400	[thread overview]
Message-ID: <20201016134835.1886478-4-dburgener@linux.microsoft.com> (raw)
In-Reply-To: <20201016134835.1886478-1-dburgener@linux.microsoft.com>

upstream commit 613ba18798ac3cf257ecff65d490e8f1aa323588

Switch class and policy_capabilities directory names to be referred to with
global constants, consistent with booleans directory name.  This will allow
for easy consistency of naming in future development.

Signed-off-by: Daniel Burgener <dburgener@linux.microsoft.com>
---
 security/selinux/selinuxfs.c | 8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)

diff --git a/security/selinux/selinuxfs.c b/security/selinux/selinuxfs.c
index ea21f3ef4a6f..ae018aaa4391 100644
--- a/security/selinux/selinuxfs.c
+++ b/security/selinux/selinuxfs.c
@@ -117,6 +117,10 @@ static void selinux_fs_info_free(struct super_block *sb)
 #define SEL_POLICYCAP_INO_OFFSET	0x08000000
 #define SEL_INO_MASK			0x00ffffff
 
+#define BOOL_DIR_NAME "booleans"
+#define CLASS_DIR_NAME "class"
+#define POLICYCAP_DIR_NAME "policy_capabilities"
+
 #define TMPBUFLEN	12
 static ssize_t sel_read_enforce(struct file *filp, char __user *buf,
 				size_t count, loff_t *ppos)
@@ -2000,14 +2004,14 @@ static int sel_fill_super(struct super_block *sb, struct fs_context *fc)
 	if (ret)
 		goto err;
 
-	fsi->class_dir = sel_make_dir(sb->s_root, "class", &fsi->last_ino);
+	fsi->class_dir = sel_make_dir(sb->s_root, CLASS_DIR_NAME, &fsi->last_ino);
 	if (IS_ERR(fsi->class_dir)) {
 		ret = PTR_ERR(fsi->class_dir);
 		fsi->class_dir = NULL;
 		goto err;
 	}
 
-	fsi->policycap_dir = sel_make_dir(sb->s_root, "policy_capabilities",
+	fsi->policycap_dir = sel_make_dir(sb->s_root, POLICYCAP_DIR_NAME,
 					  &fsi->last_ino);
 	if (IS_ERR(fsi->policycap_dir)) {
 		ret = PTR_ERR(fsi->policycap_dir);
-- 
2.25.4


  parent reply	other threads:[~2020-10-16 13:48 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-10-16 13:48 [PATCH v5.4 v2 0/4] Update SELinuxfs out of tree and then swapover Daniel Burgener
2020-10-16 13:48 ` [PATCH v5.4 v2 1/4] selinux: Create function for selinuxfs directory cleanup Daniel Burgener
2020-10-16 13:48 ` [PATCH v5.4 v2 2/4] selinux: Refactor selinuxfs directory populating functions Daniel Burgener
2020-10-16 13:48 ` Daniel Burgener [this message]
2020-10-16 13:48 ` [PATCH v5.4 v2 4/4] selinux: Create new booleans and class dirs out of tree Daniel Burgener
2020-10-16 15:01 ` [PATCH v5.4 v2 0/4] Update SELinuxfs out of tree and then swapover Greg KH
2020-10-16 15:38   ` Sasha Levin
2020-10-16 15:44     ` Greg KH
2020-10-16 15:49       ` Sasha Levin
2020-10-16 16:01         ` Daniel Burgener
2020-10-16 22:56           ` Paul Moore

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20201016134835.1886478-4-dburgener@linux.microsoft.com \
    --to=dburgener@linux.microsoft.com \
    --cc=jmorris@namei.org \
    --cc=paul@paul-moore.com \
    --cc=sashal@kernel.org \
    --cc=selinux@vger.kernel.org \
    --cc=stable@vger.kernel.org \
    --cc=stephen.smalley.work@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.