Hello community,

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

Package is "psmisc"

Mon Jun 25 11:35:21 2018 rev:68 rq:618536 version:23.0

Changes:
--------
--- /work/SRC/openSUSE:Factory/psmisc/psmisc.changes    2018-05-23 
16:06:48.207032945 +0200
+++ /work/SRC/openSUSE:Factory/.psmisc.new/psmisc.changes       2018-06-25 
11:35:27.420858948 +0200
@@ -1,0 +2,7 @@
+Fri Jun 22 16:33:00 UTC 2018 - [email protected]
+
+- Modify patch 0001-Use-mountinfo-to-be-able-to-use-the-mount-identity.patch
+  to make fuser option -m <block_device> work even with mountinfo
+  (bsc#1098697)
+
+-------------------------------------------------------------------

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

Other differences:
------------------
++++++ psmisc.spec ++++++
--- /var/tmp/diff_new_pack.Uy1z3T/_old  2018-06-25 11:35:28.352824549 +0200
+++ /var/tmp/diff_new_pack.Uy1z3T/_new  2018-06-25 11:35:28.356824401 +0200
@@ -73,9 +73,10 @@
  sort -t : -k1,1 -u|\
  sed -r 's/:[0-9]+$//' > po/POTFILES.in
 autoreconf -fi
-CFLAGS="-D_GNU_SOURCE -D_DEFAULT_SOURCE ${RPM_OPT_FLAGS} -pipe"
+CFLAGS="-D_GNU_SOURCE -D_DEFAULT_SOURCE ${RPM_OPT_FLAGS} -pipe -fPIE"
 CXXFLAGS="$CFLAGS"
-export CFLAGS CXXFLAGS
+LDFLAGS=-pie
+export CFLAGS CXXFLAGS LDFLAGS
 %configure     --disable-rpath \
        --with-gnu-ld           \
        --enable-selinux        \

++++++ 0001-Use-mountinfo-to-be-able-to-use-the-mount-identity.patch ++++++
--- /var/tmp/diff_new_pack.Uy1z3T/_old  2018-06-25 11:35:28.372823811 +0200
+++ /var/tmp/diff_new_pack.Uy1z3T/_new  2018-06-25 11:35:28.372823811 +0200
@@ -1,4 +1,4 @@
-From d7487838d0c79bd007e63e9ba9f7933cec40e3c9 Mon Sep 17 00:00:00 2001
+From 28805c3dda0ce9c78f046974454c0bb8dfee615b Mon Sep 17 00:00:00 2001
 From: Werner Fink <[email protected]>
 Date: Thu, 29 Jun 2017 15:18:28 +0200
 Subject: [PATCH] Use mountinfo to be able to use the mount identity
@@ -14,11 +14,11 @@
 Signed-off-by: Werner Fink <[email protected]>
 ---
  configure.ac                       |  18 +-
- src/fuser.c                        | 528 +++++++++++++++++++++++++++----------
+ src/fuser.c                        | 540 +++++++++++++++++++++--------
  src/fuser.h                        |  19 +-
  testsuite/Makefile.am              |   3 +-
  testsuite/killall.test/killall.exp |   4 +
- 5 files changed, 424 insertions(+), 148 deletions(-)
+ 5 files changed, 436 insertions(+), 148 deletions(-)
 
 diff --git configure.ac configure.ac
 index 176a2fc..d8d3366 100644
@@ -64,7 +64,7 @@
  dnl Checks for typedefs, structures, and compiler characteristics.
  AC_C_CONST
 diff --git src/fuser.c src/fuser.c
-index 31ef30c..a204f08 100644
+index 31ef30c..e5337cd 100644
 --- src/fuser.c
 +++ src/fuser.c
 @@ -32,6 +32,10 @@
@@ -227,11 +227,11 @@
               (unsigned long)this_name->st.st_dev,
 -             (unsigned long)this_name->st.st_ino);
 +             (unsigned long)this_name->st.st_ino,
