diff --git a/libselinux/include/selinux/selinux.h b/libselinux/include/selinux/selinux.h index 83ea871cc..61c1422b8 100644 --- a/libselinux/include/selinux/selinux.h +++ b/libselinux/include/selinux/selinux.h @@ -413,7 +413,7 @@ struct security_class_mapping { * starting at 1, and have one security_class_mapping structure entry * per define. */ -extern int selinux_set_mapping(struct security_class_mapping *map); +extern int selinux_set_mapping(const struct security_class_mapping *map); /* Common helpers */ diff --git a/libselinux/man/man3/selinux_set_mapping.3 b/libselinux/man/man3/selinux_set_mapping.3 index a1f82e5a6..bb48eb431 100644 --- a/libselinux/man/man3/selinux_set_mapping.3 +++ b/libselinux/man/man3/selinux_set_mapping.3 @@ -15,7 +15,7 @@ struct security_class_mapping { }; .fi .sp -.BI "int selinux_set_mapping(struct security_class_mapping *" map ");" +.BI "int selinux_set_mapping(const struct security_class_mapping *" map ");" . .SH "DESCRIPTION" .BR selinux_set_mapping () diff --git a/libselinux/src/mapping.c b/libselinux/src/mapping.c index dd2f10390..d863e4494 100644 --- a/libselinux/src/mapping.c +++ b/libselinux/src/mapping.c @@ -31,7 +31,7 @@ static security_class_t current_mapping_size = 0; */ int -selinux_set_mapping(struct security_class_mapping *map) +selinux_set_mapping(const struct security_class_mapping *map) { size_t size = sizeof(struct selinux_mapping); security_class_t i, j; @@ -64,7 +64,7 @@ selinux_set_mapping(struct security_class_mapping *map) /* Store the raw class and permission values */ j = 0; while (map[j].name) { - struct security_class_mapping *p_in = map + (j++); + const struct security_class_mapping *p_in = map + (j++); struct selinux_mapping *p_out = current_mapping + j; p_out->value = string_to_security_class(p_in->name);