Skip to content

Commit

Permalink
Stop supporting libini older than 1.3
Browse files Browse the repository at this point in the history
1.3 it out since 2016
  • Loading branch information
alexey-tikhonov committed Sep 12, 2023
1 parent e73efe1 commit 2552828
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 86 deletions.
50 changes: 8 additions & 42 deletions src/external/libini_config.m4
Original file line number Diff line number Diff line change
@@ -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])
]
)

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
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

0 comments on commit 2552828

Please sign in to comment.