diff --git a/WHATS_NEW_DM b/WHATS_NEW_DM index 8d4b02610..1deb7fec8 100644 --- a/WHATS_NEW_DM +++ b/WHATS_NEW_DM @@ -1,5 +1,6 @@ Version 1.02.60 - =================================== + Change dm_regex_create() API to accept const char * const *patterns. Add new dm_prepare_selinux_context fn to libdevmapper and use it throughout. Detect existence of new SELinux selabel interface during configure. diff --git a/lib/device/dev-cache.c b/lib/device/dev-cache.c index e4d0a76bb..962aa1e00 100644 --- a/lib/device/dev-cache.c +++ b/lib/device/dev-cache.c @@ -543,7 +543,7 @@ static int _init_preferred_names(struct cmd_context *cmd) const struct config_node *cn; const struct config_value *v; struct dm_pool *scratch = NULL; - char **regex; + const char **regex; unsigned count = 0; int i, r = 0; @@ -583,7 +583,7 @@ static int _init_preferred_names(struct cmd_context *cmd) } if (!(_cache.preferred_names_matcher = - dm_regex_create(_cache.mem,(const char **) regex, count))) { + dm_regex_create(_cache.mem, regex, count))) { log_error("Preferred device name pattern matcher creation failed."); goto out; } diff --git a/libdm/libdevmapper.h b/libdm/libdevmapper.h index 3083f9a19..d3850303b 100644 --- a/libdm/libdevmapper.h +++ b/libdm/libdevmapper.h @@ -1020,7 +1020,7 @@ struct dm_regex; * Initialise an array of num patterns for matching. * Uses memory from mem. */ -struct dm_regex *dm_regex_create(struct dm_pool *mem, const char **patterns, +struct dm_regex *dm_regex_create(struct dm_pool *mem, const char * const *patterns, unsigned num_patterns); /* diff --git a/libdm/regex/matcher.c b/libdm/regex/matcher.c index eb20bd093..959086586 100644 --- a/libdm/regex/matcher.c +++ b/libdm/regex/matcher.c @@ -310,7 +310,7 @@ static void _force_states(struct dm_regex *m) } } -struct dm_regex *dm_regex_create(struct dm_pool *mem, const char **patterns, +struct dm_regex *dm_regex_create(struct dm_pool *mem, const char * const *patterns, unsigned num_patterns) { char *all, *ptr;