Re: [PATCH] libselinux: warn on identical duplicate properties

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Wed, Feb 12, 2025 at 9:22 PM Thiébaud Weksteen <tweek@xxxxxxxxxx> wrote:
>
> 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@xxxxxxxxxx>

Acked-by: James Carter <jwcart2@xxxxxxxxx>

> ---
>  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
>
>





[Index of Archives]     [Selinux Refpolicy]     [Linux SGX]     [Fedora Users]     [Fedora Desktop]     [Yosemite Photos]     [Yosemite Camping]     [Yosemite Campsites]     [KDE Users]     [Gnome Users]

  Powered by Linux