-+             mountinfo.id, mountinfo.isnfs ? "yes" : "no");
++             mountinfo->id, mountinfo->isnfs ? "yes" : "no");
  #endif                                /* DEBUG */
        add_inode(ino_list, this_name, this_name->st.st_dev,
                  this_name->st.st_ino);
-@@ -501,11 +515,39 @@ parse_mounts(struct names *this_name, struct device_list 
**dev_list,
+@@ -501,11 +515,51 @@ parse_mounts(struct names *this_name, struct device_list 
**dev_list,
             const opt_type opts)
  {
        dev_t match_device;
@@ -247,7 +247,17 @@
 +      count = 0;
 +      list_for_each(ptr, &mntinfo) {
 +              mntinfo_t *mnt = list_entry(ptr, mntinfo_t);
-+              if (match_device != mnt->dev || this_name->mnt_id != mnt->id)
++              if (match_device != mnt->dev)
++                      continue;
++              if (S_ISBLK(this_name->st.st_mode)) {
++                      /* Skip mount IDs check if a block device
++                       * was specified */
++                      this_name->mnt_id = mnt->id;
++                      add_device(dev_list, this_name, match_device);
++                      count++;
++                      continue;
++              }
++              if (this_name->mnt_id != mnt->id)
 +                      continue;
 +              if (!mountinfo)
 +                      mountinfo = mnt;
@@ -264,14 +274,16 @@
 +              errno = ENOTUNIQ;
 +              fprintf(stderr,
 +                      _("The device %u:%u is not unique. Please change!\n"),
-+                      major(mountinfo->dev), minor(mountinfo->dev));
++                      major(match_device), minor(match_device));
 +              /* return -1 */
 +      }
++      if (S_ISBLK(this_name->st.st_mode))
++              return 0;
 +      this_name->mnt_id = mountinfo->id;
        add_device(dev_list, this_name, match_device);
        return 0;
  }
-@@ -620,7 +662,7 @@ int parse_inet(struct names *this_name, struct 
ip_connections **ip_list)
+@@ -620,7 +674,7 @@ int parse_inet(struct names *this_name, struct 
ip_connections **ip_list)
                        fprintf(stderr, _("Unknown local port AF %d\n"),
                                res->ai_family);
                        freeaddrinfo(res);
@@ -280,7 +292,7 @@
                        return -1;
                }
                freeaddrinfo(res);
-@@ -683,10 +725,12 @@ int parse_inet(struct names *this_name, struct 
ip_connections **ip_list)
+@@ -683,10 +737,12 @@ int parse_inet(struct names *this_name, struct 
ip_connections **ip_list)
                                        break;
  #endif
                                }
@@ -296,7 +308,7 @@
        }
        return 1;
  }
-@@ -1161,16 +1205,11 @@ int main(int argc, char *argv[])
+@@ -1161,16 +1217,11 @@ int main(int argc, char *argv[])
                                        skip_argv = 1;
                                        //while(option != '\0') option++;
                                        if (strcmp(argv[argc_cnt], "tcp") == 0)
