Script 'mail_helper' called by obssrc Hello community, here is the log from the commit of package libeconf for openSUSE:Factory checked in at 2024-12-15 12:34:17 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/libeconf (Old) and /work/SRC/openSUSE:Factory/.libeconf.new.29675 (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "libeconf" Sun Dec 15 12:34:17 2024 rev:32 rq:1230800 version:0.7.6 Changes: -------- --- /work/SRC/openSUSE:Factory/libeconf/libeconf.changes 2024-12-10 23:46:04.118897774 +0100 +++ /work/SRC/openSUSE:Factory/.libeconf.new.29675/libeconf.changes 2024-12-15 12:34:19.451052819 +0100 @@ -1,0 +2,7 @@ +Fri Dec 13 13:03:47 UTC 2024 - [email protected] + +- Update to version 0.7.6: + * Do not try to parse files with name like ".." and "." (#227) + * using econf_readConfig in econftool + +------------------------------------------------------------------- python-libeconf.changes: same change Old: ---- libeconf-0.7.5.tar.xz New: ---- libeconf-0.7.6.tar.xz ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ libeconf.spec ++++++ --- /var/tmp/diff_new_pack.MRQFc6/_old 2024-12-15 12:34:20.335089631 +0100 +++ /var/tmp/diff_new_pack.MRQFc6/_new 2024-12-15 12:34:20.335089631 +0100 @@ -18,7 +18,7 @@ %define lname libeconf0 Name: libeconf -Version: 0.7.5 +Version: 0.7.6 Release: 0 Summary: Enhanced config file parser ala systemd License: MIT ++++++ python-libeconf.spec ++++++ --- /var/tmp/diff_new_pack.MRQFc6/_old 2024-12-15 12:34:20.363090798 +0100 +++ /var/tmp/diff_new_pack.MRQFc6/_new 2024-12-15 12:34:20.367090964 +0100 @@ -19,7 +19,7 @@ %{?sle15_python_module_pythons} %define skip_python39 1 Name: python-libeconf -Version: 0.7.5 +Version: 0.7.6 Release: 0 Summary: Python bindings for libeconf License: MIT ++++++ _servicedata ++++++ --- /var/tmp/diff_new_pack.MRQFc6/_old 2024-12-15 12:34:20.423093296 +0100 +++ /var/tmp/diff_new_pack.MRQFc6/_new 2024-12-15 12:34:20.427093463 +0100 @@ -1,7 +1,7 @@ <servicedata> <service name="tar_scm"> <param name="url">https://github.com/openSUSE/libeconf.git</param> - <param name="changesrevision">55395fda6890603ca5061cd15a32dfb2d6817928</param> + <param name="changesrevision">acbf7e06de84ea289fd4d3dd189d7e36c49c09ae</param> </service> </servicedata> (No newline at EOF) ++++++ libeconf-0.7.5.tar.xz -> libeconf-0.7.6.tar.xz ++++++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libeconf-0.7.5/CMakeLists.txt new/libeconf-0.7.6/CMakeLists.txt --- old/libeconf-0.7.5/CMakeLists.txt 2024-12-09 17:20:01.000000000 +0100 +++ new/libeconf-0.7.6/CMakeLists.txt 2024-12-13 13:28:58.000000000 +0100 @@ -3,7 +3,7 @@ # Ensure built-in policies from CMake are used, (e.g. improved policies for macOS) cmake_policy(VERSION ${CMAKE_MAJOR_VERSION}.${CMAKE_MINOR_VERSION}) -project(libeconf VERSION 0.7.5 +project(libeconf VERSION 0.7.6 DESCRIPTION "Enhanced config file parser, which merges config files placed in several locations into one." LANGUAGES C ) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libeconf-0.7.5/NEWS new/libeconf-0.7.6/NEWS --- old/libeconf-0.7.5/NEWS 2024-12-09 17:20:01.000000000 +0100 +++ new/libeconf-0.7.6/NEWS 2024-12-13 13:28:58.000000000 +0100 @@ -1,3 +1,7 @@ +Version 0.7.6 +* Do not parse files with name "." and ".." (bsc#1234405). +* Fixed memory leak in econftool. + Version 0.7.5 * Fixed memory leaks. * Removed PATH_MAX define. diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libeconf-0.7.5/lib/mergefiles.c new/libeconf-0.7.6/lib/mergefiles.c --- old/libeconf-0.7.5/lib/mergefiles.c 2024-12-09 17:20:01.000000000 +0100 +++ new/libeconf-0.7.6/lib/mergefiles.c 2024-12-13 13:28:58.000000000 +0100 @@ -132,7 +132,8 @@ size_t lenstr = strlen(de[i]->d_name); size_t lensuffix = strlen(config_suffix); if (lensuffix < lenstr && - strncmp(de[i]->d_name + lenstr - lensuffix, config_suffix, lensuffix) == 0) { + strncmp(de[i]->d_name + lenstr - lensuffix, config_suffix, lensuffix) == 0 && + strcmp(de[i]->d_name,".") != 0 && strcmp(de[i]->d_name,"..") != 0) { char *file_path = combine_strings(path, de[i]->d_name, '/'); econf_file *key_file = NULL; if ((error = econf_newKeyFile_with_options(&key_file, "")) != ECONF_SUCCESS) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libeconf-0.7.5/meson.build new/libeconf-0.7.6/meson.build --- old/libeconf-0.7.5/meson.build 2024-12-09 17:20:01.000000000 +0100 +++ new/libeconf-0.7.6/meson.build 2024-12-13 13:28:58.000000000 +0100 @@ -7,7 +7,7 @@ 'b_pie=true', 'warning_level=3',], license : 'MIT', - version : '0.7.5', + version : '0.7.6', ) cc = meson.get_compiler('c') diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libeconf-0.7.5/tests/meson.build new/libeconf-0.7.6/tests/meson.build --- old/libeconf-0.7.5/tests/meson.build 2024-12-09 17:20:01.000000000 +0100 +++ new/libeconf-0.7.6/tests/meson.build 2024-12-13 13:28:58.000000000 +0100 @@ -136,6 +136,10 @@ c_args: ['-DTESTSDIR="' + testdir + 'tst-uapi-11-data' + '"'], dependencies : libeconf_dep) test('tst-uapi-11', tst_uapi_11_exe) +tst_uapi_pam_env_exe = executable('tst-uapi-pam_env', 'tst-uapi-pam_env.c', + c_args: ['-DTESTSDIR="' + testdir + 'tst-uapi-pam_env-data' + '"'], dependencies : libeconf_dep) +test('tst-uapi-pam_env', tst_uapi_pam_env_exe) + tst_parse_error_exe = executable('tst-parse-error', 'tst-parse-error.c', c_args: test_args, dependencies : libeconf_dep) test('tst-parse-error', tst_parse_error_exe) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libeconf-0.7.5/tests/tst-econftool_cat.sh new/libeconf-0.7.6/tests/tst-econftool_cat.sh --- old/libeconf-0.7.5/tests/tst-econftool_cat.sh 2024-12-09 17:20:01.000000000 +0100 +++ new/libeconf-0.7.6/tests/tst-econftool_cat.sh 2024-12-13 13:28:58.000000000 +0100 @@ -14,7 +14,6 @@ teststringslength=${#teststrings[@]} econftool_exe="$PWD/../util/econftool" -echo $econftool_exe >/tmp/stefan if ! [[ -f "$econftool_exe" ]]; then econftool_exe="$PWD/econftool" if ! [[ -f "$econftool_exe" ]]; then diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libeconf-0.7.5/tests/tst-uapi-pam_env-data/usr/etc/environment new/libeconf-0.7.6/tests/tst-uapi-pam_env-data/usr/etc/environment --- old/libeconf-0.7.5/tests/tst-uapi-pam_env-data/usr/etc/environment 1970-01-01 01:00:00.000000000 +0100 +++ new/libeconf-0.7.6/tests/tst-uapi-pam_env-data/usr/etc/environment 2024-12-13 13:28:58.000000000 +0100 @@ -0,0 +1,5 @@ +# +# This file is parsed by pam_env module +# +# Syntax: simple "KEY=VAL" pairs on seperate lines +# diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libeconf-0.7.5/tests/tst-uapi-pam_env-data/usr/etc/environment.d/10-pallas.conf new/libeconf-0.7.6/tests/tst-uapi-pam_env-data/usr/etc/environment.d/10-pallas.conf --- old/libeconf-0.7.5/tests/tst-uapi-pam_env-data/usr/etc/environment.d/10-pallas.conf 1970-01-01 01:00:00.000000000 +0100 +++ new/libeconf-0.7.6/tests/tst-uapi-pam_env-data/usr/etc/environment.d/10-pallas.conf 2024-12-13 13:28:58.000000000 +0100 @@ -0,0 +1,5 @@ +# Environment + +# YaST theme + +Y2STYLE=dark.qss diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libeconf-0.7.5/tests/tst-uapi-pam_env.c new/libeconf-0.7.6/tests/tst-uapi-pam_env.c --- old/libeconf-0.7.5/tests/tst-uapi-pam_env.c 1970-01-01 01:00:00.000000000 +0100 +++ new/libeconf-0.7.6/tests/tst-uapi-pam_env.c 2024-12-13 13:28:58.000000000 +0100 @@ -0,0 +1,82 @@ +#ifdef HAVE_CONFIG_H +# include <config.h> +#endif + +#include <stdio.h> +#include <string.h> +#include "libeconf.h" +bool callback_without_error(const char *filename, const void *data); +bool callback_with_error(const char *filename, const void *data); + +/* Test case: + + /usr/etc/environment exists + /usr/etc/environment.d/10-pallas.conf exists + + libeconf should read these files and return one entry. +*/ + +static int +check_key(econf_file *key_file, char *key, char *expected_val) +{ + char *val = NULL; + econf_err error = econf_getStringValue (key_file, "", key, &val); + if (expected_val == NULL) + { + if (val == NULL) + return 0; + + fprintf (stderr, "ERROR: %s has value \"%s\"\n", key, val); + return 1; + } + if (val == NULL || strlen(val) == 0) + { + fprintf (stderr, "ERROR: %s returns nothing! (%s)\n", key, + econf_errString(error)); + return 1; + } + if (strcmp (val, expected_val) != 0) + { + fprintf (stderr, "ERROR: %s is not \"%s\"\n", key, expected_val); + return 1; + } + + printf("Ok: %s=%s\n", key, val); + free (val); + return 0; +} + +int +main(void) +{ + econf_file *key_file = NULL; + int retval = 0; + econf_err error; + + if ((error = econf_newKeyFile_with_options(&key_file, "ROOT_PREFIX="TESTSDIR))) + { + fprintf (stderr, "ERROR: couldn't allocate new file: %s\n", + econf_errString(error)); + return 1; + } + + error = econf_readConfig (&key_file, + NULL, + "/usr/etc", + "environment", + "", "=", "#"); + + if (error) + { + fprintf (stderr, "ERROR: econf_readConfig: %s\n", + econf_errString(error)); + return 1; + } + + if (check_key(key_file, "Y2STYLE", "dark.qss") != 0) + retval = 1; + + econf_free (key_file); + + return retval; +} diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libeconf-0.7.5/util/econftool.c new/libeconf-0.7.6/util/econftool.c --- old/libeconf-0.7.5/util/econftool.c 2024-12-09 17:20:01.000000000 +0100 +++ new/libeconf-0.7.6/util/econftool.c 2024-12-13 13:28:58.000000000 +0100 @@ -107,6 +107,36 @@ return buffer; } + +/** + * @brief Defines a list of directories from which the configuration files have + * to be parsed. The list is a string, divides by ":". The last entry has + * the highest priority. E.g.: "PARSING_DIRS=/usr/etc/:/run:/etc" + * + */ +static econf_file *init_key_file(void) +{ + econf_file *key_file = NULL; + econf_err error; + + char *param = NULL; + if (asprintf(¶m, "PARSING_DIRS=%s:%s", usr_root_dir, root_dir) < 0) { + fprintf(stderr, "Out of memory!\n"); + exit(EXIT_FAILURE); + } + + if ((error = econf_newKeyFile_with_options(&key_file, param))) + { + fprintf (stderr, "ERROR: couldn't allocate new key_file: %s\n", + econf_errString(error)); + free(param); + exit(EXIT_FAILURE); + } + + free(param); + return key_file; +} + /** * @brief Change root dir if environment variable "ECONFTOOL_ROOT" exists * @@ -283,7 +313,7 @@ /** * @brief This command will read all snippets for filename.conf - * (econf_readDirs) OR a single file only. After that it + * (econf_readConfig) OR a single file only. After that it * will evtl. print all groups, keys and their values as * an application would see them. */ @@ -295,7 +325,8 @@ econf_error = econf_readFile(key_file, conf_filename, delimiters, comment); } else { - econf_error = econf_readDirs(key_file, usr_root_dir, root_dir, conf_basename, + *key_file = init_key_file(); + econf_error = econf_readConfig(key_file, NULL, NULL, conf_basename, conf_suffix, delimiters, comment); } if (econf_error) { @@ -313,7 +344,7 @@ /** * @brief This command will read all snippets for filename.conf - * (econf_readDirs) in hierarchical order and print all groups, + * (econf_readDirsHistory) in hierarchical order and print all groups, * keys and their values. */ static int econf_cat(const char *delimiters, const char *comment) @@ -453,7 +484,9 @@ econf_error = econf_readFile(key_file, conf_filename, delimiters, comment); } else { - econf_error = econf_readDirs(key_file, usr_root_dir, root_dir, conf_basename, conf_suffix, delimiters, comment); + *key_file = init_key_file(); + econf_error = econf_readConfig(key_file, NULL, NULL, conf_basename, + conf_suffix, delimiters, comment); } if (econf_error == ECONF_NOFILE) {
