libselinux: warn on identical duplicate properties
PATCH 1/1 libselinux: warn on identical duplicate properties
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 <[email protected]>
--- libselinux/src/label_backends_android.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-)
libselinux/src/label_backends_android.c +3 -3
@@ -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); }
Signature · 1 line
2.48.1.502.g6dc24dfdaf-goog
Quoted 6 lines · Thiébaud Weksteen
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 <[email protected]>
Acked-by James Carter <[email protected]>
Quoted 34 lines
--- libselinux/src/label_backends_android.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-)libselinux/src/label_backends_android.c +3
-4@@ -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
Quoted 11 lines · James Carter
Quoted 6 lines · Thiébaud Weksteen
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 <[email protected]>Acked-by James Carter <[email protected]>
Merged.
Thanks,
Jim
Quoted 34 lines
Quoted 34 lines
--- libselinux/src/label_backends_android.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-)libselinux/src/label_backends_android.c +3
-4@@ -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