Rebase on upstream commit 32611aea6543 See $ cd SELinuxProject/selinux $ git log --pretty=oneline libsepol-3.2..32611aea6543 -- libsepol
53 lines
1.8 KiB
Diff
53 lines
1.8 KiB
Diff
From 4fbc018a279a39160f17e257017b503194a7f44d Mon Sep 17 00:00:00 2001
|
|
From: =?UTF-8?q?Christian=20G=C3=B6ttsche?= <cgzones@googlemail.com>
|
|
Date: Tue, 8 Jun 2021 17:59:10 +0200
|
|
Subject: [PATCH] libsepol: drop unnecessary casts
|
|
MIME-Version: 1.0
|
|
Content-Type: text/plain; charset=UTF-8
|
|
Content-Transfer-Encoding: 8bit
|
|
|
|
`hashtab_search()` does take `const_hashtab_key_t` as second parameter,
|
|
which is a typedef for `const char *`.
|
|
Drop the unnecessary and const-violating cast.
|
|
|
|
Signed-off-by: Christian Göttsche <cgzones@googlemail.com>
|
|
Acked-by: James Carter <jwcart2@gmail.com>
|
|
---
|
|
libsepol/src/services.c | 6 +++---
|
|
1 file changed, 3 insertions(+), 3 deletions(-)
|
|
|
|
diff --git a/libsepol/src/services.c b/libsepol/src/services.c
|
|
index f7c31d80f954..47a3dc1419db 100644
|
|
--- a/libsepol/src/services.c
|
|
+++ b/libsepol/src/services.c
|
|
@@ -1182,7 +1182,7 @@ int sepol_string_to_security_class(const char *class_name,
|
|
class_datum_t *tclass_datum;
|
|
|
|
tclass_datum = hashtab_search(policydb->p_classes.table,
|
|
- (hashtab_key_t) class_name);
|
|
+ class_name);
|
|
if (!tclass_datum) {
|
|
ERR(NULL, "unrecognized class %s", class_name);
|
|
return STATUS_ERR;
|
|
@@ -1211,7 +1211,7 @@ int sepol_string_to_av_perm(sepol_security_class_t tclass,
|
|
/* Check for unique perms then the common ones (if any) */
|
|
perm_datum = (perm_datum_t *)
|
|
hashtab_search(tclass_datum->permissions.table,
|
|
- (hashtab_key_t)perm_name);
|
|
+ perm_name);
|
|
if (perm_datum != NULL) {
|
|
*av = 0x1 << (perm_datum->s.value - 1);
|
|
return STATUS_SUCCESS;
|
|
@@ -1222,7 +1222,7 @@ int sepol_string_to_av_perm(sepol_security_class_t tclass,
|
|
|
|
perm_datum = (perm_datum_t *)
|
|
hashtab_search(tclass_datum->comdatum->permissions.table,
|
|
- (hashtab_key_t)perm_name);
|
|
+ perm_name);
|
|
|
|
if (perm_datum != NULL) {
|
|
*av = 0x1 << (perm_datum->s.value - 1);
|
|
--
|
|
2.32.0
|
|
|