From: James Carter <jwcart2@gmail.com>
To: "Christian Göttsche" <cgzones@googlemail.com>
Cc: selinux@vger.kernel.org
Subject: Re: [PATCH] libsepol: update policy capabilities array
Date: Thu, 16 Nov 2023 09:57:44 -0500 [thread overview]
Message-ID: <CAP+JOzQemCPAqDTzSEwMJJ3XiKD7zgUct-zdx5GiYY-wUPC0Wg@mail.gmail.com> (raw)
In-Reply-To: <CAP+JOzQOz0cw7qe45K5kFB1UXCwpKRwDUwPQYyU=ceYQK1K9Jg@mail.gmail.com>
On Tue, Nov 14, 2023 at 3:41 PM James Carter <jwcart2@gmail.com> wrote:
>
> On Thu, Nov 9, 2023 at 8:54 AM Christian Göttsche
> <cgzones@googlemail.com> wrote:
> >
> > Use their enum values as indices to clarify their relationships.
> > Specify array size to verify it at compile time.
> > Remove unnecessary trailing entry, since all access is controlled by a
> > check against POLICYDB_CAP_MAX.
> >
> > Signed-off-by: Christian Göttsche <cgzones@googlemail.com>
>
> Acked-by: James Carter <jwcart2@gmail.com>
>
This patch has been merged.
Thanks,
Jim
> > ---
> > libsepol/src/polcaps.c | 21 ++++++++++-----------
> > 1 file changed, 10 insertions(+), 11 deletions(-)
> >
> > diff --git a/libsepol/src/polcaps.c b/libsepol/src/polcaps.c
> > index be12580a..8289443a 100644
> > --- a/libsepol/src/polcaps.c
> > +++ b/libsepol/src/polcaps.c
> > @@ -5,17 +5,16 @@
> > #include <string.h>
> > #include <sepol/policydb/polcaps.h>
> >
> > -static const char * const polcap_names[] = {
> > - "network_peer_controls", /* POLICYDB_CAP_NETPEER */
> > - "open_perms", /* POLICYDB_CAP_OPENPERM */
> > - "extended_socket_class", /* POLICYDB_CAP_EXTSOCKCLASS */
> > - "always_check_network", /* POLICYDB_CAP_ALWAYSNETWORK */
> > - "cgroup_seclabel", /* POLICYDB_CAP_SECLABEL */
> > - "nnp_nosuid_transition", /* POLICYDB_CAP_NNP_NOSUID_TRANSITION */
> > - "genfs_seclabel_symlinks", /* POLICYDB_CAP_GENFS_SECLABEL_SYMLINKS */
> > - "ioctl_skip_cloexec", /* POLICYDB_CAP_IOCTL_SKIP_CLOEXEC */
> > - "userspace_initial_context", /* POLICYDB_CAP_USERSPACE_INITIAL_CONTEXT */
> > - NULL
> > +static const char * const polcap_names[POLICYDB_CAP_MAX + 1] = {
> > + [POLICYDB_CAP_NETPEER] = "network_peer_controls",
> > + [POLICYDB_CAP_OPENPERM] = "open_perms",
> > + [POLICYDB_CAP_EXTSOCKCLASS] = "extended_socket_class",
> > + [POLICYDB_CAP_ALWAYSNETWORK] = "always_check_network",
> > + [POLICYDB_CAP_CGROUPSECLABEL] = "cgroup_seclabel",
> > + [POLICYDB_CAP_NNP_NOSUID_TRANSITION] = "nnp_nosuid_transition",
> > + [POLICYDB_CAP_GENFS_SECLABEL_SYMLINKS] = "genfs_seclabel_symlinks",
> > + [POLICYDB_CAP_IOCTL_SKIP_CLOEXEC] = "ioctl_skip_cloexec",
> > + [POLICYDB_CAP_USERSPACE_INITIAL_CONTEXT] = "userspace_initial_context",
> > };
> >
> > int sepol_polcap_getnum(const char *name)
> > --
> > 2.42.0
> >
prev parent reply other threads:[~2023-11-16 14:58 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-11-09 13:54 [PATCH] libsepol: update policy capabilities array Christian Göttsche
2023-11-14 20:41 ` James Carter
2023-11-16 14:57 ` James Carter [this message]
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=CAP+JOzQemCPAqDTzSEwMJJ3XiKD7zgUct-zdx5GiYY-wUPC0Wg@mail.gmail.com \
--to=jwcart2@gmail.com \
--cc=cgzones@googlemail.com \
--cc=selinux@vger.kernel.org \
/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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).