From: "Thiébaud Weksteen" <tweek@google.com>
To: selinux@vger.kernel.org
Cc: "Thiébaud Weksteen" <tweek@google.com>
Subject: [PATCH] libselinux: warn on identical duplicate properties
Date: Thu, 13 Feb 2025 13:22:05 +1100 [thread overview]
Message-ID: <20250213022205.972878-1-tweek@google.com> (raw)
Instead of raising an error in case of matching duplicates, only report
the issue as a warning. This matches the downstream (AOSP) behaviour for
Android.
Signed-off-by: Thiébaud Weksteen <tweek@google.com>
---
libselinux/src/label_backends_android.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/libselinux/src/label_backends_android.c b/libselinux/src/label_backends_android.c
index cbe932ae..cf4f5cbf 100644
--- a/libselinux/src/label_backends_android.c
+++ b/libselinux/src/label_backends_android.c
@@ -58,10 +58,10 @@ static int nodups_specs(struct saved_data *data, const char *path)
for (jj = ii + 1; jj < data->nspec; jj++) {
if (!strcmp(spec_arr[jj].property_key,
curr_spec->property_key)) {
- rc = -1;
- errno = EINVAL;
if (strcmp(spec_arr[jj].lr.ctx_raw,
curr_spec->lr.ctx_raw)) {
+ rc = -1;
+ errno = EINVAL;
selinux_log
(SELINUX_ERROR,
"%s: Multiple different specifications for %s (%s and %s).\n",
@@ -70,7 +70,7 @@ static int nodups_specs(struct saved_data *data, const char *path)
curr_spec->lr.ctx_raw);
} else {
selinux_log
- (SELINUX_ERROR,
+ (SELINUX_WARNING,
"%s: Multiple same specifications for %s.\n",
path, curr_spec->property_key);
}
--
2.48.1.502.g6dc24dfdaf-goog
next reply other threads:[~2025-02-13 2:22 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-02-13 2:22 Thiébaud Weksteen [this message]
2025-03-07 19:10 ` [PATCH] libselinux: warn on identical duplicate properties James Carter
2025-04-07 18:05 ` James Carter
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=20250213022205.972878-1-tweek@google.com \
--to=tweek@google.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 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.