Message ID | 20230618234510.118204-1-luhuaxin1@huawei.com (mailing list archive) |
---|---|
State | Rejected |
Delegated to: | Petr Lautrbach |
Headers | show |
Series | libselinux: fix inconsistent indentation in selinux_check_access | expand |
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
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)
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> --- libselinux/src/checkAccess.c | 42 ++++++++++++++++++------------------ 1 file changed, 21 insertions(+), 21 deletions(-)