From: Petr Lautrbach <plautrba@redhat.com>
To: Huaxin Lu <luhuaxin1@huawei.com>, selinux@vger.kernel.org
Cc: shenyining@huawei.com, fangxiuning@huawei.com, zhujianwei7@huawei.com
Subject: Re: [PATCH] libselinux: fix inconsistent indentation in selinux_check_access
Date: Tue, 27 Jun 2023 16:36:15 +0200 [thread overview]
Message-ID: <87v8f90y74.fsf@redhat.com> (raw)
In-Reply-To: <20230618234510.118204-1-luhuaxin1@huawei.com>
Huaxin Lu <luhuaxin1@huawei.com> writes:
> Function selinux_check_access mixes up the TABs and spaces. Fix it
> to keep the consistent coding style.
>
> Signed-off-by: Huaxin Lu <luhuaxin1@huawei.com>
Thanks, but I would rather avoid such "cosmetic" changes if they are not
connected to a functional change.
Petr
> ---
> libselinux/src/checkAccess.c | 42 ++++++++++++++++++------------------
> 1 file changed, 21 insertions(+), 21 deletions(-)
>
> diff --git a/libselinux/src/checkAccess.c b/libselinux/src/checkAccess.c
> index 022cd6b..7f0d68f 100644
> --- a/libselinux/src/checkAccess.c
> +++ b/libselinux/src/checkAccess.c
> @@ -41,27 +41,27 @@ int selinux_check_access(const char *scon, const char *tcon, const char *class,
>
> (void) selinux_status_updated();
>
> - sclass = string_to_security_class(class);
> - if (sclass == 0) {
> - rc = errno;
> - avc_log(SELINUX_ERROR, "Unknown class %s", class);
> - if (security_deny_unknown() == 0)
> - return 0;
> - errno = rc;
> - return -1;
> - }
> -
> - av = string_to_av_perm(sclass, perm);
> - if (av == 0) {
> - rc = errno;
> - avc_log(SELINUX_ERROR, "Unknown permission %s for class %s", perm, class);
> - if (security_deny_unknown() == 0)
> - return 0;
> - errno = rc;
> - return -1;
> - }
> -
> - return avc_has_perm (scon_id, tcon_id, sclass, av, NULL, aux);
> + sclass = string_to_security_class(class);
> + if (sclass == 0) {
> + rc = errno;
> + avc_log(SELINUX_ERROR, "Unknown class %s", class);
> + if (security_deny_unknown() == 0)
> + return 0;
> + errno = rc;
> + return -1;
> + }
> +
> + av = string_to_av_perm(sclass, perm);
> + if (av == 0) {
> + rc = errno;
> + avc_log(SELINUX_ERROR, "Unknown permission %s for class %s", perm, class);
> + if (security_deny_unknown() == 0)
> + return 0;
> + errno = rc;
> + return -1;
> + }
> +
> + return avc_has_perm (scon_id, tcon_id, sclass, av, NULL, aux);
> }
>
> static int selinux_check_passwd_access_internal(access_vector_t requested)
> --
> 2.33.0
prev parent reply other threads:[~2023-06-27 14:38 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-06-18 23:45 [PATCH] libselinux: fix inconsistent indentation in selinux_check_access Huaxin Lu
2023-06-27 14:36 ` Petr Lautrbach [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=87v8f90y74.fsf@redhat.com \
--to=plautrba@redhat.com \
--cc=fangxiuning@huawei.com \
--cc=luhuaxin1@huawei.com \
--cc=selinux@vger.kernel.org \
--cc=shenyining@huawei.com \
--cc=zhujianwei7@huawei.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox