Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Stop supporting libini older than 1.3 #6923

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion contrib/sssd.spec.in
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
47 changes: 5 additions & 42 deletions src/external/libini_config.m4
Original file line number Diff line number Diff line change
@@ -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])
]
)

Expand Down
10 changes: 0 additions & 10 deletions src/external/samba.m4
Original file line number Diff line number Diff line change
Expand Up @@ -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]
Expand Down
3 changes: 1 addition & 2 deletions src/man/sssd.conf.5.xml
Original file line number Diff line number Diff line change
Expand Up @@ -70,8 +70,7 @@
<para>
The configuration file <filename>sssd.conf</filename> will
include configuration snippets using the include directory
<filename>conf.d</filename>. This feature is available if
SSSD was compiled with libini version 1.3.0 or later.
<filename>conf.d</filename>.
</para>

<para>
Expand Down
12 changes: 0 additions & 12 deletions src/tests/cmocka/test_config_check.c
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down Expand Up @@ -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 */
2 changes: 0 additions & 2 deletions src/tools/sssctl/sssctl.c
Original file line number Diff line number Diff line change
Expand Up @@ -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),
Expand Down
3 changes: 0 additions & 3 deletions src/tools/sssctl/sssctl_config.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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 */
34 changes: 0 additions & 34 deletions src/util/sss_ini.c
Original file line number Diff line number Diff line change
Expand Up @@ -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 };
Expand Down Expand Up @@ -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 */
Expand Down Expand Up @@ -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)
Expand Down Expand Up @@ -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;

Expand Down Expand Up @@ -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,
Expand All @@ -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;
Expand Down Expand Up @@ -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,
Expand Down
Loading