forked from pool/glibc
Andreas Schwab
0353781f37
- glibc-nodate.patch: fix verification of timestamp OBS-URL: https://build.opensuse.org/request/show/317948 OBS-URL: https://build.opensuse.org/package/show/Base:System/glibc?expand=0&rev=408
48 lines
1.5 KiB
Diff
48 lines
1.5 KiB
Diff
Index: glibc-2.21/nscd/nscd_stat.c
|
|
===================================================================
|
|
--- glibc-2.21.orig/nscd/nscd_stat.c
|
|
+++ glibc-2.21/nscd/nscd_stat.c
|
|
@@ -36,8 +36,13 @@
|
|
#endif /* HAVE_SELINUX */
|
|
|
|
|
|
-/* We use this to make sure the receiver is the same. */
|
|
+/* We use this to make sure the receiver is the same. Capture mtime
|
|
+ of this file if possible. */
|
|
+#ifdef __TIMESTAMP__
|
|
+static const char compilation[21];
|
|
+#else
|
|
static const char compilation[21] = __DATE__ " " __TIME__;
|
|
+#endif
|
|
|
|
/* Statistic data for one database. */
|
|
struct dbstat
|
|
@@ -96,7 +101,12 @@ send_stats (int fd, struct database_dyn
|
|
|
|
memset (&data, 0, sizeof (data));
|
|
|
|
+#ifdef __TIMESTAMP__
|
|
+ /* Skip day of the week. */
|
|
+ memcpy (data.version, __TIMESTAMP__ + 4, sizeof (compilation));
|
|
+#else
|
|
memcpy (data.version, compilation, sizeof (compilation));
|
|
+#endif
|
|
data.debug_level = debug_level;
|
|
data.runtime = time (NULL) - start_time;
|
|
data.client_queued = client_queued;
|
|
@@ -196,7 +206,13 @@ receive_print_stats (void)
|
|
|
|
/* Read as much data as we expect. */
|
|
if (TEMP_FAILURE_RETRY (read (fd, &data, sizeof (data))) != sizeof (data)
|
|
- || (memcmp (data.version, compilation, sizeof (compilation)) != 0
|
|
+ || (
|
|
+#ifdef __TIMESTAMP__
|
|
+ /* Skip day of the week. */
|
|
+ memcmp (data.version, __TIMESTAMP__ + 4, sizeof (compilation)) != 0
|
|
+#else
|
|
+ memcmp (data.version, compilation, sizeof (compilation)) != 0
|
|
+#endif
|
|
/* Yes, this is an assignment! */
|
|
&& (errno = EINVAL)))
|
|
{
|