Script 'mail_helper' called by obssrc Hello community, here is the log from the commit of package psmisc for openSUSE:Factory checked in at 2021-05-18 18:26:43 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/psmisc (Old) and /work/SRC/openSUSE:Factory/.psmisc.new.2988 (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "psmisc" Tue May 18 18:26:43 2021 rev:78 rq:893186 version:23.3 Changes: -------- --- /work/SRC/openSUSE:Factory/psmisc/psmisc.changes 2021-03-10 08:52:01.842565416 +0100 +++ /work/SRC/openSUSE:Factory/.psmisc.new.2988/psmisc.changes 2021-05-18 18:26:58.866822330 +0200 @@ -1,0 +2,7 @@ +Fri May 7 14:53:08 UTC 2021 - Dr. Werner Fink <wer...@suse.de> + +- Change patch 0001-Use-mountinfo-to-be-able-to-use-the-mount-identity.patch + * Fix bsc#1185208 to make private mount namespaces work as well + as to distinguish NFS mounts from same remote device share. + +------------------------------------------------------------------- ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ psmisc.spec ++++++ --- /var/tmp/diff_new_pack.sdYEZ8/_old 2021-05-18 18:26:59.370820145 +0200 +++ /var/tmp/diff_new_pack.sdYEZ8/_new 2021-05-18 18:26:59.374820128 +0200 @@ -23,6 +23,8 @@ BuildRequires: gcc-c++ BuildRequires: gettext-devel BuildRequires: glibc-devel +BuildRequires: libcap-devel +BuildRequires: libcap-progs BuildRequires: libselinux-devel BuildRequires: linux-glibc-devel >= 4.12 BuildRequires: ncurses-devel @@ -94,13 +96,16 @@ %endif %find_lang psmisc +%post +setcap cap_dac_read_search=ep %{_bindir}/fuser + %files %defattr (-,root,root,755) %license COPYING %if !0%{?usrmerged} /bin/fuser %endif -%{_bindir}/fuser +%verify(not mode caps) %{_bindir}/fuser %{_bindir}/killall %ifarch %have_peekfd %{_bindir}/peekfd ++++++ 0001-Use-mountinfo-to-be-able-to-use-the-mount-identity.patch ++++++ ++++ 634 lines (skipped) ++++ between /work/SRC/openSUSE:Factory/psmisc/0001-Use-mountinfo-to-be-able-to-use-the-mount-identity.patch ++++ and /work/SRC/openSUSE:Factory/.psmisc.new.2988/0001-Use-mountinfo-to-be-able-to-use-the-mount-identity.patch ++++++ 0002-Use-new-statx-2-system-call-to-avoid-hangs-on-NFS.patch ++++++ --- /var/tmp/diff_new_pack.sdYEZ8/_old 2021-05-18 18:26:59.406819989 +0200 +++ /var/tmp/diff_new_pack.sdYEZ8/_new 2021-05-18 18:26:59.406819989 +0200 @@ -1,19 +1,19 @@ -From 9f3910df62bcc1f726b8e84f9ffc40c4d7916eac Mon Sep 17 00:00:00 2001 +From f2ada8ea7939bc8f607d88a10c92d5bb96a700b8 Mon Sep 17 00:00:00 2001 From: Werner Fink <wer...@suse.de> -Date: Thu, 14 Jan 2021 11:37:46 +0100 +Date: Fri, 7 May 2021 16:36:28 +0200 Subject: [PATCH] Use new statx(2) system call to avoid hangs on NFS Signed-off-by: Werner Fink <wer...@suse.de> --- Makefile.am | 4 - - configure.ac | 38 +++++---------- - src/fuser.c | 98 +++++++++----------------------------- + configure.ac | 24 +++++---- + src/fuser.c | 102 ++++++++++------------------------------ src/statx.c | 149 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ src/statx.h | 68 ++++++++++++++++++++++++++ - 5 files changed, 258 insertions(+), 99 deletions(-) + 5 files changed, 260 insertions(+), 87 deletions(-) --- Makefile.am -+++ Makefile.am 2021-01-14 11:29:22.011223930 +0000 ++++ Makefile.am 2021-05-07 15:04:28.611513529 +0000 @@ -64,8 +64,8 @@ src_fuser_SOURCES = \ src/fuser.h \ src/lists.h @@ -26,29 +26,8 @@ src_fuser_LDADD = @LIBINTL@ src_killall_SOURCES = src/killall.c src/comm.h src/signals.c src/signals.h src/i18n.h --- configure.ac -+++ configure.ac 2021-01-14 11:29:22.011223930 +0000 -@@ -30,20 +30,6 @@ if test "$enable_selinux" = "yes"; then - fi - AC_SUBST([SELINUX_LIB]) - --# Call fork before all stat calls to stop hanging on NFS mounts --AC_SUBST([WITH_TIMEOUT_STAT]) --AC_ARG_ENABLE([timeout_stat], -- [AS_HELP_STRING([--enable-timeout-stat], [Use a timeout on stat calls (optional with argument "static" for a static background process)])], -- [enable_timeout_stat=$enableval], -- [enable_timeout_stat="no"]) --if test "$enable_timeout_stat" = "yes"; then -- AC_DEFINE([WITH_TIMEOUT_STAT], [1], [Use timeout on stat calls]) --fi --if test "$enable_timeout_stat" = "static"; then -- AC_DEFINE([WITH_TIMEOUT_STAT], [2], [Use timeout on stat calls]) --fi --AM_CONDITIONAL([WANT_TIMEOUT_STAT], [test "$enable_timeout_stat" = "static"]) -- - # Use /proc/self/mountinfo if available - if test -e /proc/self/mountinfo ; then - AC_DEFINE([HAS_MOUNTINFO], [1], [System has /proc/self/mountinfo which can used instead /proc(/self)/mounts]) -@@ -57,16 +43,20 @@ fi ++++ configure.ac 2021-05-07 15:04:28.623513310 +0000 +@@ -57,16 +57,20 @@ fi AC_CHECK_FUNC([name_to_handle_at],[ AC_DEFINE([HAS_NAME_TO_HANDLE_AT], [1], [System has name_to_handle_at(2) system call])]) @@ -80,8 +59,8 @@ # Enable hardened compile and link flags AC_ARG_ENABLE([harden_flags], --- src/fuser.c -+++ src/fuser.c 2021-01-14 11:30:10.750278604 +0000 -@@ -63,7 +63,7 @@ ++++ src/fuser.c 2021-05-07 15:04:28.627513237 +0000 +@@ -61,7 +61,7 @@ #include "fuser.h" #include "signals.h" #include "i18n.h" @@ -90,9 +69,9 @@ #include "comm.h" //#define DEBUG 1 -@@ -118,10 +118,6 @@ static void clear_mntinfo(void) __attrib - static void init_mntinfo(void) __attribute__ ((__constructor__)); - static int get_fdinfo(const pid_t pid, const char *fd, struct fdinfo *info); +@@ -119,10 +119,6 @@ static int get_fdinfo(const pid_t pid, c + static int get_mountid(const char *path); + #endif static int find_mountpoint(const char *path, mntinfo_t **mountinfo); -#if defined(WITH_MOUNTINFO_LIST) -static int mntstat(const char *path, struct stat *buf); @@ -101,7 +80,7 @@ static char *expandpath(const char *path); static struct unixsocket_list *unixsockets = NULL; static struct names *names_head = NULL, *names_tail = NULL; -@@ -509,7 +505,7 @@ int parse_file(struct names *this_name, +@@ -510,7 +506,7 @@ int parse_file(struct names *this_name, free(this_name->filename); this_name->filename = strdup(new); } @@ -110,7 +89,7 @@ find_mountpoint(this_name->filename, &mountinfo) != 0) { if (errno == ENOENT) fprintf(stderr, -@@ -1245,9 +1241,7 @@ int main(int argc, char *argv[]) +@@ -1244,9 +1240,7 @@ int main(int argc, char *argv[]) opts |= OPT_INTERACTIVE; break; case 'I': @@ -120,7 +99,7 @@ break; case 'k': opts |= OPT_KILL; -@@ -1313,10 +1307,11 @@ int main(int argc, char *argv[]) +@@ -1312,10 +1306,11 @@ int main(int argc, char *argv[]) continue; } @@ -135,7 +114,7 @@ /* an option */ /* Not an option, must be a file specification */ if ((this_name = malloc(sizeof(struct names))) == NULL) -@@ -1636,7 +1631,7 @@ static struct stat *get_pidstat(const pi +@@ -1635,7 +1630,7 @@ static struct stat *get_pidstat(const pi if ((st = (struct stat *)malloc(sizeof(struct stat))) == NULL) return NULL; snprintf(pathname, 256, "/proc/%d/%s", pid, filename); @@ -144,7 +123,7 @@ free(st); return NULL; } -@@ -1683,7 +1678,7 @@ check_dir(const pid_t pid, const char *d +@@ -1681,7 +1676,7 @@ check_dir(const pid_t pid, const char *d snprintf(filepath, sizeof filepath - 1, "/proc/%d/%s/%s", pid, dirname, direntry->d_name); @@ -153,7 +132,7 @@ if (errno != ENOENT && errno != ENOTDIR) { fprintf(stderr, _("Cannot stat file %s: %s\n"), filepath, strerror(errno)); -@@ -1740,7 +1735,7 @@ check_dir(const pid_t pid, const char *d +@@ -1747,7 +1742,7 @@ check_dir(const pid_t pid, const char *d if (thedev != ino_tmp->device) continue; if (!st.st_ino @@ -162,7 +141,7 @@ fprintf(stderr, _("Cannot stat file %s: %s\n"), filepath, strerror(errno)); -@@ -1838,11 +1833,11 @@ static uid_t getpiduid(const pid_t pid) +@@ -1845,11 +1840,11 @@ static uid_t getpiduid(const pid_t pid) if (asprintf(&pathname, "/proc/%d", pid) < 0) return 0; @@ -178,7 +157,7 @@ return st.st_uid; } -@@ -1880,7 +1875,7 @@ void fill_unix_cache(struct unixsocket_l +@@ -1887,7 +1882,7 @@ void fill_unix_cache(struct unixsocket_l path = scanned_path; if (*scanned_path == '@') scanned_path++; @@ -187,7 +166,7 @@ free(path); continue; } -@@ -2015,7 +2010,7 @@ static dev_t find_net_dev(void) +@@ -2022,7 +2017,7 @@ static dev_t find_net_dev(void) fprintf(stderr, _("Cannot open a network socket.\n")); return -1; } @@ -196,7 +175,7 @@ fprintf(stderr, _("Cannot find socket's device number.\n")); close(skt); return -1; -@@ -2052,7 +2047,7 @@ scan_knfsd(struct names *names_head, str +@@ -2059,7 +2054,7 @@ scan_knfsd(struct names *names_head, str if ((find_space = strpbrk(line, " \t")) == NULL) continue; *find_space = '\0'; @@ -205,7 +184,7 @@ continue; } /* Scan the devices */ -@@ -2086,7 +2081,7 @@ scan_mounts(struct names *names_head, st +@@ -2093,7 +2088,7 @@ scan_mounts(struct names *names_head, st mntinfo_t *mnt = list_entry(ptr, mntinfo_t); const char *find_mountp = mnt->mpoint; @@ -214,7 +193,7 @@ continue; /* Scan the devices */ -@@ -2136,7 +2131,7 @@ scan_swaps(struct names *names_head, str +@@ -2143,7 +2138,7 @@ scan_swaps(struct names *names_head, str if (*find_space == '\0') continue; } @@ -223,7 +202,7 @@ continue; } /* Scan the devices */ -@@ -2228,10 +2223,10 @@ init_mntinfo(void) +@@ -2240,10 +2235,10 @@ init_mntinfo(void) &mid, &parid, &maj, &min, &mpoint[0], &type[0], &devname[0]) == 7) { struct stat st; mntinf = add_mntinfo(mpoint, type, mid, parid, makedev(maj, min)); @@ -236,7 +215,7 @@ mntinf->dev = st.st_dev; /* stat(2) on binary does not see subvol dev */ } } -@@ -2243,7 +2238,7 @@ init_mntinfo(void) +@@ -2255,7 +2250,7 @@ init_mntinfo(void) parid = -1; while (fscanf (mnt, "%s %s %s %*[^\n]", &devname[0], &mpoint[0], &type[0]) == 3) { struct stat st; @@ -245,7 +224,7 @@ if (errno != EACCES) { fprintf(stderr, _("Cannot stat %s: %s\n"), mpoint, strerror(errno)); -@@ -2252,7 +2247,7 @@ init_mntinfo(void) +@@ -2264,7 +2259,7 @@ init_mntinfo(void) st.st_dev = (dev_t)-1; } mntinf = add_mntinfo(mpoint, type, mid++, parid, st.st_dev); @@ -254,7 +233,25 @@ if (st.st_rdev != 0 && mntinf->dev != st.st_rdev) mntinf->vol = st.st_rdev; } -@@ -2302,7 +2297,7 @@ out: +@@ -2288,7 +2283,7 @@ get_fdinfo(const pid_t pid, const char * + struct stat st; + + if (!mynamespace) { +- if (stat("/proc/self/ns/mnt", &st) != 0) { ++ if (statn("/proc/self/ns/mnt", STATX_INO, &st) != 0) { + fprintf(stderr, _("Cannot stat %s: %s\n"), + "/proc/self/ns/mnt", strerror(errno)); + exit(1); +@@ -2323,7 +2318,7 @@ get_fdinfo(const pid_t pid, const char * + out: + # if defined(HAS_NAME_TO_HANDLE_AT) + snprintf(pathname, 256, "/proc/%d/ns/mnt", pid); +- if (stat(pathname, &st) == 0 && mynamespace != st.st_ino) { ++ if (statn(pathname, STATX_INO, &st) == 0 && mynamespace != st.st_ino) { + char *realname; + snprintf(pathname, 256, "/proc/%d/fd/%s", pid, fd); + realname = expandpath(pathname); +@@ -2338,7 +2333,7 @@ out: struct stat lst; snprintf(pathname, 256, "/proc/%d/fd/%s", pid, fd); @@ -263,7 +260,7 @@ if (lst.st_mode & S_IWUSR) info->flags |= O_WRONLY; ret++; -@@ -2375,7 +2370,7 @@ find_mountpoint(const char *path, mntinf +@@ -2411,7 +2406,7 @@ find_mountpoint(const char *path, mntinf /* could be a chroot or a container */ @@ -272,7 +269,7 @@ if (errno != EACCES) { fprintf(stderr, _("Cannot stat %s: %s\n"), path, strerror(errno)); -@@ -2407,7 +2402,7 @@ find_mountpoint(const char *path, mntinf +@@ -2443,7 +2438,7 @@ find_mountpoint(const char *path, mntinf /* could be a chroot or a container */ @@ -281,7 +278,7 @@ if (errno != EACCES) { fprintf(stderr, _("Cannot stat %s: %s\n"), use, strerror(errno)); -@@ -2445,49 +2440,6 @@ out: +@@ -2481,49 +2476,6 @@ out: return ret; } @@ -332,7 +329,7 @@ * Somehow the realpath(3) glibc function call, nevertheless * it avoids lstat(2) system calls. --- src/statx.c -+++ src/statx.c 2021-01-14 11:29:22.015223853 +0000 ++++ src/statx.c 2021-05-07 15:04:28.627513237 +0000 @@ -0,0 +1,149 @@ +/* + * statx.c - Map modern statx(2) system call to older stat(2), lstat(2), @@ -484,7 +481,7 @@ + return ret; +} --- src/statx.h -+++ src/statx.h 2021-01-14 11:29:22.019223776 +0000 ++++ src/statx.h 2021-05-07 15:04:28.627513237 +0000 @@ -0,0 +1,68 @@ +/* + * statx.h - Map modern statx(2) system call to older stat(2), lstat(2), ++++++ psmisc-v23.3.dif ++++++ --- /var/tmp/diff_new_pack.sdYEZ8/_old 2021-05-18 18:26:59.426819903 +0200 +++ /var/tmp/diff_new_pack.sdYEZ8/_new 2021-05-18 18:26:59.426819903 +0200 @@ -5,7 +5,7 @@ --- configure.ac +++ configure.ac 2021-01-14 11:31:31.640709812 +0000 -@@ -129,7 +129,7 @@ AC_CHECK_MEMBERS([struct user_regs_struc +@@ -145,7 +145,7 @@ AC_CHECK_MEMBERS([struct user_regs_struc struct user_regs_struct.rdi, struct user_regs_struct.rsi, struct user_regs_struct.rdx], [],[], @@ -16,7 +16,7 @@ struct pt_regs.gpr], [],[], [#include <linux/ptrace.h>]) --- src/fuser.c +++ src/fuser.c 2021-01-14 11:31:31.640709812 +0000 -@@ -1146,6 +1146,7 @@ int main(int argc, char *argv[]) +@@ -1145,6 +1145,7 @@ int main(int argc, char *argv[]) struct option *optr; char *nsptr; int skip_argv; @@ -24,7 +24,7 @@ struct option options[] = { {"all", 0, NULL, 'a'}, -@@ -1189,6 +1190,7 @@ int main(int argc, char *argv[]) +@@ -1188,6 +1189,7 @@ int main(int argc, char *argv[]) #endif atexit(atexit_free_lists); @@ -32,7 +32,7 @@ for (argc_cnt = 1; argc_cnt < argc; argc_cnt++) { current_argv = argv[argc_cnt]; if (current_argv[0] == '-') { /* its an option */ -@@ -1333,6 +1335,7 @@ int main(int argc, char *argv[]) +@@ -1332,6 +1334,7 @@ int main(int argc, char *argv[]) } } this_name->matched_procs = NULL; @@ -40,7 +40,7 @@ if (opts & (OPT_MOUNTS | OPT_ISMOUNTPOINT) && this_name->name_space != NAMESPACE_FILE) { free(this_name); -@@ -1386,7 +1389,7 @@ int main(int argc, char *argv[]) +@@ -1385,7 +1388,7 @@ int main(int argc, char *argv[]) names_tail->next = this_name; names_tail = this_name; } /* for across the argvs */