From 0c2ec1654f5ddf58cb7698b3623e3a24c32bf8b9 Mon Sep 17 00:00:00 2001 From: Alexey Tikhonov Date: Tue, 12 Sep 2023 15:10:00 +0200 Subject: [PATCH] Stop supportning libini older than 1.3 1.3 it out since 2016 --- src/external/libini_config.m4 | 50 ++++++----------------------------- src/external/samba.m4 | 10 ------- src/util/sss_ini.c | 34 ------------------------ 3 files changed, 8 insertions(+), 86 deletions(-) diff --git a/src/external/libini_config.m4 b/src/external/libini_config.m4 index a2bba4243b8..b81d7f94a5d 100644 --- a/src/external/libini_config.m4 +++ b/src/external/libini_config.m4 @@ -1,46 +1,12 @@ -PKG_CHECK_MODULES(INI_CONFIG_V0, [ - ini_config >= 0.6.1], [ - - INI_CONFIG_CFLAGS="$INI_CONFIG_V0_CFLAGS" - INI_CONFIG_LIBS="$INI_CONFIG_V0_LIBS" - HAVE_LIBINI_CONFIG_V0=1 - AC_DEFINE_UNQUOTED(HAVE_LIBINI_CONFIG_V0, 1, [libini_config version 0.6.1 or greater]) - PKG_CHECK_MODULES(INI_CONFIG_V1, [ - ini_config >= 1.0.0], [ - - INI_CONFIG_CFLAGS="$INI_CONFIG_V1_CFLAGS" - INI_CONFIG_LIBS="$INI_CONFIG_V1_LIBS" - HAVE_LIBINI_CONFIG_V1=1 - AC_DEFINE_UNQUOTED(HAVE_LIBINI_CONFIG_V1, 1, [libini_config version 1.0.0 or greater]) - PKG_CHECK_MODULES(INI_CONFIG_V1_1, [ - ini_config >= 1.1.0], [ - - INI_CONFIG_CFLAGS="$INI_CONFIG_V1_1_CFLAGS" - INI_CONFIG_LIBS="$INI_CONFIG_V1_1_LIBS" - HAVE_LIBINI_CONFIG_V1_1=1 - AC_DEFINE_UNQUOTED(HAVE_LIBINI_CONFIG_V1_1, 1, [libini_config version 1.1.0 or greater]) - PKG_CHECK_MODULES(INI_CONFIG_V1_3, [ - ini_config >= 1.3.0], [ - - INI_CONFIG_CFLAGS="$INI_CONFIG_V1_3_CFLAGS" - INI_CONFIG_LIBS="$INI_CONFIG_V1_3_LIBS" - HAVE_LIBINI_CONFIG_V1_3=1 - AC_DEFINE_UNQUOTED(HAVE_LIBINI_CONFIG_V1_3, 1, - [libini_config version 1.3.0 or greater]) - ], [ - AC_MSG_WARN([libini_config-devel >= 1.3.0 not available, using older version]) - ] - ) - ], [ - AC_MSG_WARN([libini_config-devel >= 1.1.0 not available, using older version]) - ] - ) - ], [ - AC_MSG_WARN([libini_config-devel >= 1.0.0 not available, using older version]) - ] - ) +PKG_CHECK_MODULES(INI_CONFIG_V1_3, [ + ini_config >= 1.3.0], [ + INI_CONFIG_CFLAGS="$INI_CONFIG_V1_3_CFLAGS" + INI_CONFIG_LIBS="$INI_CONFIG_V1_3_LIBS" + HAVE_LIBINI_CONFIG_V1_3=1 + AC_DEFINE_UNQUOTED(HAVE_LIBINI_CONFIG_V1_3, 1, + [libini_config version 1.3.0 or greater]) ], [ - AC_MSG_ERROR([Please install libini_config-devel]) + AC_MSG_ERROR([Please install libini_config-devel version 1.3.0 or greater]) ] ) diff --git a/src/external/samba.m4 b/src/external/samba.m4 index 23e5291001b..49c6db8d221 100644 --- a/src/external/samba.m4 +++ b/src/external/samba.m4 @@ -38,16 +38,6 @@ without them. In this case, you will need to execute configure script with argument --without-samba ]])) - if test x"$HAVE_LIBINI_CONFIG_V1_1" != x1; then - AC_MSG_ERROR([[Please install libini_config development libraries -v1.1.0, or newer. libini_config libraries are necessary for building ipa -provider, as well as for building gpo-based access control in ad provider. If -you do not want to build these providers it is possible to build SSSD without -them. In this case, you will need to execute configure script with argument ---without-samba - ]]) - fi - AC_ARG_WITH([smb-idmap-interface-version], [AC_HELP_STRING([--with-smb-idmap-interface-version=[5|6]], [Idmap interface version of installed Samba] diff --git a/src/util/sss_ini.c b/src/util/sss_ini.c index 72dce50512d..f100ce233c7 100644 --- a/src/util/sss_ini.c +++ b/src/util/sss_ini.c @@ -277,7 +277,6 @@ static int sss_ini_parse(struct sss_ini *self) static int sss_ini_add_snippets(struct sss_ini *self, const char *config_dir) { -#ifdef HAVE_LIBINI_CONFIG_V1_3 int ret; const char *patterns[] = { "^[^\\.].*\\.conf$", NULL }; const char *sections[] = { ".*", NULL }; @@ -350,30 +349,18 @@ static int sss_ini_add_snippets(struct sss_ini *self, "Using only main configuration file due to errors in merging\n"); } return ret; - -#else /* HAVE_LIBINI_CONFIG_V1_3 */ - return EOK; -#endif /* ! HAVE_LIBINI_CONFIG_V1_3 */ } struct ref_array * sss_ini_get_ra_success_list(struct sss_ini *self) { -#ifdef HAVE_LIBINI_CONFIG_V1_3 return self->ra_success_list; -#else - return NULL; -#endif /* HAVE_LIBINI_CONFIG_V1_3 */ } struct ref_array * sss_ini_get_ra_error_list(struct sss_ini *self) { -#ifdef HAVE_LIBINI_CONFIG_V1_3 return self->ra_error_list; -#else - return NULL; -#endif /* HAVE_LIBINI_CONFIG_V1_3 */ } /* Get configuration object */ @@ -619,7 +606,6 @@ int sss_confdb_create_ldif(TALLOC_CTX *mem_ctx, return ret; } -#ifdef HAVE_LIBINI_CONFIG_V1_3 static errno_t check_domain_inherit_from(char *cfg_section, struct ini_cfgobj *config_obj, struct ini_errobj *errobj) @@ -785,12 +771,10 @@ static int sss_ini_call_validators_errobj(struct sss_ini *data, return ret; } -#endif /* HAVE_LIBINI_CONFIG_V1_3 */ int sss_ini_call_validators(struct sss_ini *data, const char *rules_path) { -#ifdef HAVE_LIBINI_CONFIG_V1_3 int ret; struct ini_errobj *errobj = NULL; @@ -821,11 +805,6 @@ int sss_ini_call_validators(struct sss_ini *data, done: ini_errobj_destroy(&errobj); return ret; -#else - DEBUG(SSSDBG_TRACE_FUNC, - "libini_config does not support configuration file validataion\n"); - return EOK; -#endif /* HAVE_LIBINI_CONFIG_V1_3 */ } int sss_ini_call_validators_strs(TALLOC_CTX *mem_ctx, @@ -834,7 +813,6 @@ int sss_ini_call_validators_strs(TALLOC_CTX *mem_ctx, char ***_errors, size_t *_num_errors) { -#ifdef HAVE_LIBINI_CONFIG_V1_3 TALLOC_CTX *tmp_ctx = NULL; struct ini_errobj *errobj = NULL; int ret; @@ -893,18 +871,6 @@ int sss_ini_call_validators_strs(TALLOC_CTX *mem_ctx, ini_errobj_destroy(&errobj); return ret; - -#else - DEBUG(SSSDBG_TRACE_FUNC, - "libini_config does not support configuration file validation\n"); - - if (_num_errors == NULL || _errors == NULL) { - return EINVAL; - } - - _num_errors = 0; - return EOK; -#endif /* HAVE_LIBINI_CONFIG_V1_3 */ } int sss_ini_open(struct sss_ini *self,