@@ -157,6 +157,13 @@ static int init(struct selabel_handle *rec, const struct selinux_opt *opts,
case SELABEL_OPT_PATH:
path = opts[n].value;
break;
+ case SELABEL_OPT_UNUSED:
+ case SELABEL_OPT_VALIDATE:
+ case SELABEL_OPT_DIGEST:
+ break;
+ default:
+ errno = EINVAL;
+ return -1;
}
if (!path)
@@ -268,6 +268,14 @@ db_init(const struct selinux_opt *opts, unsigned nopts,
case SELABEL_OPT_PATH:
path = opts[nopts].value;
break;
+ case SELABEL_OPT_UNUSED:
+ case SELABEL_OPT_VALIDATE:
+ case SELABEL_OPT_DIGEST:
+ break;
+ default:
+ free(catalog);
+ errno = EINVAL;
+ return NULL;
}
}
@@ -812,6 +812,13 @@ static int init(struct selabel_handle *rec, const struct selinux_opt *opts,
case SELABEL_OPT_BASEONLY:
baseonly = !!opts[n].value;
break;
+ case SELABEL_OPT_UNUSED:
+ case SELABEL_OPT_VALIDATE:
+ case SELABEL_OPT_DIGEST:
+ break;
+ default:
+ errno = EINVAL;
+ return -1;
}
#if !defined(BUILD_HOST) && !defined(ANDROID)
@@ -85,6 +85,13 @@ static int init(struct selabel_handle *rec, const struct selinux_opt *opts,
case SELABEL_OPT_PATH:
path = opts[n].value;
break;
+ case SELABEL_OPT_UNUSED:
+ case SELABEL_OPT_VALIDATE:
+ case SELABEL_OPT_DIGEST:
+ break;
+ default:
+ errno = EINVAL;
+ return -1;
}
/* Open the specification file. */
@@ -112,6 +112,13 @@ static int init(struct selabel_handle *rec, const struct selinux_opt *opts,
case SELABEL_OPT_PATH:
path = opts[n].value;
break;
+ case SELABEL_OPT_UNUSED:
+ case SELABEL_OPT_VALIDATE:
+ case SELABEL_OPT_DIGEST:
+ break;
+ default:
+ errno = EINVAL;
+ return -1;
}
/* Open the specification file. */
Return an error on invalid selabel_open(3) options, e.g. an option for a different backend was used. Signed-off-by: Christian Göttsche <cgzones@googlemail.com> --- libselinux/src/label_backends_android.c | 7 +++++++ libselinux/src/label_db.c | 8 ++++++++ libselinux/src/label_file.c | 7 +++++++ libselinux/src/label_media.c | 7 +++++++ libselinux/src/label_x.c | 7 +++++++ 5 files changed, 36 insertions(+)