@@ -318,7 +330,7 @@
                                        else
                                                usage(_
                                                      ("Invalid namespace 
name"));
-@@ -1210,7 +1249,7 @@ int main(int argc, char *argv[])
+@@ -1210,7 +1261,7 @@ int main(int argc, char *argv[])
                }
  
  #if defined(WITH_MOUNTINFO_LIST)
@@ -327,7 +339,7 @@
                        thestat = mntstat;
  #endif
                /* an option */
-@@ -1524,7 +1563,7 @@ print_matches(struct names *names_head, const opt_type 
opts,
+@@ -1524,7 +1575,7 @@ print_matches(struct names *names_head, const opt_type 
opts,
  
  }
  
@@ -336,7 +348,7 @@
  {
        char pathname[256];
        struct stat *st;
-@@ -1536,6 +1575,15 @@ static struct stat *get_pidstat(const pid_t pid, const 
char *filename)
+@@ -1536,6 +1587,15 @@ static struct stat *get_pidstat(const pid_t pid, const 
char *filename)
                free(st);
                return NULL;
        }
@@ -352,7 +364,7 @@
        return st;
  }
  
-@@ -1550,18 +1598,19 @@ check_dir(const pid_t pid, const char *dirname, struct 
device_list *dev_head,
+@@ -1550,18 +1610,19 @@ check_dir(const pid_t pid, const char *dirname, struct 
device_list *dev_head,
        struct inode_list *ino_tmp;
        struct device_list *dev_tmp;
        struct unixsocket_list *sock_tmp;
@@ -377,7 +389,7 @@
                         pid, dirname, direntry->d_name);
  
                if (timeout(thestat, filepath, &st, 5) != 0) {
-@@ -1586,9 +1635,12 @@ check_dir(const pid_t pid, const char *dirname, struct 
device_list *dev_head,
+@@ -1586,9 +1647,12 @@ check_dir(const pid_t pid, const char *dirname, struct 
device_list *dev_head,
                             dev_tmp = dev_tmp->next) {
                                if (thedev != dev_tmp->device)
                                        continue;
@@ -392,7 +404,7 @@
                                        add_matched_proc(dev_tmp->name,
                                                         pid, uid,
                                                         ACCESS_FILEWR |
-@@ -1610,9 +1662,10 @@ check_dir(const pid_t pid, const char *dirname, struct 
device_list *dev_head,
+@@ -1610,9 +1674,10 @@ check_dir(const pid_t pid, const char *dirname, struct 
device_list *dev_head,
                                        continue;
                                }
                                if (st.st_ino == ino_tmp->inode) {
@@ -405,7 +417,7 @@
                                                add_matched_proc(ino_tmp->name,
                                                                 pid, uid,
                                                                 ACCESS_FILEWR |
-@@ -1641,18 +1694,30 @@ check_map(const pid_t pid, const char *filename,
+@@ -1641,18 +1706,30 @@ check_map(const pid_t pid, const char *filename,
        FILE *fp;
        unsigned long long tmp_inode;
        unsigned int tmp_maj, tmp_min;
@@ -441,7 +453,7 @@
                                        add_matched_proc(dev_tmp->name, pid,
                                                         uid, access);
                        for (ino_tmp = ino_head; ino_tmp != NULL;
-@@ -1661,7 +1726,8 @@ check_map(const pid_t pid, const char *filename,
+@@ -1661,7 +1738,8 @@ check_map(const pid_t pid, const char *filename,
                                    && ino_tmp->inode == tmp_inode)
                                        add_matched_proc(ino_tmp->name, pid,
                                                         uid, access);
@@ -451,7 +463,7 @@
        }
        fclose(fp);
  }
-@@ -1682,6 +1748,7 @@ static uid_t getpiduid(const pid_t pid)
+@@ -1682,6 +1760,7 @@ static uid_t getpiduid(const pid_t pid)
   * fill_unix_cache : Create a list of Unix sockets
   *   This list is used later for matching purposes
   */
@@ -459,7 +471,7 @@
  void fill_unix_cache(struct unixsocket_list **unixsocket_head)
  {
        FILE *fp;
-@@ -1698,6 +1765,8 @@ void fill_unix_cache(struct unixsocket_list 
**unixsocket_head)
+@@ -1698,6 +1777,8 @@ void fill_unix_cache(struct unixsocket_list 
**unixsocket_head)
        while (fgets(line, BUFSIZ, fp) != NULL) {
                char *path;
                char *scanned_path = NULL;
@@ -468,7 +480,7 @@
                if (sscanf(line, "%*x: %*x %*x %*x %*x %*d %d %ms",
                           &scanned_inode, &scanned_path) != 2) {
                        if (scanned_path)
-@@ -1713,6 +1782,8 @@ void fill_unix_cache(struct unixsocket_list 
**unixsocket_head)
+@@ -1713,6 +1794,8 @@ void fill_unix_cache(struct unixsocket_list 
**unixsocket_head)
                        free(path);
                        continue;
                }
@@ -477,7 +489,7 @@
                if ((newsocket = (struct unixsocket_list *)
                     malloc(sizeof(struct unixsocket_list))) == NULL) {
                        free(path);
-@@ -1721,6 +1792,7 @@ void fill_unix_cache(struct unixsocket_list 
**unixsocket_head)
+@@ -1721,6 +1804,7 @@ void fill_unix_cache(struct unixsocket_list 
**unixsocket_head)
                newsocket->sun_name = strdup(scanned_path);
                newsocket->inode = st.st_ino;
                newsocket->dev = st.st_dev;
@@ -485,7 +497,7 @@
                newsocket->net_inode = scanned_inode;
                newsocket->next = *unixsocket_head;
                *unixsocket_head = newsocket;
-@@ -1733,6 +1805,7 @@ void fill_unix_cache(struct unixsocket_list 
**unixsocket_head)
+@@ -1733,6 +1817,7 @@ void fill_unix_cache(struct unixsocket_list 
**unixsocket_head)
  /*
   * Free up the list of Unix sockets
   */
@@ -493,7 +505,7 @@
  void clear_unix_cache(struct unixsocket_list **unixsocket_head)
  {
        while(*unixsocket_head != NULL) {
-@@ -1900,30 +1973,22 @@ scan_mounts(struct names *names_head, struct 
inode_list *ino_head,
+@@ -1900,30 +1985,22 @@ scan_mounts(struct names *names_head, struct 
inode_list *ino_head,
  {
        struct device_list *dev_tmp;
        struct inode_list *ino_tmp;
@@ -534,7 +546,7 @@
                                add_special_proc(dev_tmp->name, PTYPE_MOUNT, 0,
                                                 find_mountp);
                }
-@@ -1935,7 +2000,6 @@ scan_mounts(struct names *names_head, struct inode_list 
*ino_head,
+@@ -1935,7 +2012,6 @@ scan_mounts(struct names *names_head, struct inode_list 
*ino_head,
                                                 find_mountp);
                }
        }
@@ -542,7 +554,7 @@
  }
  
  static void
-@@ -1985,16 +2049,42 @@ scan_swaps(struct names *names_head, struct inode_list 
*ino_head,
+@@ -1985,16 +2061,42 @@ scan_swaps(struct names *names_head, struct inode_list 
*ino_head,
        fclose(fp);
  }
  
@@ -588,7 +600,7 @@
  {
        list_t *ptr, *tmp;
  
-@@ -2005,72 +2095,232 @@ static void clear_mntinfo(void)
+@@ -2005,72 +2107,232 @@ static void clear_mntinfo(void)
        }
  }
  
@@ -668,7 +680,12 @@
 +      char line[BUFSIZ];
 +      FILE *fp;
 +      int mnt_id = 0, flags = 0;
-+
+ 
+-      /* Sort mount points accordingly to the reverse mount order */
+-      initial(&sort);
+-      for (mid = 1; mid <= max; mid++) {
+-              list_t *ptr, *tmp;
+-              list_for_each_safe(ptr, tmp, &mntinfo) {
 +      snprintf(pathname, 256, "/proc/%d/fdinfo/%s", pid, fd);
 +      if ((fp = fopen(pathname, "r")) == NULL)
 +               goto out;
@@ -747,12 +764,7 @@
 +      int ret = -1;
 +
 +      *mountinfo = NULL;
- 
--      /* Sort mount points accordingly to the reverse mount order */
--      initial(&sort);
--      for (mid = 1; mid <= max; mid++) {
--              list_t *ptr, *tmp;
--              list_for_each_safe(ptr, tmp, &mntinfo) {
++
 +#if defined(HAS_NAME_TO_HANDLE_AT)
 +      if (mnt_id >= 0) {
 +              list_t *ptr;
@@ -834,11 +846,11 @@
 -                      if (mid != mnt->parid)
 +
 +                      if (nlen != mnt->nlen)
-                               continue;
--                      move_head(ptr, &sort);
++                              continue;
 +
 +                      if (strcmp(use, mnt->mpoint))
-+                              continue;
+                               continue;
+-                      move_head(ptr, &sort);
 +
 +                      ret = 0;
 +                      errno = 0;
@@ -865,7 +877,7 @@
  /*
   * Determine device of links below /proc/
   */
-@@ -2078,8 +2328,7 @@ static int mntstat(const char *path, struct stat *buf)
+@@ -2078,8 +2340,7 @@ static int mntstat(const char *path, struct stat *buf)
  {
        char name[PATH_MAX + 1];
        const char *use;
@@ -875,7 +887,7 @@
  
        if ((use = realpath(path, name)) == NULL || *use != '/')
        {
-@@ -2091,27 +2340,26 @@ static int mntstat(const char *path, struct stat *buf)
+@@ -2091,27 +2352,26 @@ static int mntstat(const char *path, struct stat *buf)
                errno = 0;
                return stat(path, buf);
        }
@@ -1030,5 +1042,5 @@
  set test "killall list signals"
  spawn $killall -l
 -- 
-2.12.3
+2.17.1
 

++++++ psmisc-23.0.dif ++++++
--- /var/tmp/diff_new_pack.Uy1z3T/_old  2018-06-25 11:35:28.396822925 +0200
+++ /var/tmp/diff_new_pack.Uy1z3T/_new  2018-06-25 11:35:28.396822925 +0200
@@ -5,7 +5,7 @@
  3 files changed, 7 insertions(+), 4 deletions(-)
 
 --- configure.ac
-+++ configure.ac       2017-07-05 13:18:18.806270222 +0000
++++ configure.ac       2018-06-22 16:47:02.758993991 +0000
 @@ -45,7 +45,7 @@ fi
  if test "$enable_timeout_stat" = "static"; then
    AC_DEFINE([WITH_TIMEOUT_STAT], [2], [Use timeout on stat calls])
@@ -25,7 +25,7 @@
  AC_CHECK_MEMBERS([struct pt_regs.orig_gpr3,
                struct pt_regs.gpr], [],[], [#include <linux/ptrace.h>])
 --- doc/Makefile.am
-+++ doc/Makefile.am    2017-07-05 13:18:18.806270222 +0000
++++ doc/Makefile.am    2018-06-22 16:47:02.842992443 +0000
 @@ -1,5 +1,5 @@
  
 -man_MANS = killall.1 peekfd.1 prtstat.1 pstree.1
@@ -34,8 +34,8 @@
  
  if WANT_FUSER
 --- src/fuser.c
-+++ src/fuser.c        2017-07-05 13:18:18.806270222 +0000
-@@ -1085,6 +1085,7 @@ int main(int argc, char *argv[])
++++ src/fuser.c        2018-06-22 16:47:02.926990894 +0000
+@@ -1097,6 +1097,7 @@ int main(int argc, char *argv[])
        struct option *optr;
        char *nsptr;
        int skip_argv;
@@ -43,7 +43,7 @@
  
        struct option options[] = {
                {"all", 0, NULL, 'a'},
-@@ -1128,6 +1129,7 @@ int main(int argc, char *argv[])
+@@ -1140,6 +1141,7 @@ int main(int argc, char *argv[])
  #endif
        atexit(atexit_free_lists);
  
@@ -51,7 +51,7 @@
        for (argc_cnt = 1; argc_cnt < argc; argc_cnt++) {
                current_argv = argv[argc_cnt];
                if (current_argv[0] == '-') {   /* its an option */
-@@ -1273,6 +1275,7 @@ int main(int argc, char *argv[])
+@@ -1285,6 +1287,7 @@ int main(int argc, char *argv[])
                        }
                }
                this_name->matched_procs = NULL;
@@ -59,7 +59,7 @@
                if (opts & (OPT_MOUNTS | OPT_ISMOUNTPOINT)
                    && this_name->name_space != NAMESPACE_FILE) {
                        free(this_name);
-@@ -1326,7 +1329,7 @@ int main(int argc, char *argv[])
+@@ -1338,7 +1341,7 @@ int main(int argc, char *argv[])
                        names_tail->next = this_name;
                names_tail = this_name;
        }                       /* for across the argvs */


Reply via email to