Script 'mail_helper' called by obssrc
Hello community,

here is the log from the commit of package libeconf for openSUSE:Factory 
checked in at 2025-01-15 17:42:34
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/libeconf (Old)
 and      /work/SRC/openSUSE:Factory/.libeconf.new.1881 (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Package is "libeconf"

Wed Jan 15 17:42:34 2025 rev:33 rq:1237365 version:0.7.7

Changes:
--------
--- /work/SRC/openSUSE:Factory/libeconf/libeconf.changes        2024-12-15 
12:34:19.451052819 +0100
+++ /work/SRC/openSUSE:Factory/.libeconf.new.1881/libeconf.changes      
2025-01-15 17:42:39.695344569 +0100
@@ -1,0 +2,6 @@
+Mon Jan 13 09:44:55 UTC 2025 - sch...@suse.com
+
+- Update to version 0.7.7:
+  * Additional fix for parsing empty config files (bsc#1234405).
+
+-------------------------------------------------------------------
python-libeconf.changes: same change

Old:
----
  libeconf-0.7.6.tar.xz

New:
----
  libeconf-0.7.7.tar.xz

++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Other differences:
------------------
++++++ libeconf.spec ++++++
--- /var/tmp/diff_new_pack.jVs7Kc/_old  2025-01-15 17:42:41.515420010 +0100
+++ /var/tmp/diff_new_pack.jVs7Kc/_new  2025-01-15 17:42:41.515420010 +0100
@@ -1,7 +1,7 @@
 #
 # spec file for package libeconf
 #
-# Copyright (c) 2024 SUSE LLC
+# Copyright (c) 2025 SUSE LLC
 #
 # All modifications and additions to the file contributed by third parties
 # remain the property of their copyright owners, unless otherwise agreed
@@ -18,7 +18,7 @@
 
 %define lname  libeconf0
 Name:           libeconf
-Version:        0.7.6
+Version:        0.7.7
 Release:        0
 Summary:        Enhanced config file parser ala systemd
 License:        MIT

++++++ python-libeconf.spec ++++++
--- /var/tmp/diff_new_pack.jVs7Kc/_old  2025-01-15 17:42:41.543421170 +0100
+++ /var/tmp/diff_new_pack.jVs7Kc/_new  2025-01-15 17:42:41.547421336 +0100
@@ -1,7 +1,7 @@
 #
 # spec file for package python-libeconf
 #
-# Copyright (c) 2024 SUSE LLC
+# Copyright (c) 2025 SUSE LLC
 #
 # All modifications and additions to the file contributed by third parties
 # remain the property of their copyright owners, unless otherwise agreed
@@ -19,7 +19,7 @@
 %{?sle15_python_module_pythons}
 %define skip_python39 1
 Name:           python-libeconf
-Version:        0.7.6
+Version:        0.7.7
 Release:        0
 Summary:        Python bindings for libeconf
 License:        MIT

++++++ _servicedata ++++++
--- /var/tmp/diff_new_pack.jVs7Kc/_old  2025-01-15 17:42:41.615424154 +0100
+++ /var/tmp/diff_new_pack.jVs7Kc/_new  2025-01-15 17:42:41.619424320 +0100
@@ -1,7 +1,7 @@
 <servicedata>
   <service name="tar_scm">
     <param name="url">https://github.com/openSUSE/libeconf.git</param>
-    <param 
name="changesrevision">acbf7e06de84ea289fd4d3dd189d7e36c49c09ae</param>
+    <param 
name="changesrevision">8d6e8917bc359823862225816a181f9f322a8d99</param>
  </service>
 </servicedata>
 (No newline at EOF)

++++++ libeconf-0.7.6.tar.xz -> libeconf-0.7.7.tar.xz ++++++
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/libeconf-0.7.6/CMakeLists.txt 
new/libeconf-0.7.7/CMakeLists.txt
--- old/libeconf-0.7.6/CMakeLists.txt   2024-12-13 13:28:58.000000000 +0100
+++ new/libeconf-0.7.7/CMakeLists.txt   2025-01-13 10:32:41.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.6
+project(libeconf VERSION 0.7.7
                  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.6/NEWS new/libeconf-0.7.7/NEWS
--- old/libeconf-0.7.6/NEWS     2024-12-13 13:28:58.000000000 +0100
+++ new/libeconf-0.7.7/NEWS     2025-01-13 10:32:41.000000000 +0100
@@ -1,3 +1,6 @@
+Version 0.7.7
+* Additional fix for parsing empty config files (bsc#1234405).
+
 Version 0.7.6
 * Do not parse files with name "." and ".." (bsc#1234405).
 * Fixed memory leak in econftool.
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/libeconf-0.7.6/lib/libeconf.c 
new/libeconf-0.7.7/lib/libeconf.c
--- old/libeconf-0.7.6/lib/libeconf.c   2024-12-13 13:28:58.000000000 +0100
+++ new/libeconf-0.7.7/lib/libeconf.c   2025-01-13 10:32:41.000000000 +0100
@@ -293,6 +293,14 @@
   (*merged_file)->delimiter = usr_file->delimiter;
   (*merged_file)->comment = usr_file->comment;
   (*merged_file)->path = NULL;
+  (*merged_file)->length = 0;
+  (*merged_file)->alloc_length = 0;
+  (*merged_file)->file_entry = NULL;
+  if((etc_file->length + usr_file->length)<= 0) {
+    /* nothing to merge */
+    return ECONF_SUCCESS;
+  }
+
   struct file_entry *fe =
       malloc((etc_file->length + usr_file->length) * sizeof(struct 
file_entry));
   if (fe == NULL)
@@ -316,7 +324,6 @@
                                etc_file, merge_length);
   (*merged_file)->length = merge_length;
   (*merged_file)->alloc_length = merge_length;
-
   (*merged_file)->file_entry = fe;
   return ECONF_SUCCESS;
 }
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/libeconf-0.7.6/lib/mergefiles.c 
new/libeconf-0.7.7/lib/mergefiles.c
--- old/libeconf-0.7.6/lib/mergefiles.c 2024-12-13 13:28:58.000000000 +0100
+++ new/libeconf-0.7.7/lib/mergefiles.c 2025-01-13 10:32:41.000000000 +0100
@@ -214,8 +214,7 @@
     */
     while (*double_key_files) {
       char * compare_file = basename((*double_key_files)->path);
-      if (strcmp(current_file, ".") != 0 && strcmp(current_file, "..") &&
-         strcmp(current_file, compare_file) == 0) {
+      if (strcmp(current_file, compare_file) == 0) {
        break;
       }
       double_key_files++;
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/libeconf-0.7.6/meson.build 
new/libeconf-0.7.7/meson.build
--- old/libeconf-0.7.6/meson.build      2024-12-13 13:28:58.000000000 +0100
+++ new/libeconf-0.7.7/meson.build      2025-01-13 10:32:41.000000000 +0100
@@ -7,7 +7,7 @@
                  'b_pie=true',
                  'warning_level=3',],
   license : 'MIT',
-  version : '0.7.6',
+  version : '0.7.7',
 )
 
 cc = meson.get_compiler('c')
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/libeconf-0.7.6/tests/meson.build 
new/libeconf-0.7.7/tests/meson.build
--- old/libeconf-0.7.6/tests/meson.build        2024-12-13 13:28:58.000000000 
+0100
+++ new/libeconf-0.7.7/tests/meson.build        2025-01-13 10:32:41.000000000 
+0100
@@ -140,6 +140,14 @@
   c_args: ['-DTESTSDIR="' + testdir + 'tst-uapi-pam_env-data' + '"'], 
dependencies : libeconf_dep)
 test('tst-uapi-pam_env', tst_uapi_pam_env_exe)
 
+tst_uapi_empty_dot_d_dir_exe = executable('tst-uapi-empty_dot_d_dir', 
'tst-uapi-empty_dot_d_dir.c',
+  c_args: ['-DTESTSDIR="' + testdir + 'tst-uapi-empty_dot_d_dir' + '"'], 
dependencies : libeconf_dep)
+test('tst-uapi-empty_dot_d_dir', tst_uapi_empty_dot_d_dir_exe)
+
+tst_uapi_empty_dot_d_dir2_exe = executable('tst-uapi-empty_dot_d_dir2', 
'tst-uapi-empty_dot_d_dir2.c',
+  c_args: ['-DTESTSDIR="' + testdir + 'tst-uapi-empty_dot_d_dir2' + '"'], 
dependencies : libeconf_dep)
+test('tst-uapi-empty_dot_d_dir2', tst_uapi_empty_dot_d_dir2_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.6/tests/tst-uapi-empty_dot_d_dir.c 
new/libeconf-0.7.7/tests/tst-uapi-empty_dot_d_dir.c
--- old/libeconf-0.7.6/tests/tst-uapi-empty_dot_d_dir.c 1970-01-01 
01:00:00.000000000 +0100
+++ new/libeconf-0.7.7/tests/tst-uapi-empty_dot_d_dir.c 2025-01-13 
10:32:41.000000000 +0100
@@ -0,0 +1,65 @@
+#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:
+   /etc/environment which is empty
+   /usr/etc/environment.d/a.conf which is empty
+   /usr/etc/environment.d/b.conf which is empty
+   /usr/etc/environment.d/c.conf which is empty
+
+   libeconf should have none entry.
+*/
+
+int
+main(void)
+{
+  econf_file *key_file = NULL;
+  int retval = 0;
+  econf_err error;
+  char **keys;
+  size_t key_number;
+
+  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;
+    }
+
+
+  error = econf_getKeys(key_file, NULL, &key_number, &keys);
+  if (error != ECONF_NOKEY)
+    {
+      fprintf (stderr, "Getting all keys should return error ECONF_NOKEY: 
%s\n", econf_errString(error));
+      return 1;
+    }
+  if (key_number != 0)
+    {
+      fprintf (stderr, "Key Number should be 0: %ld\n", key_number);
+      return 1;
+    }
+
+  econf_free (key_file);
+
+  return retval;
+}
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' 
old/libeconf-0.7.6/tests/tst-uapi-empty_dot_d_dir2/usr/etc/environment.d/c.conf 
new/libeconf-0.7.7/tests/tst-uapi-empty_dot_d_dir2/usr/etc/environment.d/c.conf
--- 
old/libeconf-0.7.6/tests/tst-uapi-empty_dot_d_dir2/usr/etc/environment.d/c.conf 
    1970-01-01 01:00:00.000000000 +0100
+++ 
new/libeconf-0.7.7/tests/tst-uapi-empty_dot_d_dir2/usr/etc/environment.d/c.conf 
    2025-01-13 10:32:41.000000000 +0100
@@ -0,0 +1,6 @@
+#
+# This file is parsed by pam_env module
+#
+# Syntax: simple "KEY=VAL" pairs on seperate lines
+#
+Y2STYLE=dark.qss
\ No newline at end of file
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/libeconf-0.7.6/tests/tst-uapi-empty_dot_d_dir2.c 
new/libeconf-0.7.7/tests/tst-uapi-empty_dot_d_dir2.c
--- old/libeconf-0.7.6/tests/tst-uapi-empty_dot_d_dir2.c        1970-01-01 
01:00:00.000000000 +0100
+++ new/libeconf-0.7.7/tests/tst-uapi-empty_dot_d_dir2.c        2025-01-13 
10:32:41.000000000 +0100
@@ -0,0 +1,84 @@
+#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:
+
+   /etc/environment which is empty
+   /usr/etc/environment.d/a.conf which is empty
+   /usr/etc/environment.d/b.conf which is empty
+   /usr/etc/environment.d/c.conf which is NOT empty
+
+   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;
+}

Reply via email to