Hello community,

here is the log from the commit of package libfaketime for openSUSE:Factory 
checked in at 2018-06-25 11:42:42
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/libfaketime (Old)
 and      /work/SRC/openSUSE:Factory/.libfaketime.new (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Package is "libfaketime"

Mon Jun 25 11:42:42 2018 rev:3 rq:618802 version:0.9.7

Changes:
--------
--- /work/SRC/openSUSE:Factory/libfaketime/libfaketime.changes  2016-06-25 
02:22:38.000000000 +0200
+++ /work/SRC/openSUSE:Factory/.libfaketime.new/libfaketime.changes     
2018-06-25 11:42:44.760717526 +0200
@@ -1,0 +2,16 @@
+Sun Jun 24 09:26:45 UTC 2018 - [email protected]
+
+- add 161.patch to pick gcc8 patches from git
+- fix source archive to match github URLs
+
+-------------------------------------------------------------------
+Sun Feb 25 14:50:35 UTC 2018 - [email protected]
+
+- update 0.9.7:
+  * added an option to disable monotonic time faking
+  * added support for COARSE clocks
+  * preliminary support for CLOCK_BOOTTIME (Linux)
+  * build fixes
+- remove libfaketime-0.9.6-gcc6.patch
+
+-------------------------------------------------------------------

Old:
----
  libfaketime-0.9.6-gcc6.patch
  libfaketime-0.9.6.tar.gz

New:
----
  161.patch
  v0.9.7.tar.gz

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

Other differences:
------------------
++++++ libfaketime.spec ++++++
--- /var/tmp/diff_new_pack.QUdWlq/_old  2018-06-25 11:42:45.424693038 +0200
+++ /var/tmp/diff_new_pack.QUdWlq/_new  2018-06-25 11:42:45.424693038 +0200
@@ -1,7 +1,7 @@
 #
 # spec file for package libfaketime
 #
-# Copyright (c) 2016 SUSE LINUX GmbH, Nuernberg, Germany.
+# Copyright (c) 2018 SUSE LINUX GmbH, Nuernberg, Germany.
 #
 # All modifications and additions to the file contributed by third parties
 # remain the property of their copyright owners, unless otherwise agreed
@@ -17,15 +17,15 @@
 
 
 Name:           libfaketime
-Version:        0.9.6
+Version:        0.9.7
 Release:        0
 Summary:        FakeTime Preload Library
-License:        GPL-2.0
+License:        GPL-2.0-only
 Group:          System/Libraries
-Url:            http://www.code-wizards.com/projects/libfaketime/
-Source:         
http://www.code-wizards.com/projects/libfaketime/%{name}-%{version}.tar.gz
-#PATCH-FIX-UPSTREAM nonnull argument compared to NULL
-Patch:          libfaketime-0.9.6-gcc6.patch
+Url:            https://github.com/wolfcw/libfaketime
+Source:         
https://github.com/wolfcw/libfaketime/archive/v%{version}.tar.gz
+# https://github.com/wolfcw/libfaketime/pull/161 (rebased to 0.9.7)
+Patch0:         161.patch
 BuildRoot:      %{_tmppath}/%{name}-%{version}-build
 
 %description
@@ -33,7 +33,7 @@
 
 %prep
 %setup -q
-%patch -p1
+%patch0 -p1
 
 %build
 make %{?_smp_mflags} PREFIX=%{_prefix} LIBDIRNAME=/%{_lib}/%{name}
@@ -44,7 +44,8 @@
 
 %files
 %defattr(-,root,root)
-%doc NEWS README COPYING
+%doc NEWS README
+%license COPYING
 %{_bindir}/faketime
 %dir %{_libdir}/%{name}
 %{_libdir}/%{name}/libfaketime.so.1

++++++ libfaketime-0.9.6-gcc6.patch -> 161.patch ++++++
--- /work/SRC/openSUSE:Factory/libfaketime/libfaketime-0.9.6-gcc6.patch 
2016-06-25 02:22:38.000000000 +0200
+++ /work/SRC/openSUSE:Factory/.libfaketime.new/161.patch       2018-06-25 
11:42:44.728718706 +0200
@@ -1,123 +1,119 @@
-Index: libfaketime-0.9.6/src/libfaketime.c
+From 0d964363a4352b7ee358f523c3416d07378d4583 Mon Sep 17 00:00:00 2001
+From: Thomas Petazzoni <[email protected]>
+Date: Thu, 17 May 2018 22:55:22 +0200
+Subject: [PATCH 1/4] libfaketime.c: fix strncpy() issues raised by gcc 8.x
+
+gcc 8.x introduced stricter checking on strncpy(), and causes the
+following build failures:
+
+libfaketime.c: In function 'fake_clock_gettime.part.4':
+libfaketime.c:2134:7: error: 'strncpy' specified bound 256 equals destination 
size [-Werror=stringop-truncation]
+       strncpy(user_faked_time, tmp_env, BUFFERLEN);
+       ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+libfaketime.c:2134:7: error: 'strncpy' specified bound 256 equals destination 
size [-Werror=stringop-truncation]
+       strncpy(user_faked_time, tmp_env, BUFFERLEN);
+       ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+libfaketime.c: In function 'ftpl_init':
+libfaketime.c:1884:12: error: 'strncpy' specified bound 1024 equals 
destination size [-Werror=stringop-truncation]
+     (void) strncpy(ft_spawn_target, getenv("FAKETIME_SPAWN_TARGET"), 1024);
+            ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+libfaketime.c:1945:5: error: 'strncpy' specified bound 8192 equals destination 
size [-Werror=stringop-truncation]
+     strncpy(user_faked_time_fmt, tmp_env, BUFSIZ);
+     ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+libfaketime.c: In function 'ftpl_init':
+libfaketime.c:1884:12: error: 'strncpy' specified bound 1024 equals 
destination size [-Werror=stringop-truncation]
+     (void) strncpy(ft_spawn_target, getenv("FAKETIME_SPAWN_TARGET"), 1024);
+            ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+libfaketime.c:1945:5: error: 'strncpy' specified bound 8192 equals destination 
size [-Werror=stringop-truncation]
+     strncpy(user_faked_time_fmt, tmp_env, BUFSIZ);
+     ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+
+This commit fixes that by making sure we keep one final byte for the
+nul terminator, as suggested by
+https://github.com/wolfcw/libfaketime/issues/150.
+
+Signed-off-by: Thomas Petazzoni <[email protected]>
+---
+ src/libfaketime.c | 9 ++++++---
+ 1 file changed, 6 insertions(+), 3 deletions(-)
+
+Index: libfaketime-0.9.7/src/libfaketime.c
 ===================================================================
---- libfaketime-0.9.6.orig/src/libfaketime.c
-+++ libfaketime-0.9.6/src/libfaketime.c
-@@ -510,13 +510,10 @@ int __xstat (int ver, const char *path,
-     return -1;
-   }
- 
--   if (buf != NULL)
--   {
-      if (!fake_stat_disabled)
-      {
-        fake_statbuf(buf);
-      }
--   }
- 
-   return result;
- }
-@@ -539,13 +536,11 @@ int __fxstat (int ver, int fildes, struc
-     return -1;
-   }
- 
--  if (buf != NULL)
--  {
-     if (!fake_stat_disabled)
-     {
-       fake_statbuf(buf);
-     }
--  }
-+
-   return result;
- }
- 
-@@ -568,13 +563,11 @@ int __fxstatat(int ver, int fildes, cons
-     return -1;
-   }
- 
--  if (buf != NULL)
--  {
-     if (!fake_stat_disabled)
-     {
-       fake_statbuf(buf);
-     }
--  }
-+
-   return result;
- }
+--- libfaketime-0.9.7.orig/src/libfaketime.c
++++ libfaketime-0.9.7/src/libfaketime.c
+@@ -1828,7 +1828,8 @@ void ftpl_init(void)
+   if ((tmp_env = getenv("FAKETIME_SPAWN_TARGET")) != NULL)
+   {
+     spawnsupport = true;
+-    (void) strncpy(ft_spawn_target, getenv("FAKETIME_SPAWN_TARGET"), 1024);
++    (void) strncpy(ft_spawn_target, getenv("FAKETIME_SPAWN_TARGET"), 
sizeof(ft_spawn_target) - 1);
++    ft_spawn_target[sizeof(ft_spawn_target) - 1] = 0;
+     if ((tmp_env = getenv("FAKETIME_SPAWN_SECONDS")) != NULL)
+     {
+       ft_spawn_secs = atol(tmp_env);
+@@ -1889,7 +1890,8 @@ void ftpl_init(void)
+   }
+   else
+   {
+-    strncpy(user_faked_time_fmt, tmp_env, BUFSIZ);
++    strncpy(user_faked_time_fmt, tmp_env, BUFSIZ - 1);
++    user_faked_time_fmt[BUFSIZ - 1] = 0;
+   }
+ 
+   if (shared_sem != 0)
+@@ -1960,6 +1962,14 @@ static void remove_trailing_eols(char *l
+  *      
=======================================================================
+  */
+ 
++#ifdef PTHREAD_SINGLETHREADED_TIME
++static void pthread_cleanup_mutex_lock(void *data)
++{
++  pthread_mutex_t *mutex = data;
++  pthread_mutex_unlock(mutex);
++}
++#endif
++
+ int fake_clock_gettime(clockid_t clk_id, struct timespec *tp)
+ {
+   /* variables used for caching, introduced in version 0.6 */
+@@ -1983,7 +1993,7 @@ int fake_clock_gettime(clockid_t clk_id,
+ #ifdef PTHREAD_SINGLETHREADED_TIME
+   static pthread_mutex_t time_mutex=PTHREAD_MUTEX_INITIALIZER;
+   pthread_mutex_lock(&time_mutex);
+-  pthread_cleanup_push((void (*)(void *))pthread_mutex_unlock, (void 
*)&time_mutex);
++  pthread_cleanup_push(pthread_cleanup_mutex_lock, &time_mutex);
  #endif
-@@ -597,13 +590,11 @@ int __lxstat (int ver, const char *path,
-     return -1;
-   }
- 
--  if (buf != NULL)
--  {
-     if (!fake_stat_disabled)
-     {
-       fake_statbuf(buf);
-     }
--  }
-+
-   return result;
- }
- 
-@@ -625,13 +616,11 @@ int __xstat64 (int ver, const char *path
-     return -1;
-   }
- 
--  if (buf != NULL)
--  {
-     if (!fake_stat_disabled)
-     {
-       fake_stat64buf(buf);
-     }
--  }
-+
-   return result;
- }
  
-@@ -653,13 +642,11 @@ int __fxstat64 (int ver, int fildes, str
-     return -1;
-   }
+   if ((limited_faking &&
+@@ -2078,7 +2088,8 @@ int fake_clock_gettime(clockid_t clk_id,
  
--  if (buf != NULL)
--  {
-     if (!fake_stat_disabled)
+     if (NULL != (tmp_env = getenv("FAKETIME")))
      {
-       fake_stat64buf(buf);
+-      strncpy(user_faked_time, tmp_env, BUFFERLEN);
++      strncpy(user_faked_time, tmp_env, BUFFERLEN - 1);
++      user_faked_time[BUFFERLEN - 1] = 0;
      }
--  }
-+
-   return result;
- }
- 
-@@ -682,13 +669,11 @@ int __fxstatat64 (int ver, int fildes, c
-     return -1;
-   }
- 
--  if (buf != NULL)
--  {
-     if (!fake_stat_disabled)
+     else
      {
-       fake_stat64buf(buf);
-     }
--  }
-+
-   return result;
- }
- #endif
-@@ -711,13 +696,11 @@ int __lxstat64 (int ver, const char *pat
-     return -1;
+Index: libfaketime-0.9.7/src/faketime.c
+===================================================================
+--- libfaketime-0.9.7.orig/src/faketime.c
++++ libfaketime-0.9.7/src/faketime.c
+@@ -209,7 +209,7 @@ int main (int argc, char **argv)
+     int shm_fd;
+     sem_t *sem;
+     struct ft_shared_s *ft_shared;
+-    char shared_objs[PATH_BUFSIZE];
++    char shared_objs[PATH_BUFSIZE * 2 + 1];
+ 
+     /*
+      * Casting of getpid() return value to long needed to make GCC on SmartOS
+@@ -286,7 +286,7 @@ int main (int argc, char **argv)
+       exit(EXIT_FAILURE);
+     }
+ 
+-    snprintf(shared_objs, PATH_BUFSIZE, "%s %s", sem_name, shm_name);
++    snprintf(shared_objs, sizeof(shared_objs), "%s %s", sem_name, shm_name);
+     setenv("FAKETIME_SHARED", shared_objs, true);
+     sem_close(sem);
    }
- 
--  if (buf != NULL)
--  {
-     if (!fake_stat_disabled)
-     {
-       fake_stat64buf(buf);
-     }
--  }
-+
-   return result;
- }
- #endif


Reply via email to