This is the mail archive of the glibc-cvs@sourceware.org mailing list for the glibc project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

GNU C Library master sources branch master updated. glibc-2.26-528-g1e9522c


This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "GNU C Library master sources".

The branch, master has been updated
       via  1e9522c61c7a544d59db32cb7fbbd42e6793d848 (commit)
      from  644d38570a860f3ed7d478c4ed8965a91e4621a1 (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
http://sourceware.org/git/gitweb.cgi?p=glibc.git;a=commitdiff;h=1e9522c61c7a544d59db32cb7fbbd42e6793d848

commit 1e9522c61c7a544d59db32cb7fbbd42e6793d848
Author: Florian Weimer <fweimer@redhat.com>
Date:   Thu Oct 5 18:14:27 2017 +0200

    nscd: Eliminate compilation time dependency in the build output
    
    Reviewed-by: Carlos O'Donell <carlos@redhat.com>

diff --git a/ChangeLog b/ChangeLog
index fc96371..7ddff74 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,14 @@
+2017-10-05  Florian Weimer  <fweimer@redhat.com>
+
+	nscd: Eliminate compilation time dependency in the build output.
+	* nscd/nscd_stat.c (STATDATA_VERSION)
+	(STATDATA_VERSION_SELINUX_FLAG, STATDATA_VERSION_FLAGS)
+	(STATDATA_VERSION_FULL): New macro definitions.
+	(compilation): Remove.
+	(struct statdata): Adjust version member.
+	(send_stats): Set version from STATDATA_VERSION_FULL.
+	(receive_print_stats): Verify version against STATDATA_VERSION_FULL.
+
 2017-10-05  Joseph Myers  <joseph@codesourcery.com>
 
 	* configure.ac (--enable-add-ons): Remove option.
diff --git a/nscd/nscd_stat.c b/nscd/nscd_stat.c
index feb1c98..b1bc81b 100644
--- a/nscd/nscd_stat.c
+++ b/nscd/nscd_stat.c
@@ -35,9 +35,23 @@
 # include <selinux/avc.h>
 #endif /* HAVE_SELINUX */
 
+/* We use this to make sure the receiver is the same.  The lower 16
+   bits are reserved for flags indicating compilation variants.  This
+   version needs to be updated if the definition of struct statdata
+   changes.  */
+#define STATDATA_VERSION  0x01020000U
 
-/* We use this to make sure the receiver is the same.  */
-static const char compilation[21] = __DATE__ " " __TIME__;
+#ifdef HAVE_SELINUX
+# define STATDATA_VERSION_SELINUX_FLAG 0x0001U
+#else
+# define STATDATA_VERSION_SELINUX_FLAG 0x0000U
+#endif
+
+/* All flags affecting the struct statdata layout.  */
+#define STATDATA_VERSION_FLAGS STATDATA_VERSION_SELINUX_FLAG
+
+/* The full version number for struct statdata.  */
+#define STATDATA_VERSION_FULL (STATDATA_VERSION | STATDATA_VERSION_FLAGS)
 
 /* Statistic data for one database.  */
 struct dbstat
@@ -68,10 +82,11 @@ struct dbstat
   uintmax_t addfailed;
 };
 
-/* Record for transmitting statistics.  */
+/* Record for transmitting statistics.  If this definition changes,
+   update STATDATA_VERSION above.  */
 struct statdata
 {
-  char version[sizeof (compilation)];
+  unsigned int version;		/* Must be STATDATA_VERSION_FULL.  */
   int debug_level;
   time_t runtime;
   unsigned long int client_queued;
@@ -96,7 +111,7 @@ send_stats (int fd, struct database_dyn dbs[lastdb])
 
   memset (&data, 0, sizeof (data));
 
-  memcpy (data.version, compilation, sizeof (compilation));
+  data.version = STATDATA_VERSION_FULL;
   data.debug_level = debug_level;
   data.runtime = time (NULL) - start_time;
   data.client_queued = client_queued;
@@ -196,7 +211,7 @@ 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
+      || (data.version != STATDATA_VERSION_FULL
 	  /* Yes, this is an assignment!  */
 	  && (errno = EINVAL)))
     {

-----------------------------------------------------------------------

Summary of changes:
 ChangeLog        |   11 +++++++++++
 nscd/nscd_stat.c |   27 +++++++++++++++++++++------
 2 files changed, 32 insertions(+), 6 deletions(-)


hooks/post-receive
-- 
GNU C Library master sources


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]