From 18de8f7fe9f574d420a3d61b40da8353ad15ad92 Mon Sep 17 00:00:00 2001 From: Alexey Tikhonov Date: Tue, 12 Sep 2023 15:10:00 +0200 Subject: [PATCH] Stop supporting libini older than 1.3 1.3 it out since 2016 :relnote: SSSD now requires libini not older than v1.3 --- contrib/sssd.spec.in | 2 +- src/external/libini_config.m4 | 47 +++------------------------- src/external/samba.m4 | 10 ------ src/man/sssd.conf.5.xml | 3 +- src/tests/cmocka/test_config_check.c | 12 ------- src/tools/sssctl/sssctl.c | 2 -- src/tools/sssctl/sssctl_config.c | 3 -- src/util/sss_ini.c | 34 -------------------- 8 files changed, 7 insertions(+), 106 deletions(-) diff --git a/contrib/sssd.spec.in b/contrib/sssd.spec.in index 6431fc9d79b..65453a6d62e 100644 --- a/contrib/sssd.spec.in +++ b/contrib/sssd.spec.in @@ -113,7 +113,7 @@ BuildRequires: libdhash-devel >= 0.4.2 %if %{build_passkey} BuildRequires: libfido2-devel %endif -BuildRequires: libini_config-devel >= 1.1 +BuildRequires: libini_config-devel >= 1.3 BuildRequires: libldb-devel >= %{ldb_version} BuildRequires: libnfsidmap-devel BuildRequires: libnl3-devel diff --git a/src/external/libini_config.m4 b/src/external/libini_config.m4 index a2bba4243b8..0ac1ff9e284 100644 --- a/src/external/libini_config.m4 +++ b/src/external/libini_config.m4 @@ -1,46 +1,9 @@ -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" ], [ - 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/man/sssd.conf.5.xml b/src/man/sssd.conf.5.xml index abae470e1f4..23a641254b4 100644 --- a/src/man/sssd.conf.5.xml +++ b/src/man/sssd.conf.5.xml @@ -70,8 +70,7 @@ The configuration file sssd.conf will include configuration snippets using the include directory - conf.d. This feature is available if - SSSD was compiled with libini version 1.3.0 or later. + conf.d. diff --git a/src/tests/cmocka/test_config_check.c b/src/tests/cmocka/test_config_check.c index 2de05f8909f..988ccfc16b0 100644 --- a/src/tests/cmocka/test_config_check.c +++ b/src/tests/cmocka/test_config_check.c @@ -27,8 +27,6 @@ #include "util/sss_ini.h" #include "tests/cmocka/common_mock.h" -#ifdef HAVE_LIBINI_CONFIG_V1_3 - #define RULES_PATH ABS_SRC_DIR"/src/config/cfg_rules.ini" struct sss_ini { @@ -332,13 +330,3 @@ int main(int argc, const char *argv[]) tests_set_cwd(); return cmocka_run_group_tests(tests, NULL, NULL); } - -#else /* !HAVE_LIBINI_CONFIG_V1_3 */ - -int main(int argc, const char *argv[]) -{ - fprintf(stderr, "%s requires newer version of libini\n", argv[0]); - return 0; -} - -#endif /* HAVE_LIBINI_CONFIG_V1_3 */ diff --git a/src/tools/sssctl/sssctl.c b/src/tools/sssctl/sssctl.c index 04c41aa9af4..62dfce6b8d0 100644 --- a/src/tools/sssctl/sssctl.c +++ b/src/tools/sssctl/sssctl.c @@ -335,10 +335,8 @@ int main(int argc, const char **argv) SSS_TOOL_COMMAND("logs-fetch", "Archive SSSD log files in tarball", 0, sssctl_logs_fetch), SSS_TOOL_COMMAND("debug-level", "Change or print information about SSSD debug level", 0, sssctl_debug_level), SSS_TOOL_COMMAND_FLAGS("analyze", "Analyze logged data", 0, sssctl_analyze, SSS_TOOL_FLAG_SKIP_CMD_INIT|SSS_TOOL_FLAG_SKIP_ROOT_CHECK), -#ifdef HAVE_LIBINI_CONFIG_V1_3 SSS_TOOL_DELIMITER("Configuration files tools:"), SSS_TOOL_COMMAND_FLAGS("config-check", "Perform static analysis of SSSD configuration", 0, sssctl_config_check, SSS_TOOL_FLAG_SKIP_CMD_INIT), -#endif SSS_TOOL_DELIMITER("Certificate related tools:"), SSS_TOOL_COMMAND_FLAGS("cert-show", "Print information about the certificate", 0, sssctl_cert_show, SSS_TOOL_FLAG_SKIP_CMD_INIT|SSS_TOOL_FLAG_SKIP_ROOT_CHECK), SSS_TOOL_COMMAND("cert-map", "Show users mapped to the certificate", 0, sssctl_cert_map), diff --git a/src/tools/sssctl/sssctl_config.c b/src/tools/sssctl/sssctl_config.c index 6d9eb936d0c..4b32b1b3f44 100644 --- a/src/tools/sssctl/sssctl_config.c +++ b/src/tools/sssctl/sssctl_config.c @@ -33,8 +33,6 @@ -#ifdef HAVE_LIBINI_CONFIG_V1_3 - static char *sssctl_config_snippet_path(TALLOC_CTX *ctx, const char *path) { char *tmp = NULL; @@ -176,4 +174,3 @@ errno_t sssctl_config_check(struct sss_cmdline *cmdline, talloc_free(tmp_ctx); return ret; } -#endif /* HAVE_LIBINI_CONFIG_V1_3 */ 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,