Script 'mail_helper' called by obssrc
Hello community,

here is the log from the commit of package fakeroot for openSUSE:Factory 
checked in at 2024-07-01 11:20:30
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/fakeroot (Old)
 and      /work/SRC/openSUSE:Factory/.fakeroot.new.18349 (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Package is "fakeroot"

Mon Jul  1 11:20:30 2024 rev:17 rq:1184045 version:1.35.1

Changes:
--------
--- /work/SRC/openSUSE:Factory/fakeroot/fakeroot.changes        2024-06-09 
20:24:07.009930037 +0200
+++ /work/SRC/openSUSE:Factory/.fakeroot.new.18349/fakeroot.changes     
2024-07-01 11:21:02.948544209 +0200
@@ -1,0 +2,6 @@
+Sat Jun 29 21:06:15 UTC 2024 - Dirk Müller <dmuel...@suse.com>
+
+- update to 1.35.1
+  * big endian fixes
+
+-------------------------------------------------------------------

Old:
----
  fakeroot_1.35.orig.tar.gz

New:
----
  fakeroot_1.35.1.orig.tar.gz

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

Other differences:
------------------
++++++ fakeroot.spec ++++++
--- /var/tmp/diff_new_pack.1VlzHL/_old  2024-07-01 11:21:03.460562861 +0200
+++ /var/tmp/diff_new_pack.1VlzHL/_new  2024-07-01 11:21:03.464563007 +0200
@@ -17,7 +17,7 @@
 
 
 Name:           fakeroot
-Version:        1.35
+Version:        1.35.1
 Release:        0
 Summary:        Wrapper that gives a fake root environment
 License:        GPL-3.0-or-later

++++++ fakeroot_1.35.orig.tar.gz -> fakeroot_1.35.1.orig.tar.gz ++++++
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/fakeroot-1.35/communicate.c 
new/fakeroot-1.35.1/communicate.c
--- old/fakeroot-1.35/communicate.c     2022-01-17 21:42:20.000000000 +0100
+++ new/fakeroot-1.35.1/communicate.c   2024-06-06 20:15:57.000000000 +0200
@@ -511,12 +511,19 @@
 void send_fakem(const struct fake_msg *buf)
 {
   int r;
+  struct fake_msg_buf fm = { 0 };
 
   if(init_get_msg()!=-1){
-    ((struct fake_msg *)buf)->mtype=1;
+    memcpy(&fm.msg, buf, sizeof(*buf));
+    fm.mtype=1;
+#if __BYTE_ORDER == __BIG_ENDIAN
+    ((struct fake_msg*)&fm.msg)->magic=FAKEROOT_MAGIC_BE;
+#elif __BYTE_ORDER == __LITTLE_ENDIAN
+    ((struct fake_msg*)&fm.msg)->magic=FAKEROOT_MAGIC_LE;
+#endif
     do
-      r=msgsnd(msg_snd, (struct fake_msg *)buf,
-              sizeof(*buf)-sizeof(buf->mtype), 0);
+      r=msgsnd(msg_snd, &fm,
+              sizeof(fm)-sizeof(fm.mtype), 0);
     while((r==-1) && (errno==EINTR));
     if(r==-1)
       perror("libfakeroot, when sending message");
@@ -548,8 +555,12 @@
   there will always be some (small) chance it will go wrong.
   */
 
+  struct fake_msg_buf fm = { 0 };
+  uint32_t k = 0;
+  uint32_t magic_candidate = 0;
   int l;
   pid_t pid;
+  uint8_t* ptr = NULL;
   static int serial=0;
 
   if(init_get_msg()!=-1){
@@ -560,11 +571,50 @@
     buf->pid=pid;
     send_fakem(buf);
 
-    do
+    do {
       l=msgrcv(msg_get,
-               (struct my_msgbuf*)buf,
-               sizeof(*buf)-sizeof(buf->mtype),0,0);
-    while(((l==-1)&&(errno==EINTR))||(buf->serial!=serial)||buf->pid!=pid);
+               &fm,
+               sizeof(fm)-sizeof(fm.mtype),0,0);
+
+      ptr = &fm;
+      for (k=0; k<16; k++) {
+        magic_candidate = *(uint32_t*)&ptr[k];
+        if (magic_candidate == FAKEROOT_MAGIC_LE || magic_candidate == 
FAKEROOT_MAGIC_BE) {
+          memcpy(buf, &ptr[k], sizeof(*buf));
+          break;
+        }
+      }
+
+      if (k == 16) {
+        fprintf(stderr,
+               "libfakeroot internal error: payload not recognized!\n");
+        continue;
+      }
+
+      /*
+        Use swapX here instead of ntoh/hton
+        that do nothing on big-endian machines
+      */
+#if __BYTE_ORDER == __LITTLE_ENDIAN
+      if (magic_candidate == FAKEROOT_MAGIC_BE) {
+#elif __BYTE_ORDER == __BIG_ENDIAN
+      if (magic_candidate == FAKEROOT_MAGIC_LE) {
+#endif
+         buf->id = bswapl(buf->id);
+         buf->pid = bswapl(buf->pid);
+         buf->serial = bswapl(buf->serial);
+         buf->st.uid = bswapl(buf->st.uid);
+         buf->st.gid = bswapl(buf->st.gid);
+         buf->st.ino = bswapll(buf->st.ino);
+         buf->st.dev = bswapll(buf->st.dev);
+         buf->st.rdev = bswapll(buf->st.rdev);
+         buf->st.mode = bswapl(buf->st.mode);
+         buf->st.nlink = bswapl(buf->st.nlink);
+         buf->remote = bswapl(0);
+         buf->xattr.buffersize = bswapl(buf->xattr.buffersize);
+         buf->xattr.flags_rc = bswapl(buf->xattr.flags_rc);
+      }
+    }while(((l==-1)&&(errno==EINTR))||(buf->serial!=serial)||buf->pid!=pid);
 
     if(l==-1){
       buf->xattr.flags_rc=errno;
@@ -581,7 +631,6 @@
     printf("libfakeroot/fakeroot, internal bug!! get_fake: length=%i != l=%i",
     sizeof(*buf)-sizeof(buf->mtype),l);
     */
-
   }
 }
 
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/fakeroot-1.35/config.h.in 
new/fakeroot-1.35.1/config.h.in
--- old/fakeroot-1.35/config.h.in       2024-06-05 21:19:47.000000000 +0200
+++ new/fakeroot-1.35.1/config.h.in     2024-06-25 02:24:46.000000000 +0200
@@ -405,6 +405,9 @@
 #undef const
 
 /* Define to `int' if <sys/types.h> does not define. */
+#undef id_t
+
+/* Define to `int' if <sys/types.h> does not define. */
 #undef mode_t
 
 /* Define to `long' if <sys/types.h> does not define. */
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/fakeroot-1.35/configure new/fakeroot-1.35.1/configure
--- old/fakeroot-1.35/configure 2024-06-05 21:19:47.000000000 +0200
+++ new/fakeroot-1.35.1/configure       2024-06-25 02:24:46.000000000 +0200
@@ -1,6 +1,6 @@
 #! /bin/sh
 # Guess values for system-dependent variables and create Makefiles.
-# Generated by GNU Autoconf 2.71 for fakeroot 1.35.
+# Generated by GNU Autoconf 2.71 for fakeroot 1.35.1.
 #
 # Report bugs to <cl...@debian.org>.
 #
@@ -621,8 +621,8 @@
 # Identity of this package.
 PACKAGE_NAME='fakeroot'
 PACKAGE_TARNAME='fakeroot'
-PACKAGE_VERSION='1.35'
-PACKAGE_STRING='fakeroot 1.35'
+PACKAGE_VERSION='1.35.1'
+PACKAGE_STRING='fakeroot 1.35.1'
 PACKAGE_BUGREPORT='cl...@debian.org'
 PACKAGE_URL=''
 
@@ -1370,7 +1370,7 @@
   # Omit some internal or obsolete options to make the list less imposing.
   # This message is too long to be a string in the A/UX 3.1 sh.
   cat <<_ACEOF
-\`configure' configures fakeroot 1.35 to adapt to many kinds of systems.
+\`configure' configures fakeroot 1.35.1 to adapt to many kinds of systems.
 
 Usage: $0 [OPTION]... [VAR=VALUE]...
 
@@ -1442,7 +1442,7 @@
 
 if test -n "$ac_init_help"; then
   case $ac_init_help in
-     short | recursive ) echo "Configuration of fakeroot 1.35:";;
+     short | recursive ) echo "Configuration of fakeroot 1.35.1:";;
    esac
   cat <<\_ACEOF
 
@@ -1560,7 +1560,7 @@
 test -n "$ac_init_help" && exit $ac_status
 if $ac_init_version; then
   cat <<\_ACEOF
-fakeroot configure 1.35
+fakeroot configure 1.35.1
 generated by GNU Autoconf 2.71
 
 Copyright (C) 2021 Free Software Foundation, Inc.
@@ -1968,7 +1968,7 @@
 This file contains any messages produced by compilers while
 running configure, to aid debugging if configure makes a mistake.
 
-It was created by fakeroot $as_me 1.35, which was
+It was created by fakeroot $as_me 1.35.1, which was
 generated by GNU Autoconf 2.71.  Invocation command line was
 
   $ $0$ac_configure_args_raw
@@ -3355,7 +3355,7 @@
 
 # Define the identity of the package.
  PACKAGE='fakeroot'
- VERSION='1.35'
+ VERSION='1.35.1'
 
 
 printf "%s\n" "#define PACKAGE \"$PACKAGE\"" >>confdefs.h
@@ -13648,6 +13648,16 @@
 
 fi
 
+ac_fn_c_check_type "$LINENO" "id_t" "ac_cv_type_id_t" "$ac_includes_default"
+if test "x$ac_cv_type_id_t" = xyes
+then :
+
+else $as_nop
+
+printf "%s\n" "#define id_t int" >>confdefs.h
+
+fi
+
 
 
 if test -n "$GCC";
@@ -15476,7 +15486,7 @@
 # report actual input values of CONFIG_FILES etc. instead of their
 # values after options handling.
 ac_log="
-This file was extended by fakeroot $as_me 1.35, which was
+This file was extended by fakeroot $as_me 1.35.1, which was
 generated by GNU Autoconf 2.71.  Invocation command line was
 
   CONFIG_FILES    = $CONFIG_FILES
@@ -15544,7 +15554,7 @@
 cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
 ac_cs_config='$ac_cs_config_escaped'
 ac_cs_version="\\
-fakeroot config.status 1.35
+fakeroot config.status 1.35.1
 configured by $0, generated by GNU Autoconf 2.71,
   with options \\"\$ac_cs_config\\"
 
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/fakeroot-1.35/configure.ac 
new/fakeroot-1.35.1/configure.ac
--- old/fakeroot-1.35/configure.ac      2024-06-05 21:24:39.000000000 +0200
+++ new/fakeroot-1.35.1/configure.ac    2024-06-25 02:24:32.000000000 +0200
@@ -1,5 +1,5 @@
 dnl Process this file with autoconf to produce a configure script.
-AC_INIT([fakeroot],[1.35],[cl...@debian.org],[fakeroot])
+AC_INIT([fakeroot],[1.35.1],[cl...@debian.org],[fakeroot])
 AC_PREREQ([2.71])
 AC_CONFIG_MACRO_DIR([build-aux])
 LT_PREREQ(2.1a)
@@ -111,6 +111,7 @@
 AC_CHECK_TYPE(mode_t, int)
 AC_CHECK_TYPE(off_t, long)
 AC_CHECK_TYPE(size_t, unsigned)
+AC_CHECK_TYPE(id_t, int)
 
 AH_TEMPLATE([FAKEROOT_ATTR], [for packed])
 if test -n "$GCC";
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/fakeroot-1.35/faked.c new/fakeroot-1.35.1/faked.c
--- old/fakeroot-1.35/faked.c   2024-06-05 21:24:39.000000000 +0200
+++ new/fakeroot-1.35.1/faked.c 2024-06-25 02:22:18.000000000 +0200
@@ -1078,14 +1078,59 @@
 void get_msg()
 {
   struct fake_msg buf;
+  struct fake_msg_buf fm = { 0 };
+  uint32_t k = 0;
+  uint32_t magic_candidate = 0;
+  uint8_t* ptr = NULL;
   int r = 0;
 
   if(debug)
     fprintf(stderr,"FAKEROOT: msg=%i, key=%li\n",msg_get,(long)msg_key);
   do {
-    r=msgrcv(msg_get,&buf,sizeof(struct fake_msg),0,0);
+    r=msgrcv(msg_get,&fm,sizeof(struct fake_msg_buf),0,0);
+
+    ptr = &fm;
+    for (k=0; k<16; k++) {
+      magic_candidate = *(uint32_t*)&ptr[k];
+      if (magic_candidate == FAKEROOT_MAGIC_LE || magic_candidate == 
FAKEROOT_MAGIC_BE) {
+        memcpy(&buf, &ptr[k], sizeof(buf));
+        break;
+      }
+    }
+
+    if (k == 16) {
+      fprintf(stderr,
+              "faked internal error: payload not recognized!\n");
+      continue;
+    }
+
+    /*
+      Use swapX here instead of ntoh/hton
+      that do nothing on big-endian machines
+    */
+#if   __BYTE_ORDER == __LITTLE_ENDIAN
+    if (magic_candidate == FAKEROOT_MAGIC_BE) {
+#elif   __BYTE_ORDER == __BIG_ENDIAN
+    if (magic_candidate == FAKEROOT_MAGIC_LE) {
+#endif
+         buf.id = bswapl(buf.id);
+         buf.pid = bswapl(buf.pid);
+         buf.serial = bswapl(buf.serial);
+         buf.st.uid = bswapl(buf.st.uid);
+         buf.st.gid = bswapl(buf.st.gid);
+         buf.st.ino = bswapll(buf.st.ino);
+         buf.st.dev = bswapll(buf.st.dev);
+         buf.st.rdev = bswapll(buf.st.rdev);
+         buf.st.mode = bswapl(buf.st.mode);
+         buf.st.nlink = bswapl(buf.st.nlink);
+         buf.remote = bswapl(0);
+         buf.xattr.buffersize = bswapl(buf.xattr.buffersize);
+         buf.xattr.flags_rc = bswapl(buf.xattr.flags_rc);
+    }
+
     if(debug)
-      fprintf(stderr,"FAKEROOT: r=%i, received message type=%li, 
message=%i\n",r,buf.mtype,buf.id);
+      fprintf(stderr,"FAKEROOT: r=%i, received message type=%li, 
message=%i\n",r,fm.mtype,buf.id);
+
     if(r!=-1) {
       buf.remote = 0;
       process_msg(&buf);
@@ -1521,14 +1566,20 @@
 # else /* !FAKEROOT_FAKENET */
       close_range(0, num_fds, 0);
 # endif
-#else /* ! HAVE_CLOSE_RANGE */
+      if (errno == ENOSYS) {
+#endif /* HAVE_CLOSE_RANGE */
+
       /* This is the child closing its file descriptors. */
       for (fl= 0; fl <= num_fds; ++fl)
 # ifdef FAKEROOT_FAKENET
        if (fl != sd)
 # endif /* FAKEROOT_FAKENET */
          close(fl);
-#endif
+
+#ifdef HAVE_CLOSE_RANGE
+     }
+#endif /* HAVE_CLOSE_RANGE */
+
       setsid();
     } else {
       printf("%li:%i\n",(long)FAKE_KEY,pid);
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/fakeroot-1.35/libfakeroot.c 
new/fakeroot-1.35.1/libfakeroot.c
--- old/fakeroot-1.35/libfakeroot.c     2024-01-21 17:55:13.000000000 +0100
+++ new/fakeroot-1.35.1/libfakeroot.c   2024-06-06 19:43:45.000000000 +0200
@@ -139,13 +139,6 @@
 #define INT_SEND_STAT(a,b) SEND_STAT(a,b,_STAT_VER)
 #define INT_SEND_GET_XATTR(a,b) SEND_GET_XATTR(a,b,_STAT_VER)
 #define INT_SEND_GET_STAT(a,b) SEND_GET_STAT(a,b)
-
-/* 10.10 uses id_t in getpriority/setpriority calls, so pretend
-   id_t is used everywhere, just happens to be int on some OSes */
-#ifndef _ID_T
-#define _ID_T
-typedef int id_t;
-#endif
 #endif
 
 #include <sys/types.h>
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/fakeroot-1.35/message.h new/fakeroot-1.35.1/message.h
--- old/fakeroot-1.35/message.h 2021-11-08 02:33:39.000000000 +0100
+++ new/fakeroot-1.35.1/message.h       2024-06-06 20:15:57.000000000 +0200
@@ -37,8 +37,33 @@
 #endif
 #endif /* !defined(sun) && !defined(_NETINET_IN_H) */
 
+/* Endianness-agnostic swappers from byteswap.h */
+#define bswaps(x) \
+  ((uint16_t) ((((x) >> 8) & 0xff) | (((x) & 0xff) << 8)))
+#define bswapl(x) \
+  ((((x) & 0xff000000u) >> 24) | (((x) & 0x00ff0000u) >> 8) \
+   | (((x) & 0x0000ff00u) << 8) | (((x) & 0x000000ffu) << 24))
+#define bswapll(x) \
+  ((((x) & 0xff00000000000000ull) >> 56) \
+   | (((x) & 0x00ff000000000000ull) >> 40) \
+   | (((x) & 0x0000ff0000000000ull) >> 24) \
+   | (((x) & 0x000000ff00000000ull) >> 8) \
+   | (((x) & 0x00000000ff000000ull) << 8) \
+   | (((x) & 0x0000000000ff0000ull) << 24) \
+   | (((x) & 0x000000000000ff00ull) << 40) \
+   | (((x) & 0x00000000000000ffull) << 56))
+
 #define FAKEROOTKEY_ENV "FAKEROOTKEY"
 
+/* The magic value must be positive itself and be still positive if
+ * it becomes a high-dword of an uint64_t. Otherwise msgsnd(2) on x32
+ * platform thinks mtype is 64-bit negative number and returns -EINVAL.
+ * It should be also asymmetric it is possible to detect the endianness
+ * of message
+ */
+#define FAKEROOT_MAGIC_LE 0x78787878
+#define FAKEROOT_MAGIC_BE 0x75757575
+
 typedef uint32_t func_id_t;
 
 typedef uint64_t fake_ino_t;
@@ -83,12 +108,12 @@
 #endif
 struct fake_msg {
 #ifndef FAKEROOT_FAKENET
-       long mtype; /* message type in SYSV message sending */
+       uint32_t magic; /* marker to detect cross-architecture mtype 
fluctuations */
 #endif
        func_id_t       id; /* the requested function */
 #ifndef FAKEROOT_FAKENET
        pid_t pid;
-       int serial;
+       int32_t serial;
 #endif
        struct fakestat st;
        struct fakexattr xattr;
@@ -97,5 +122,19 @@
 #if __SUNPRO_C
 #pragma pack()
 #endif
+
+#if __SUNPRO_C
+#pragma pack(4)
+#endif
+struct fake_msg_buf {
+#ifndef FAKEROOT_FAKENET
+       long mtype; /* message type in SYSV message sending */
+#endif
+       char msg[sizeof(struct fake_msg)];
+} FAKEROOT_ATTR(packed);
+
+#if __SUNPRO_C
+#pragma pack()
+#endif
 
 #endif

Reply via email to