Compare commits
129 Commits
| Author | SHA256 | Date | |
|---|---|---|---|
| 901ff98e97 | |||
| 506229d94d | |||
| eead6f72e0 | |||
| 339f49a3c4 | |||
| c9f0435823 | |||
| f2b48a0ece | |||
| d31b655628 | |||
| db05d2d75d | |||
| 1eede90fef | |||
| a9fef0aaca | |||
| 8a8bf4d464 | |||
| 3bb3c45610 | |||
| 1016dd6559 | |||
| 49a999dbb4 | |||
| 3299dbdae3 | |||
| b072ee32cd | |||
| 1377094aa9 | |||
| 485704d142 | |||
| 57fc58e4ed | |||
| 72018ee113 | |||
| 45fac0a3cd | |||
| 031614b488 | |||
| 94fb0e374e | |||
| 0b2e72f741 | |||
| f56d412b38 | |||
| d97bedd0b8 | |||
| 6234eb99bf | |||
| daff926003 | |||
| 242d0d8b2c | |||
| b322a5943e | |||
| 5ba5b482c5 | |||
| 6d6f134cc6 | |||
| b4c3a967e3 | |||
| 5e427c3b0c | |||
| 7bf55be6f1 | |||
| fc3e023bdf | |||
| e892524b9e | |||
| 6574fdb607 | |||
| 1afa3e8cb0 | |||
| 2d77066498 | |||
| d85a503ea2 | |||
| 46262c94da | |||
| 621f5beebc | |||
| 61cadd1707 | |||
| 4bdee1e73d | |||
| e02436581e | |||
| 704f312487 | |||
| 9e7dd4a0e4 | |||
| 78cdbd6d94 | |||
| 20054b1980 | |||
| cb7bffe831 | |||
| 49b5b93df8 | |||
| 0f183c9a65 | |||
| f7c9c45071 | |||
| e44eecab7f | |||
| cb3f27fce0 | |||
| 3f9f72dfb6 | |||
| 1a661c032f | |||
| 740d20db9c | |||
| 7a6c715d2f | |||
| b90d74132e | |||
| 6e088f8dc8 | |||
| 37fa270b2e | |||
| a17ff7c6af | |||
| 52bdb881f6 | |||
| 0a4e4eab6a | |||
| ea3a65873a | |||
| 7f1bb16a07 | |||
| 9f456e9441 | |||
| b4859a264f | |||
| b2ebdc9ee1 | |||
| 60a2c76a4a | |||
| 9f79714cad | |||
| 8c8f6ff951 | |||
| 89dcc40d73 | |||
| 8fe1002281 | |||
| 1ef6c17005 | |||
| 9d020b6adc | |||
| 5f48e639d4 | |||
| bca62beb80 | |||
| ed2762c1d2 | |||
| 4d7768b7cf | |||
| 20956c6fdb | |||
| 8a56621d12 | |||
| f4919ba329 | |||
| b6f3565ed5 | |||
| a711710ba6 | |||
| 46fe773cb7 | |||
| 082bd43f0b | |||
| 65ba96653a | |||
| 10457c8bc4 | |||
| f102c7b29d | |||
|
|
67cbb98b77 | ||
| cf45d9c0db | |||
|
|
e3ae996a9b | ||
| 4c1ca37150 | |||
|
|
1e78287b9b | ||
| 16141dd6ee | |||
|
|
6f8124013f | ||
| cb4f9c8c28 | |||
|
|
5f5421630d | ||
| 50658e7022 | |||
|
|
56b4c333d5 | ||
| 8380ca95a1 | |||
|
|
170b517095 | ||
| b9ed20f85d | |||
|
|
01c78c90ea | ||
| 3d58b16e78 | |||
|
|
ee4f649e46 | ||
| cf16fe735d | |||
| a72fc8d613 | |||
|
|
68bd0e367c | ||
| 94baa25e1a | |||
|
|
d6f7abdd92 | ||
| a73d0fedee | |||
|
|
d688d2087b | ||
| 44130af329 | |||
|
|
fa1ea75768 | ||
|
|
aa973aa8f3 | ||
|
|
46bb9fa7dd | ||
|
|
ab34d867f2 | ||
|
|
40afdd7a2a | ||
|
|
5fc42caf11 | ||
|
|
6bee248837 | ||
| 3153c439b1 | |||
|
|
202c4b3ada | ||
|
|
1308522862 | ||
|
|
ea28ec9239 | ||
| 7966c71021 |
1262
0001-Use-mountinfo-to-be-able-to-use-the-mount-identity.patch
Normal file
1262
0001-Use-mountinfo-to-be-able-to-use-the-mount-identity.patch
Normal file
File diff suppressed because it is too large
Load Diff
211
0001-fuser-Fix-expandpath.patch
Normal file
211
0001-fuser-Fix-expandpath.patch
Normal file
@@ -0,0 +1,211 @@
|
|||||||
|
From b61e3c44b636691d5d2d2519efc934eac03e0f22 Mon Sep 17 00:00:00 2001
|
||||||
|
From: Craig Small <csmall@dropbear.xyz>
|
||||||
|
Date: Sat, 3 May 2025 11:10:11 +1000
|
||||||
|
Subject: [PATCH] fuser: Fix expandpath
|
||||||
|
|
||||||
|
The function expandpath had some issues:
|
||||||
|
* It would fail if you looked at non-Unix sockets
|
||||||
|
* get_pidfd called it twice most times
|
||||||
|
* it would try to find symlinks in /proc/<PID>/fd
|
||||||
|
* it kept scanning /proc/self/net/unix over and over
|
||||||
|
|
||||||
|
This meant fuser ran really slow, and would never find
|
||||||
|
any TCP/UDP sockets (and probably anything else that wasn't
|
||||||
|
a normal file/directory or Unix socket).
|
||||||
|
|
||||||
|
The main changes are:
|
||||||
|
If we know we are looking at procfs, skip over scanning for
|
||||||
|
directories.
|
||||||
|
Use the already parsed unix sockets list
|
||||||
|
If we find a socket and its not a unix socket, return the orginal path
|
||||||
|
|
||||||
|
References:
|
||||||
|
commit 366b0071aa889d2620b78f1cf4e197771171aea8
|
||||||
|
issue #57
|
||||||
|
|
||||||
|
Signed-off-by: Craig Small <csmall@dropbear.xyz>
|
||||||
|
---
|
||||||
|
ChangeLog | 1 +
|
||||||
|
src/fuser.c | 73 +++++++++++++++++++----------------------------------
|
||||||
|
2 files changed, 27 insertions(+), 47 deletions(-)
|
||||||
|
|
||||||
|
|diff --git a/ChangeLog b/ChangeLog
|
||||||
|
|index 4222066..edf164e 100644
|
||||||
|
|--- a/ChangeLog
|
||||||
|
|+++ b/ChangeLog
|
||||||
|
|@@ -1,6 +1,7 @@
|
||||||
|
| Changes in NEXT
|
||||||
|
| ===============
|
||||||
|
| * fuser: Use mountinfo to distinguish NFS mounts !40
|
||||||
|
|+ * fuser: Make TCP/UDP sockets work again #57
|
||||||
|
| * killall,pstree: Use gettime instead of uptime Debian 1066090
|
||||||
|
| * pstree: Add -P to show path of exe !38
|
||||||
|
|
|
||||||
|
diff --git a/src/fuser.c b/src/fuser.c
|
||||||
|
index b31338e..d3622d6 100644
|
||||||
|
--- a/src/fuser.c
|
||||||
|
+++ b/src/fuser.c
|
||||||
|
@@ -134,7 +134,7 @@ static ino_t get_namespace(const pid_t pid);
|
||||||
|
static int get_mountid(const char *path);
|
||||||
|
#endif
|
||||||
|
static int find_mountpoint(const char *path, mntinfo_t **mountinfo);
|
||||||
|
-static char *expandpath(const char *path);
|
||||||
|
+static char *expandpath(const char *path, const bool isproc);
|
||||||
|
static struct unixsocket_list *unixsockets = NULL;
|
||||||
|
static struct names *names_head = NULL, *names_tail = NULL;
|
||||||
|
static struct ip_connections *tcp_connection_list = NULL;
|
||||||
|
@@ -541,7 +541,7 @@ int parse_file(
|
||||||
|
const opt_type opts)
|
||||||
|
{
|
||||||
|
mntinfo_t *mountinfo;
|
||||||
|
- char *new = expandpath(this_name->filename);
|
||||||
|
+ char *new = expandpath(this_name->filename, false);
|
||||||
|
if (new)
|
||||||
|
{
|
||||||
|
if (this_name->filename)
|
||||||
|
@@ -1722,7 +1722,7 @@ static struct stat *get_pidstat(
|
||||||
|
if (id)
|
||||||
|
{
|
||||||
|
mntinfo_t *info;
|
||||||
|
- char *new = expandpath(pathname);
|
||||||
|
+ char *new = expandpath(pathname, true);
|
||||||
|
if (new && find_mountpoint(new, &info) == 0)
|
||||||
|
*id = info->id;
|
||||||
|
else *id = -1;
|
||||||
|
@@ -2442,11 +2442,10 @@ static int get_fdinfo(
|
||||||
|
const static char delimiters[] = ": \t\n";
|
||||||
|
char line[BUFSIZ];
|
||||||
|
FILE *fp;
|
||||||
|
-# if defined(HAS_NAME_TO_HANDLE_AT)
|
||||||
|
char *realname;
|
||||||
|
-# endif
|
||||||
|
|
||||||
|
snprintf(pathname, sizeof(pathname)-1, "/proc/%d/fdinfo/%s", pid, fd);
|
||||||
|
+
|
||||||
|
if ((fp = fopen(pathname, "r")) == NULL)
|
||||||
|
goto out;
|
||||||
|
|
||||||
|
@@ -2470,9 +2469,9 @@ static int get_fdinfo(
|
||||||
|
}
|
||||||
|
fclose(fp);
|
||||||
|
out:
|
||||||
|
-# if defined(HAS_NAME_TO_HANDLE_AT)
|
||||||
|
snprintf(pathname, sizeof(pathname)-1, "/proc/%d/fd/%s", pid, fd);
|
||||||
|
- realname = expandpath(pathname);
|
||||||
|
+ realname = expandpath(pathname, true);
|
||||||
|
+# if defined(HAS_NAME_TO_HANDLE_AT)
|
||||||
|
if (realname)
|
||||||
|
{
|
||||||
|
info->mnt_id = get_mountid(realname);
|
||||||
|
@@ -2485,7 +2484,6 @@ out:
|
||||||
|
{
|
||||||
|
struct stat lst;
|
||||||
|
|
||||||
|
- snprintf(pathname, sizeof(pathname)-1, "/proc/%d/fd/%s", pid, fd);
|
||||||
|
if (!flags && lstatn(pathname, STATX_MODE, &lst) == 0)
|
||||||
|
{
|
||||||
|
if (lst.st_mode & S_IWUSR)
|
||||||
|
@@ -2495,7 +2493,6 @@ out:
|
||||||
|
|
||||||
|
if (!mnt_id)
|
||||||
|
{
|
||||||
|
- realname = expandpath(pathname);
|
||||||
|
if (realname)
|
||||||
|
{
|
||||||
|
mntinfo_t *mountinfo;
|
||||||
|
@@ -2699,7 +2696,8 @@ out:
|
||||||
|
*/
|
||||||
|
static char real[PATH_MAX + 1];
|
||||||
|
char *expandpath(
|
||||||
|
- const char *path)
|
||||||
|
+ const char *path,
|
||||||
|
+ const bool isproc)
|
||||||
|
{
|
||||||
|
char tmpbuf[PATH_MAX + 1];
|
||||||
|
const char *start, *end;
|
||||||
|
@@ -2726,7 +2724,10 @@ char *expandpath(
|
||||||
|
while (*start == '/')
|
||||||
|
++start;
|
||||||
|
|
||||||
|
- for (end = start; *end && *end != '/'; ++end) ;
|
||||||
|
+ if (isproc)
|
||||||
|
+ end = start + strlen(start);
|
||||||
|
+ else
|
||||||
|
+ for (end = start; *end && *end != '/'; ++end) ;
|
||||||
|
|
||||||
|
if (end - start == 0)
|
||||||
|
break;
|
||||||
|
@@ -2741,6 +2742,7 @@ char *expandpath(
|
||||||
|
char lnkbuf[PATH_MAX + 1];
|
||||||
|
size_t len;
|
||||||
|
ssize_t n;
|
||||||
|
+ unsigned long long lnk_inode;
|
||||||
|
|
||||||
|
if (dest[-1] != '/')
|
||||||
|
*dest++ = '/';
|
||||||
|
@@ -2773,49 +2775,26 @@ char *expandpath(
|
||||||
|
/*
|
||||||
|
* Expand to real path of named socket if any
|
||||||
|
*/
|
||||||
|
- if (lnkbuf[0] != '/' && strncmp("socket:[", lnkbuf, 8) == 0)
|
||||||
|
+ if (lnkbuf[0] != '/' && sscanf(lnkbuf, "socket:[%llu]", &lnk_inode) == 1)
|
||||||
|
{
|
||||||
|
- FILE *fp;
|
||||||
|
- char *inode;
|
||||||
|
- char line[BUFSIZ];
|
||||||
|
- if ((inode = strchr(&lnkbuf[8], ']')))
|
||||||
|
- {
|
||||||
|
- *inode = '\0';
|
||||||
|
- inode = &lnkbuf[8];
|
||||||
|
- }
|
||||||
|
-
|
||||||
|
- if (!inode || (fp = fopen(PROC_SOCKETS, "r")) == NULL)
|
||||||
|
- {
|
||||||
|
- /*fprintf(stderr, "Cannot open %s\n", PROC_SOCKETS); */
|
||||||
|
- return (char *)0;
|
||||||
|
- }
|
||||||
|
- while (fgets(line, BUFSIZ, fp) != NULL)
|
||||||
|
+ struct unixsocket_list *sock_tmp;
|
||||||
|
+ for (sock_tmp = unixsockets; sock_tmp != NULL; sock_tmp = sock_tmp->next)
|
||||||
|
{
|
||||||
|
- char *named = NULL;
|
||||||
|
- unsigned long snode;
|
||||||
|
-
|
||||||
|
- if (*line == 'N')
|
||||||
|
- continue;
|
||||||
|
-
|
||||||
|
- if (sscanf(line, "%*x: %*x %*x %*x %*x %*x %lu %ms",
|
||||||
|
- &snode, &named) == 2)
|
||||||
|
+ if (sock_tmp->net_inode == lnk_inode)
|
||||||
|
{
|
||||||
|
- char *ep;
|
||||||
|
- unsigned long oul = strtoul(inode, &ep, 0);
|
||||||
|
- if (oul == snode) {
|
||||||
|
- ep = named;
|
||||||
|
- if (*ep == '@')
|
||||||
|
- ep++;
|
||||||
|
- n = strlen(ep);
|
||||||
|
- memcpy(lnkbuf, ep, n);
|
||||||
|
- lnkbuf[n] = '\0';
|
||||||
|
- }
|
||||||
|
- free (named);
|
||||||
|
+ strncpy(lnkbuf, sock_tmp->sun_name, PATH_MAX);
|
||||||
|
+ n = strlen(sock_tmp->sun_name);
|
||||||
|
+ break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
- fclose(fp);
|
||||||
|
+ if (sock_tmp == NULL) // socket, but not unix socket
|
||||||
|
+ {
|
||||||
|
+ strcpy(real, path);
|
||||||
|
+ return curr;
|
||||||
|
+ }
|
||||||
|
}
|
||||||
|
|
||||||
|
+ lnkbuf[n] = '\0';
|
||||||
|
len = strlen(end);
|
||||||
|
if ((n + len) > PATH_MAX)
|
||||||
|
{
|
||||||
|
--
|
||||||
|
GitLab
|
||||||
|
|
||||||
160
0001-killall,pstree-use-clock_gettime-not-uptime.patch
Normal file
160
0001-killall,pstree-use-clock_gettime-not-uptime.patch
Normal file
@@ -0,0 +1,160 @@
|
|||||||
|
From a146bfc359a4d4d96c438f3a0fa988c6a171d40d Mon Sep 17 00:00:00 2001
|
||||||
|
From: Craig Small <csmall@dropbear.xyz>
|
||||||
|
Date: Wed, 13 Mar 2024 22:01:07 +1100
|
||||||
|
Subject: [PATCH] killall,pstree use clock_gettime not uptime
|
||||||
|
|
||||||
|
/proc/uptime can become a container uptime in LXC containers
|
||||||
|
but the process start time is still relative to the boot time.
|
||||||
|
|
||||||
|
This means things like "newer than" or "older than" will be incorrect
|
||||||
|
in some containers, using clock_gettime() fixes this as its always the
|
||||||
|
hosts boot time.
|
||||||
|
|
||||||
|
References:
|
||||||
|
https://bugs.debian.org/1066090
|
||||||
|
https://gitlab.com/procps-ng/procps/-/commit/b5e19c1730bcc68d553f44b5585704e3c92267bf#83c45d853acc8384452b404946e4a0c484b16a4e
|
||||||
|
|
||||||
|
Signed-off-by: Craig Small <csmall@dropbear.xyz>
|
||||||
|
---
|
||||||
|
ChangeLog | 4 ++++
|
||||||
|
src/killall.c | 39 +++++++++++++++++++--------------------
|
||||||
|
src/pstree.c | 39 +++++++++++++++++++--------------------
|
||||||
|
3 files changed, 42 insertions(+), 40 deletions(-)
|
||||||
|
|
||||||
|
diff --git ChangeLog ChangeLog
|
||||||
|
index 15c5725..f4dcfd2 100644
|
||||||
|
--- ChangeLog
|
||||||
|
+++ ChangeLog
|
||||||
|
@@ -1,3 +1,7 @@
|
||||||
|
+Changes in NEXT
|
||||||
|
+===============
|
||||||
|
+ * killall,pstree: Use gettime instead of uptime Debian 1066090
|
||||||
|
+
|
||||||
|
Changes in 23.7
|
||||||
|
===============
|
||||||
|
* build-sys: Make disable-statx work
|
||||||
|
diff --git src/killall.c src/killall.c
|
||||||
|
index 81dcc4b..229e61c 100644
|
||||||
|
--- src/killall.c
|
||||||
|
+++ src/killall.c
|
||||||
|
@@ -45,6 +45,7 @@
|
||||||
|
#include <regex.h>
|
||||||
|
#include <ctype.h>
|
||||||
|
#include <assert.h>
|
||||||
|
+#include <time.h>
|
||||||
|
|
||||||
|
#ifdef WITH_SELINUX
|
||||||
|
#include <dlfcn.h>
|
||||||
|
@@ -132,30 +133,28 @@ ask (char *name, pid_t pid, const int signal)
|
||||||
|
/* Never should get here */
|
||||||
|
}
|
||||||
|
|
||||||
|
-static double
|
||||||
|
-uptime()
|
||||||
|
-{
|
||||||
|
- char * savelocale;
|
||||||
|
- char buf[2048];
|
||||||
|
- FILE* file;
|
||||||
|
- if (!(file=fopen( PROC_BASE "/uptime", "r"))) {
|
||||||
|
- fprintf(stderr, "killall: error opening uptime file\n");
|
||||||
|
- exit(1);
|
||||||
|
- }
|
||||||
|
- savelocale = setlocale(LC_NUMERIC,"C");
|
||||||
|
- if (fscanf(file, "%2047s", buf) == EOF) perror("uptime");
|
||||||
|
- fclose(file);
|
||||||
|
- setlocale(LC_NUMERIC,savelocale);
|
||||||
|
- return atof(buf);
|
||||||
|
-}
|
||||||
|
|
||||||
|
-/* process age from jiffies to seconds via uptime */
|
||||||
|
+/* process age from jiffies to seconds via uptime
|
||||||
|
+ * Cannot use /proc/uptime as this can change in containers
|
||||||
|
+ * but process start time does not
|
||||||
|
+ */
|
||||||
|
static double process_age(const unsigned long long jf)
|
||||||
|
{
|
||||||
|
+ struct timespec ts;
|
||||||
|
+ double sc_clk_tck;
|
||||||
|
double age;
|
||||||
|
- double sc_clk_tck = sysconf(_SC_CLK_TCK);
|
||||||
|
- assert(sc_clk_tck > 0);
|
||||||
|
- age = uptime() - jf / sc_clk_tck;
|
||||||
|
+
|
||||||
|
+ if (clock_gettime(CLOCK_BOOTTIME, &ts) != 0) {
|
||||||
|
+ perror("clock_gettime():");
|
||||||
|
+ exit(EXIT_FAILURE);
|
||||||
|
+ }
|
||||||
|
+
|
||||||
|
+ if ( (sc_clk_tck = sysconf(_SC_CLK_TCK)) < 0) {
|
||||||
|
+ perror("sysconf(CLK_TCK):");
|
||||||
|
+ exit(EXIT_FAILURE);
|
||||||
|
+ }
|
||||||
|
+
|
||||||
|
+ age = (ts.tv_sec + ts.tv_nsec * 1.0e-9) - jf / sc_clk_tck;
|
||||||
|
if (age < 0L)
|
||||||
|
return 0L;
|
||||||
|
return age;
|
||||||
|
diff --git src/pstree.c src/pstree.c
|
||||||
|
index 39265d1..2545e24 100644
|
||||||
|
--- src/pstree.c
|
||||||
|
+++ src/pstree.c
|
||||||
|
@@ -44,6 +44,7 @@
|
||||||
|
#include <sys/ioctl.h>
|
||||||
|
#include <limits.h>
|
||||||
|
#include <locale.h>
|
||||||
|
+#include <time.h>
|
||||||
|
|
||||||
|
#include "i18n.h"
|
||||||
|
#include "comm.h"
|
||||||
|
@@ -1028,30 +1029,28 @@ static void trim_tree_by_parent(PROC * current)
|
||||||
|
trim_tree_by_parent(parent);
|
||||||
|
}
|
||||||
|
|
||||||
|
-static double
|
||||||
|
-uptime()
|
||||||
|
-{
|
||||||
|
- char * savelocale;
|
||||||
|
- char buf[2048];
|
||||||
|
- FILE* file;
|
||||||
|
- if (!(file=fopen( PROC_BASE "/uptime", "r"))) {
|
||||||
|
- fprintf(stderr, "pstree: error opening uptime file\n");
|
||||||
|
- exit(1);
|
||||||
|
- }
|
||||||
|
- savelocale = setlocale(LC_NUMERIC,"C");
|
||||||
|
- if (fscanf(file, "%2047s", buf) == EOF) perror("uptime");
|
||||||
|
- fclose(file);
|
||||||
|
- setlocale(LC_NUMERIC,savelocale);
|
||||||
|
- return atof(buf);
|
||||||
|
-}
|
||||||
|
|
||||||
|
-/* process age from jiffies to seconds via uptime */
|
||||||
|
+/* process age from jiffies to seconds via uptime
|
||||||
|
+ * Cannot use /proc/uptime as this can change in containers
|
||||||
|
+ * but process start time does not
|
||||||
|
+ */
|
||||||
|
static double process_age(const unsigned long long jf)
|
||||||
|
{
|
||||||
|
+ struct timespec ts;
|
||||||
|
+ double sc_clk_tck;
|
||||||
|
double age;
|
||||||
|
- double sc_clk_tck = sysconf(_SC_CLK_TCK);
|
||||||
|
- assert(sc_clk_tck > 0);
|
||||||
|
- age = uptime() - jf / sc_clk_tck;
|
||||||
|
+
|
||||||
|
+ if (clock_gettime(CLOCK_BOOTTIME, &ts) != 0) {
|
||||||
|
+ perror("clock_gettime():");
|
||||||
|
+ exit(EXIT_FAILURE);
|
||||||
|
+ }
|
||||||
|
+
|
||||||
|
+ if ( (sc_clk_tck = sysconf(_SC_CLK_TCK)) < 0) {
|
||||||
|
+ perror("sysconf(CLK_TCK):");
|
||||||
|
+ exit(EXIT_FAILURE);
|
||||||
|
+ }
|
||||||
|
+
|
||||||
|
+ age = (ts.tv_sec + ts.tv_nsec * 1.0e-9) - jf / sc_clk_tck;
|
||||||
|
if (age < 0L)
|
||||||
|
return 0L;
|
||||||
|
return age;
|
||||||
|
--
|
||||||
|
2.35.3
|
||||||
|
|
||||||
@@ -1,11 +0,0 @@
|
|||||||
--- src/pstree.c
|
|
||||||
+++ src/pstree.c 2010-07-13 10:18:31.454925471 +0000
|
|
||||||
@@ -69,7 +69,7 @@ extern const char *__progname;
|
|
||||||
#define VT_HD "w"
|
|
||||||
|
|
||||||
typedef struct _proc {
|
|
||||||
- char comm[COMM_LEN + 1];
|
|
||||||
+ char comm[COMM_LEN + 2 + 1]; /* add another 2 for thread brackets */
|
|
||||||
char **argv; /* only used : argv[0] is 1st arg; undef if argc < 1 */
|
|
||||||
int argc; /* with -a : number of arguments, -1 if swapped */
|
|
||||||
pid_t pid;
|
|
||||||
@@ -1,11 +0,0 @@
|
|||||||
--- src/pstree.c
|
|
||||||
+++ src/pstree.c 2010-07-13 10:14:50.978925622 +0000
|
|
||||||
@@ -868,7 +868,7 @@ int main(int argc, char **argv)
|
|
||||||
} else if (isatty(1) && (termname = getenv("TERM")) &&
|
|
||||||
(strlen(termname) > 0) &&
|
|
||||||
(setupterm(NULL, 1 /* stdout */ , NULL) == OK) &&
|
|
||||||
- (tigetstr("acsc") > 0)) {
|
|
||||||
+ ((int)tigetstr("acsc") > 0)) {
|
|
||||||
/*
|
|
||||||
* Failing that, if TERM is defined, a non-null value, and the terminal
|
|
||||||
* has the VT100 graphics charset, use it.
|
|
||||||
@@ -1,255 +0,0 @@
|
|||||||
--- src/lists.h
|
|
||||||
+++ src/lists.h 2011-06-21 13:38:35.696426015 +0000
|
|
||||||
@@ -247,252 +247,3 @@ static inline void move_tail(list_t *res
|
|
||||||
for (pos = (head)->prev; pos != (head); pos = pos->prev)
|
|
||||||
|
|
||||||
#endif /* _LISTS_H */
|
|
||||||
-/*
|
|
||||||
- * lists.h Simple doubly linked list implementation,
|
|
||||||
- * based on <linux/list.h> and <linux/prefetch.h>.
|
|
||||||
- *
|
|
||||||
- * Version: 0.1 01-Feb-2011 Fink
|
|
||||||
- *
|
|
||||||
- * Copyright 2011 Werner Fink, 2005 SUSE LINUX Products GmbH, Germany.
|
|
||||||
- *
|
|
||||||
- * This program is free software; you can redistribute it and/or modify
|
|
||||||
- * it under the terms of the GNU General Public License as published by
|
|
||||||
- * the Free Software Foundation; either version 2 of the License, or
|
|
||||||
- * (at your option) any later version.
|
|
||||||
- *
|
|
||||||
- * Author: Werner Fink <werner@suse.de>, 2011
|
|
||||||
- */
|
|
||||||
-
|
|
||||||
-#ifndef _LISTS_H
|
|
||||||
-#define _LISTS_H
|
|
||||||
-
|
|
||||||
-#include <stddef.h>
|
|
||||||
-#include <sys/types.h>
|
|
||||||
-
|
|
||||||
-typedef enum _boolean {false, true} boolean;
|
|
||||||
-typedef unsigned char uchar;
|
|
||||||
-#ifndef __USE_MISC
|
|
||||||
-typedef unsigned short ushort;
|
|
||||||
-typedef unsigned int uint;
|
|
||||||
-#endif
|
|
||||||
-
|
|
||||||
-#ifndef __OPTIMIZE__
|
|
||||||
-# warning This will not compile without -O at least
|
|
||||||
-#endif
|
|
||||||
-#if !defined(__STDC_VERSION__) || (__STDC_VERSION__ < 199901L)
|
|
||||||
-# ifndef inline
|
|
||||||
-# define inline __inline__
|
|
||||||
-# endif
|
|
||||||
-# ifndef restrict
|
|
||||||
-# define restrict __restrict__
|
|
||||||
-# endif
|
|
||||||
-# ifndef volatile
|
|
||||||
-# define volatile __volatile__
|
|
||||||
-# endif
|
|
||||||
-# ifndef asm
|
|
||||||
-# define asm __asm__
|
|
||||||
-# endif
|
|
||||||
-# ifndef extension
|
|
||||||
-# define extension __extension__
|
|
||||||
-# endif
|
|
||||||
-#endif
|
|
||||||
-#ifndef attribute
|
|
||||||
-# define attribute(attr) __attribute__(attr)
|
|
||||||
-#endif
|
|
||||||
-
|
|
||||||
-/*
|
|
||||||
- * This is lent from the kernel by e.g. using
|
|
||||||
- *
|
|
||||||
- * echo '#include <asm-i386/processor.h>\nint main () { prefetch(); return 0; }' | \
|
|
||||||
- * gcc -I/usr/src/linux/include -D__KERNEL__ -x c -E -P - | \
|
|
||||||
- * sed -rn '/void[[:blank:]]+prefetch[[:blank:]]*\(/,/^}/p'
|
|
||||||
- *
|
|
||||||
- * on the appropiate architecture (here on i686 for i586).
|
|
||||||
- */
|
|
||||||
-extern inline void attribute((used,__gnu_inline__,always_inline,__artificial__)) prefetch(const void *restrict x)
|
|
||||||
-{
|
|
||||||
-#if defined(__x86_64__)
|
|
||||||
- asm volatile ("prefetcht0 %0" :: "m" (*(unsigned long *)x))
|
|
||||||
-#elif defined(__ia64__)
|
|
||||||
- asm volatile ("lfetch [%0]" :: "r" (x))
|
|
||||||
-#elif defined(__powerpc64__)
|
|
||||||
- asm volatile ("dcbt 0,%0" :: "r" (x))
|
|
||||||
-#elif 1 && defined(__i386__)
|
|
||||||
- asm volatile ("661:\n\t"
|
|
||||||
- ".byte 0x8d,0x74,0x26,0x00\n"
|
|
||||||
- "\n662:\n"
|
|
||||||
- ".section .altinstructions,\"a\"\n"
|
|
||||||
- " .align 4\n"
|
|
||||||
- " .long 661b\n"
|
|
||||||
- " .long 663f\n"
|
|
||||||
- " .byte %c0\n"
|
|
||||||
- " .byte 662b-661b\n"
|
|
||||||
- " .byte 664f-663f\n"
|
|
||||||
- ".previous\n"
|
|
||||||
- ".section .altinstr_replacement,\"ax\"\n"
|
|
||||||
- " 663:\n\t"
|
|
||||||
- " prefetchnta (%1)"
|
|
||||||
- " \n664:\n"
|
|
||||||
- ".previous"
|
|
||||||
- :: "i" ((0*32+25)), "r" (x))
|
|
||||||
-#else
|
|
||||||
- __builtin_prefetch ((x), 0, 1);
|
|
||||||
-#endif
|
|
||||||
- ;
|
|
||||||
-}
|
|
||||||
-
|
|
||||||
-#if defined(DEBUG) && (DEBUG > 0)
|
|
||||||
-# define __align attribute((packed))
|
|
||||||
-#else
|
|
||||||
-# define __align attribute((aligned(sizeof(struct list_struct*))))
|
|
||||||
-#endif
|
|
||||||
-#define __packed attribute((packed))
|
|
||||||
-
|
|
||||||
-#define alignof(type) ((sizeof(type)+(sizeof(void*)-1)) & ~(sizeof(void*)-1))
|
|
||||||
-#define strsize(string) ((strlen(string)+1)*sizeof(char))
|
|
||||||
-
|
|
||||||
-typedef struct list_struct {
|
|
||||||
- struct list_struct * next, * prev;
|
|
||||||
-} __align list_t;
|
|
||||||
-
|
|
||||||
-/*
|
|
||||||
- * Linked list handling
|
|
||||||
- * ====================
|
|
||||||
- * The structures which will be linked into such lists have to be of the
|
|
||||||
- * same type. The structures may have alway a list identifier of the type
|
|
||||||
- * `list_t' as very first element. With this the macro list_entry() can
|
|
||||||
- * be used to cast the memory address of a list member to the corresponding
|
|
||||||
- * allocated structure.
|
|
||||||
- */
|
|
||||||
-
|
|
||||||
-/*
|
|
||||||
- * Insert new entry as next member.
|
|
||||||
- */
|
|
||||||
-static inline void _insert(list_t *restrict new, list_t *restrict here) attribute((always_inline,nonnull(1,2)));
|
|
||||||
-static inline void _insert(list_t *restrict new, list_t *restrict here)
|
|
||||||
-{
|
|
||||||
- list_t * prev = here;
|
|
||||||
- list_t * next = here->next;
|
|
||||||
-
|
|
||||||
- next->prev = new;
|
|
||||||
- new->next = next;
|
|
||||||
- new->prev = prev;
|
|
||||||
- prev->next = new;
|
|
||||||
-}
|
|
||||||
-
|
|
||||||
-#define insert(new, list) _insert(&((new)->this), (&(list)));
|
|
||||||
-#define append(new, list) _insert(&((new)->this), (&(list))->prev);
|
|
||||||
-
|
|
||||||
-/*
|
|
||||||
- * Set head
|
|
||||||
- */
|
|
||||||
-static inline void initial(list_t *restrict head) attribute((always_inline,nonnull(1)));
|
|
||||||
-static inline void initial(list_t *restrict head)
|
|
||||||
-{
|
|
||||||
- head->prev = head->next = head;
|
|
||||||
-}
|
|
||||||
-
|
|
||||||
-/*
|
|
||||||
- * Remove entries, note that the pointer its self remains.
|
|
||||||
- */
|
|
||||||
-static inline void delete(list_t *restrict entry) attribute((always_inline,nonnull(1)));
|
|
||||||
-static inline void delete(list_t *restrict entry)
|
|
||||||
-{
|
|
||||||
- list_t * prev = entry->prev;
|
|
||||||
- list_t * next = entry->next;
|
|
||||||
-
|
|
||||||
- next->prev = prev;
|
|
||||||
- prev->next = next;
|
|
||||||
-
|
|
||||||
- initial(entry);
|
|
||||||
-}
|
|
||||||
-
|
|
||||||
-/*
|
|
||||||
- * Replace an entry by a new one.
|
|
||||||
- */
|
|
||||||
-static inline void replace(list_t *restrict old, list_t *restrict new) attribute((always_inline,nonnull(1,2)));
|
|
||||||
-static inline void replace(list_t *restrict old, list_t *restrict new)
|
|
||||||
-{
|
|
||||||
- new->next = old->next;
|
|
||||||
- new->next->prev = new;
|
|
||||||
- new->prev = old->prev;
|
|
||||||
- new->prev->next = new;
|
|
||||||
-}
|
|
||||||
-
|
|
||||||
-static inline void join(list_t *restrict list, list_t *restrict head) attribute((always_inline,nonnull(1,2)));
|
|
||||||
-static inline void join(list_t *restrict list, list_t *restrict head)
|
|
||||||
-{
|
|
||||||
- list_t * first = list->next;
|
|
||||||
-
|
|
||||||
- if (first != list) {
|
|
||||||
- list_t * last = list->prev;
|
|
||||||
- list_t * at = head->next;
|
|
||||||
-
|
|
||||||
- first->prev = head;
|
|
||||||
- head->next = first;
|
|
||||||
-
|
|
||||||
- last->next = at;
|
|
||||||
- at->prev = last;
|
|
||||||
- }
|
|
||||||
-}
|
|
||||||
-
|
|
||||||
-static inline boolean list_empty(const list_t *restrict const head) attribute((always_inline,nonnull(1)));
|
|
||||||
-static inline boolean list_empty(const list_t *restrict const head)
|
|
||||||
-{
|
|
||||||
- return head->next == head;
|
|
||||||
-}
|
|
||||||
-
|
|
||||||
-static inline void move_head(list_t *restrict entry, list_t *restrict head) attribute((always_inline,nonnull(1,2)));
|
|
||||||
-static inline void move_head(list_t *restrict entry, list_t *restrict head)
|
|
||||||
-{
|
|
||||||
- list_t * prev = entry->prev;
|
|
||||||
- list_t * next = entry->next;
|
|
||||||
-
|
|
||||||
- next->prev = prev; /* remove entry from old list */
|
|
||||||
- prev->next = next;
|
|
||||||
-
|
|
||||||
- prev = head;
|
|
||||||
- next = head->next;
|
|
||||||
-
|
|
||||||
- next->prev = entry; /* and add it at head of new list */
|
|
||||||
- entry->next = next;
|
|
||||||
- entry->prev = prev;
|
|
||||||
- prev->next = entry;
|
|
||||||
-}
|
|
||||||
-
|
|
||||||
-static inline void move_tail(list_t *restrict entry, list_t *restrict head) attribute((always_inline,nonnull(1,2)));
|
|
||||||
-static inline void move_tail(list_t *restrict entry, list_t *restrict head)
|
|
||||||
-{
|
|
||||||
- list_t * prev = entry->prev;
|
|
||||||
- list_t * next = entry->next;
|
|
||||||
-
|
|
||||||
- next->prev = prev; /* remove entry from old list */
|
|
||||||
- prev->next = next;
|
|
||||||
-
|
|
||||||
- prev = head->prev;
|
|
||||||
- next = head;
|
|
||||||
-
|
|
||||||
- next->prev = entry; /* and add it at tail of new list */
|
|
||||||
- entry->next = next;
|
|
||||||
- entry->prev = prev;
|
|
||||||
- prev->next = entry;
|
|
||||||
-}
|
|
||||||
-
|
|
||||||
-/*
|
|
||||||
- * The handle of the list is named `this'
|
|
||||||
- */
|
|
||||||
-#define list_entry(ptr, type) (__extension__ ({ \
|
|
||||||
- const typeof( ((type *)0)->this ) *__mptr = (ptr); \
|
|
||||||
- ((type *)( (char *)(__mptr) - offsetof(type,this) )); }))
|
|
||||||
-#define list_for_each(pos, head) \
|
|
||||||
- for (pos = (head)->next; prefetch(pos->next), pos != (head); pos = pos->next)
|
|
||||||
-#define np_list_for_each(pos, head) \
|
|
||||||
- for (pos = (head)->next; pos != (head); pos = pos->next)
|
|
||||||
-#define list_for_each_safe(pos, safe, head) \
|
|
||||||
- for (pos = (head)->next, safe = pos->next; pos != (head); pos = safe, safe = pos->next)
|
|
||||||
-#define list_for_each_prev(pos, head) \
|
|
||||||
- for (pos = (head)->prev; prefetch(pos->prev), pos != (head); pos = pos->prev)
|
|
||||||
-#define np_list_for_each_prev(pos, head) \
|
|
||||||
- for (pos = (head)->prev; pos != (head); pos = pos->prev)
|
|
||||||
-
|
|
||||||
-#endif /* _LISTS_H */
|
|
||||||
@@ -1,48 +0,0 @@
|
|||||||
--- configure.ac
|
|
||||||
+++ configure.ac 2010-10-15 09:00:32.915927054 +0000
|
|
||||||
@@ -72,7 +72,7 @@ AC_CHECK_MEMBERS([struct user_regs_struc
|
|
||||||
struct user_regs_struct.rdi,
|
|
||||||
struct user_regs_struct.rsi,
|
|
||||||
struct user_regs_struct.rdx], [],[],
|
|
||||||
- [#include <bits/types.h>
|
|
||||||
+ [#include <sys/types.h>
|
|
||||||
#include <sys/user.h>])
|
|
||||||
AC_CHECK_MEMBERS([struct pt_regs.orig_gpr3,
|
|
||||||
struct pt_regs.gpr], [],[], [#include <linux/ptrace.h>])
|
|
||||||
--- src/fuser.c
|
|
||||||
+++ src/fuser.c 2011-02-08 16:08:59.823926228 +0000
|
|
||||||
@@ -888,7 +888,8 @@ int main(int argc, char *argv[])
|
|
||||||
char option_buf[3];
|
|
||||||
struct option *optr;
|
|
||||||
char *nsptr;
|
|
||||||
- int skip_argv;
|
|
||||||
+ int skip_argv;
|
|
||||||
+ int seen_file;
|
|
||||||
|
|
||||||
struct option options[] = {
|
|
||||||
{"all", 0, NULL, 'a'},
|
|
||||||
@@ -927,6 +928,7 @@ int main(int argc, char *argv[])
|
|
||||||
netdev = find_net_dev();
|
|
||||||
fill_unix_cache(&unixsockets);
|
|
||||||
|
|
||||||
+ seen_file = 0;
|
|
||||||
for (argc_cnt = 1; argc_cnt < argc; argc_cnt++) {
|
|
||||||
current_argv = argv[argc_cnt];
|
|
||||||
if (current_argv[0] == '-') { /* its an option */
|
|
||||||
@@ -1056,6 +1058,7 @@ int main(int argc, char *argv[])
|
|
||||||
}
|
|
||||||
}
|
|
||||||
this_name->matched_procs = NULL;
|
|
||||||
+ seen_file = 1;
|
|
||||||
if (opts & (OPT_MOUNTS|OPT_ISMOUNTPOINT)
|
|
||||||
&& this_name->name_space != NAMESPACE_FILE)
|
|
||||||
usage(_
|
|
||||||
@@ -1103,7 +1106,7 @@ int main(int argc, char *argv[])
|
|
||||||
names_tail->next = this_name;
|
|
||||||
names_tail = this_name;
|
|
||||||
} /* for across the argvs */
|
|
||||||
- if (names_head == NULL)
|
|
||||||
+ if (names_head == NULL && !seen_file)
|
|
||||||
usage(_("No process specification given"));
|
|
||||||
|
|
||||||
if (opts & OPT_SILENT) {
|
|
||||||
@@ -1,3 +0,0 @@
|
|||||||
version https://git-lfs.github.com/spec/v1
|
|
||||||
oid sha256:42c30ad9a9a85429edd0e84763e1333a1d0711d90e4f1943ecb1211d6f98ee42
|
|
||||||
size 382041
|
|
||||||
@@ -1,16 +1,20 @@
|
|||||||
|
---
|
||||||
|
src/pstree.c | 38 +++++++++++++++++++++++++++++++-------
|
||||||
|
1 file changed, 31 insertions(+), 7 deletions(-)
|
||||||
|
|
||||||
--- src/pstree.c
|
--- src/pstree.c
|
||||||
+++ src/pstree.c 2010-07-13 10:27:54.139239142 +0000
|
+++ src/pstree.c 2022-12-13 07:46:58.243076344 +0000
|
||||||
@@ -61,6 +61,7 @@ extern const char *__progname;
|
@@ -81,6 +81,7 @@ extern const char *__progname;
|
||||||
#define UTF_HD "\342\224\254" /* U+252C, Horizontal and down */
|
#define UTF_HD "\342\224\254" /* U+252C, Horizontal and down */
|
||||||
|
|
||||||
#define VT_BEG "\033(0\017" /* use graphic chars */
|
#define VT_BEG "\033(0\017" /* use graphic chars */
|
||||||
+#define VT_LEN 4
|
+#define VT_LEN 4
|
||||||
#define VT_END "\033(B" /* back to normal char set */
|
#define VT_END "\033(B" /* back to normal char set */
|
||||||
#define VT_V "x" /* see UTF definitions above */
|
#define VT_V "x" /* see UTF definitions above */
|
||||||
#define VT_VR "t"
|
#define VT_VR "t"
|
||||||
@@ -230,6 +231,27 @@ static void out_scontext(security_contex
|
@@ -594,6 +595,28 @@ static void out_scontext(const PROC *cur
|
||||||
|
out_string("'");
|
||||||
}
|
}
|
||||||
#endif /*WITH_SELINUX */
|
|
||||||
|
|
||||||
+/*
|
+/*
|
||||||
+ * Only affects vt100 line drawing mode: Do not count the strlen of
|
+ * Only affects vt100 line drawing mode: Do not count the strlen of
|
||||||
@@ -19,24 +23,25 @@
|
|||||||
+static void
|
+static void
|
||||||
+out_sym (const char *str)
|
+out_sym (const char *str)
|
||||||
+{
|
+{
|
||||||
+ int seq = 0;
|
+ int seq = 0;
|
||||||
+ if (sym == &sym_vt100 && *str == '\033') {
|
+ if (sym == &sym_vt100 && *str == '\033') {
|
||||||
+ seq = 1;
|
+ seq = 1;
|
||||||
+ if (cur_x <= output_width || !trunc)
|
+ if (cur_x <= output_width || !trunc)
|
||||||
+ cur_x -= VT_LEN;
|
+ cur_x -= VT_LEN;
|
||||||
+ }
|
+ }
|
||||||
+ out_string(str);
|
+ out_string(str);
|
||||||
+ if (seq) {
|
+ if (seq) {
|
||||||
+ str = VT_END;
|
+ str = VT_END;
|
||||||
+ while (*str)
|
+ while (*str)
|
||||||
+ putchar (*str++);
|
+ putchar (*str++);
|
||||||
+ }
|
+ }
|
||||||
+}
|
+}
|
||||||
+
|
+
|
||||||
|
+
|
||||||
static void out_newline(void)
|
static void out_newline(void)
|
||||||
{
|
{
|
||||||
@@ -426,11 +448,12 @@ dump_tree(PROC * current, int level, int
|
if (last_char && cur_x == output_width)
|
||||||
|
@@ -833,11 +856,12 @@ dump_tree(PROC * current, int level, int
|
||||||
for (lvl = 0; lvl < level; lvl++) {
|
for (lvl = 0; lvl < level; lvl++) {
|
||||||
for (i = width[lvl] + 1; i; i--)
|
for (i = width[lvl] + 1; i; i--)
|
||||||
out_char(' ');
|
out_char(' ');
|
||||||
@@ -50,11 +55,11 @@
|
|||||||
+ * to handle VT100 line drawing sequences if VT100 mode is active:
|
+ * to handle VT100 line drawing sequences if VT100 mode is active:
|
||||||
+ */
|
+ */
|
||||||
+ out_sym(lvl == level - 1 ? last ? sym->last_2 : sym->branch_2 :
|
+ out_sym(lvl == level - 1 ? last ? sym->last_2 : sym->branch_2 :
|
||||||
+ more[lvl + 1] ? sym->vert_2 : sym->empty_2);
|
+ more[lvl + 1] ? sym->vert_2 : sym->empty_2);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (rep < 2)
|
if (rep < 2)
|
||||||
add = 0;
|
@@ -947,7 +971,7 @@ dump_tree(PROC * current, int level, int
|
||||||
@@ -531,7 +554,7 @@ dump_tree(PROC * current, int level, int
|
|
||||||
}
|
}
|
||||||
width[level] = comm_len + cur_x - offset + add;
|
width[level] = comm_len + cur_x - offset + add;
|
||||||
if (cur_x >= output_width && trunc) {
|
if (cur_x >= output_width && trunc) {
|
||||||
@@ -63,7 +68,7 @@
|
|||||||
out_string("+");
|
out_string("+");
|
||||||
out_newline();
|
out_newline();
|
||||||
return;
|
return;
|
||||||
@@ -553,7 +576,7 @@ dump_tree(PROC * current, int level, int
|
@@ -971,7 +995,7 @@ dump_tree(PROC * current, int level, int
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (first) {
|
if (first) {
|
||||||
16
psmisc-gcc15.patch
Normal file
16
psmisc-gcc15.patch
Normal file
@@ -0,0 +1,16 @@
|
|||||||
|
Index: psmisc-v23.7/src/lists.h
|
||||||
|
===================================================================
|
||||||
|
--- psmisc-v23.7.orig/src/lists.h
|
||||||
|
+++ psmisc-v23.7/src/lists.h
|
||||||
|
@@ -18,9 +18,10 @@
|
||||||
|
#define _LISTS_H
|
||||||
|
|
||||||
|
#include <stddef.h>
|
||||||
|
+#include <stdbool.h>
|
||||||
|
#include <sys/types.h>
|
||||||
|
|
||||||
|
-typedef enum _boolean {false, true} boolean;
|
||||||
|
+typedef bool boolean;
|
||||||
|
typedef unsigned char uchar;
|
||||||
|
#ifndef __USE_MISC
|
||||||
|
typedef unsigned short ushort;
|
||||||
51
psmisc-v23.7.dif
Normal file
51
psmisc-v23.7.dif
Normal file
@@ -0,0 +1,51 @@
|
|||||||
|
---
|
||||||
|
configure.ac | 2 +-
|
||||||
|
src/fuser.c | 5 ++++-
|
||||||
|
2 files changed, 5 insertions(+), 2 deletions(-)
|
||||||
|
|
||||||
|
--- configure.ac
|
||||||
|
+++ configure.ac 2022-12-13 07:57:11.751636898 +0000
|
||||||
|
@@ -169,7 +169,7 @@ AC_CHECK_MEMBERS([struct user_regs_struc
|
||||||
|
struct user_regs_struct.rdi,
|
||||||
|
struct user_regs_struct.rsi,
|
||||||
|
struct user_regs_struct.rdx], [],[],
|
||||||
|
- [#include <bits/types.h>
|
||||||
|
+ [#include <sys/types.h>
|
||||||
|
#include <sys/user.h>])
|
||||||
|
AC_CHECK_MEMBERS([struct pt_regs.orig_gpr3,
|
||||||
|
struct pt_regs.gpr], [],[], [#include <linux/ptrace.h>])
|
||||||
|
--- src/fuser.c
|
||||||
|
+++ src/fuser.c 2022-12-13 07:59:50.896670010 +0000
|
||||||
|
@@ -1223,6 +1223,7 @@ int main(int argc, char *argv[])
|
||||||
|
struct option *optr;
|
||||||
|
char *nsptr;
|
||||||
|
int skip_argv;
|
||||||
|
+ int seen_file;
|
||||||
|
|
||||||
|
struct option options[] = {
|
||||||
|
{"all", 0, NULL, 'a'},
|
||||||
|
@@ -1266,6 +1267,7 @@ int main(int argc, char *argv[])
|
||||||
|
#endif
|
||||||
|
atexit(atexit_free_lists);
|
||||||
|
|
||||||
|
+ seen_file = 0;
|
||||||
|
for (argc_cnt = 1; argc_cnt < argc; argc_cnt++)
|
||||||
|
{
|
||||||
|
current_argv = argv[argc_cnt];
|
||||||
|
@@ -1416,6 +1418,7 @@ int main(int argc, char *argv[])
|
||||||
|
}
|
||||||
|
}
|
||||||
|
this_name->matched_procs = NULL;
|
||||||
|
+ seen_file = 1;
|
||||||
|
if (opts & (OPT_MOUNTS | OPT_ISMOUNTPOINT)
|
||||||
|
&& this_name->name_space != NAMESPACE_FILE)
|
||||||
|
{
|
||||||
|
@@ -1467,7 +1470,7 @@ int main(int argc, char *argv[])
|
||||||
|
names_tail->next = this_name;
|
||||||
|
names_tail = this_name;
|
||||||
|
} /* for across the argvs */
|
||||||
|
- if (names_head == NULL)
|
||||||
|
+ if (names_head == NULL && !seen_file)
|
||||||
|
usage(_("No process specification given"));
|
||||||
|
|
||||||
|
/* Check if -M flag was used and if so check mounts */
|
||||||
BIN
psmisc-v23.7.tar.bz2
LFS
Normal file
BIN
psmisc-v23.7.tar.bz2
LFS
Normal file
Binary file not shown.
521
psmisc.changes
521
psmisc.changes
@@ -1,3 +1,524 @@
|
|||||||
|
-------------------------------------------------------------------
|
||||||
|
Tue Jul 15 11:31:55 UTC 2025 - Dr. Werner Fink <werner@suse.de>
|
||||||
|
|
||||||
|
- Add patch 0001-fuser-Fix-expandpath.patch
|
||||||
|
* Is an upstream commit which fixes https://gitlab.com/psmisc/psmisc/-/issues/57
|
||||||
|
as well as bug boo#1242093
|
||||||
|
|
||||||
|
-------------------------------------------------------------------
|
||||||
|
Thu Mar 13 09:45:47 UTC 2025 - pgajdos@suse.com
|
||||||
|
|
||||||
|
- fix build with gcc15
|
||||||
|
- added patches
|
||||||
|
+ psmisc-gcc15.patch
|
||||||
|
|
||||||
|
-------------------------------------------------------------------
|
||||||
|
Tue Feb 18 12:04:10 UTC 2025 - Dr. Werner Fink <werner@suse.de>
|
||||||
|
|
||||||
|
- Looks like Factory and TW includes glibc-gconv-modules-extra at build time
|
||||||
|
|
||||||
|
-------------------------------------------------------------------
|
||||||
|
Thu Dec 5 12:30:55 UTC 2024 - Adrian Schröter <adrian@suse.de>
|
||||||
|
|
||||||
|
- add loongarch64 as peekfd supported arch
|
||||||
|
|
||||||
|
-------------------------------------------------------------------
|
||||||
|
Mon May 27 11:55:43 UTC 2024 - Dr. Werner Fink <werner@suse.de>
|
||||||
|
|
||||||
|
- Update to 23.7
|
||||||
|
* build-sys: Make disable-statx work
|
||||||
|
* fuser: Fallback to stat() if no statx() Debian 1030747 #48
|
||||||
|
* fuser: silently ignore EACCES when scanning proc directories
|
||||||
|
* killall: small formatting fixes Debian #1037231
|
||||||
|
* pstree: Do not assume root PID #49
|
||||||
|
* pslog: include config.h #51 !36
|
||||||
|
* misc: Update gettext to 0.21
|
||||||
|
- Add patch from upstream 0001-killall,pstree-use-clock_gettime-not-uptime.patch
|
||||||
|
- Port the patches
|
||||||
|
* 0001-Use-mountinfo-to-be-able-to-use-the-mount-identity.patch
|
||||||
|
* psmisc-22.21-pstree.patch
|
||||||
|
- Port patch psmisc-v23.6.dif and rename it to psmisc-v23.7.dif
|
||||||
|
|
||||||
|
-------------------------------------------------------------------
|
||||||
|
Thu Feb 29 15:01:09 UTC 2024 - Dominique Leuenberger <dimstar@opensuse.org>
|
||||||
|
|
||||||
|
- Use %patch -P N instead of deprecated %patchN.
|
||||||
|
|
||||||
|
-------------------------------------------------------------------
|
||||||
|
Mon Oct 23 13:36:04 UTC 2023 - Dr. Werner Fink <werner@suse.de>
|
||||||
|
|
||||||
|
- Fix version at configure time as there was no .tarball-version
|
||||||
|
|
||||||
|
-------------------------------------------------------------------
|
||||||
|
Thu Feb 16 16:06:59 UTC 2023 - Ludwig Nussel <lnussel@suse.de>
|
||||||
|
|
||||||
|
- allow to switch off Apparmor support via bcond
|
||||||
|
|
||||||
|
-------------------------------------------------------------------
|
||||||
|
Tue Dec 27 13:15:30 UTC 2022 - Ludwig Nussel <lnussel@suse.com>
|
||||||
|
|
||||||
|
- Replace transitional %usrmerged macro with regular version check (boo#1206798)
|
||||||
|
|
||||||
|
-------------------------------------------------------------------
|
||||||
|
Tue Dec 13 08:01:33 UTC 2022 - Dr. Werner Fink <werner@suse.de>
|
||||||
|
|
||||||
|
- Update to 23.6:
|
||||||
|
* buildsys: Fix DEJAGNU work-around Debian #1015089
|
||||||
|
* killall: Use kill if pidfd_send_signal fails Debian #1015228
|
||||||
|
* fuser: Do not mention nonexistent - reset option #42
|
||||||
|
* fuser: Use modern statn where possible
|
||||||
|
* pstree: Better AppArmor support !30
|
||||||
|
* killall: Check truncated names !28
|
||||||
|
* killall: Use openat and pidfd_send_signal #37
|
||||||
|
* killall: Don't check paths of sockets #35
|
||||||
|
* pstree: Check for process with show_parents #38
|
||||||
|
* pstree: Don't disable compaction with show pgids #34
|
||||||
|
* pstree: Fix storage leak !29
|
||||||
|
- Enable new apparmor support
|
||||||
|
- Remove patch now upstream
|
||||||
|
0002-Use-new-statx-2-system-call-to-avoid-hangs-on-NFS.patch
|
||||||
|
- Port patch psmisc-22.21-pstree.patch
|
||||||
|
- Port patch psmisc-v23.4.dif which now becomes psmisc-v23.6.dif
|
||||||
|
- Merge patch socket-fix.patch with ported patch
|
||||||
|
0001-Use-mountinfo-to-be-able-to-use-the-mount-identity.patch
|
||||||
|
|
||||||
|
-------------------------------------------------------------------
|
||||||
|
Fri Nov 25 11:48:39 UTC 2022 - Dr. Werner Fink <werner@suse.de>
|
||||||
|
|
||||||
|
- Add patch socket-fix.patch
|
||||||
|
* Add test to check for named sockets as file as well as on mounts
|
||||||
|
* Fix code to find named sockets
|
||||||
|
- The former test requires nc at build aka netcat from openbsd to
|
||||||
|
create a named socket on the fly
|
||||||
|
|
||||||
|
-------------------------------------------------------------------
|
||||||
|
Wed Feb 23 13:04:06 UTC 2022 - Dr. Werner Fink <werner@suse.de>
|
||||||
|
|
||||||
|
- Change patch 0001-Use-mountinfo-to-be-able-to-use-the-mount-identity.patch
|
||||||
|
* Add a fallback if the system call name_to_handle_at() is
|
||||||
|
not supported by the used file system.
|
||||||
|
|
||||||
|
-------------------------------------------------------------------
|
||||||
|
Tue Feb 1 12:39:16 UTC 2022 - Dr. Werner Fink <werner@suse.de>
|
||||||
|
|
||||||
|
- Change patch 0001-Use-mountinfo-to-be-able-to-use-the-mount-identity.patch
|
||||||
|
* Determine the namespace of a process only once to speed
|
||||||
|
up the parsing of fdinfo (bsc#1194172).
|
||||||
|
- Adopt patch 0002-Use-new-statx-2-system-call-to-avoid-hangs-on-NFS.patch
|
||||||
|
|
||||||
|
-------------------------------------------------------------------
|
||||||
|
Thu Jan 20 13:57:13 UTC 2022 - Dr. Werner Fink <werner@suse.de>
|
||||||
|
|
||||||
|
- Update to 23.4:
|
||||||
|
* killall: Dynamically link to selinux and use security attributes
|
||||||
|
* pstree: Do not crash on missing processes !21
|
||||||
|
* pstree: fix layout when using -C !24
|
||||||
|
* pstree: add time namespace !25
|
||||||
|
* pstree: Dynamically link to selinux and use attr
|
||||||
|
* fuser: Get less confused about duplicate dev_id !10
|
||||||
|
* fuser: Only check pathname on non-block devices !31
|
||||||
|
- Rebase 0001-Use-mountinfo-to-be-able-to-use-the-mount-identity.patch
|
||||||
|
- Rebase 0002-Use-new-statx-2-system-call-to-avoid-hangs-on-NFS.patch
|
||||||
|
- Port psmisc-22.21-pstree.patch
|
||||||
|
- Delete psmisc-v23.3-selinux.patch as not needed anymore
|
||||||
|
- Rename psmisc-v23.3.dif which is now psmisc-v23.4.dif with correct offsets
|
||||||
|
|
||||||
|
-------------------------------------------------------------------
|
||||||
|
Thu May 20 07:21:45 UTC 2021 - Dr. Werner Fink <werner@suse.de>
|
||||||
|
|
||||||
|
- Do not change CAP within spec file (boo#1186258)
|
||||||
|
|
||||||
|
-------------------------------------------------------------------
|
||||||
|
Fri May 7 14:53:08 UTC 2021 - Dr. Werner Fink <werner@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.
|
||||||
|
|
||||||
|
-------------------------------------------------------------------
|
||||||
|
Fri Mar 5 14:10:11 UTC 2021 - Dr. Werner Fink <werner@suse.de>
|
||||||
|
|
||||||
|
- Change patch 0001-Use-mountinfo-to-be-able-to-use-the-mount-identity.patch
|
||||||
|
* Fix bsc#1178407: fuser does not show open kvm storage image files
|
||||||
|
such as qcow2 files. Patch from Ali Abdallah <ali.abdallah@suse.com>
|
||||||
|
|
||||||
|
-------------------------------------------------------------------
|
||||||
|
Thu Jan 14 15:48:53 UTC 2021 - Dr. Werner Fink <werner@suse.de>
|
||||||
|
|
||||||
|
- Now with 23.3 peekfd is build even for aarch64
|
||||||
|
|
||||||
|
-------------------------------------------------------------------
|
||||||
|
Thu Jan 14 11:58:43 UTC 2021 - Dr. Werner Fink <werner@suse.de>
|
||||||
|
|
||||||
|
- Rework 0001-Use-mountinfo-to-be-able-to-use-the-mount-identity.patch
|
||||||
|
and split off the patch psmisc-v23.3-selinux.patch
|
||||||
|
- Rework 0002-Use-new-statx-2-system-call-to-avoid-hangs-on-NFS.patch
|
||||||
|
- New patch psmisc-v23.3-selinux.patch
|
||||||
|
- Rename patch psmisc-v23.2.dif which is now psmisc-v23.3.dif
|
||||||
|
|
||||||
|
-------------------------------------------------------------------
|
||||||
|
Thu Dec 31 09:40:07 UTC 2020 - Paolo Stivanin <info@paolostivanin.com>
|
||||||
|
|
||||||
|
- Update to 23.3:
|
||||||
|
* killall: check also truncated 16 char comm names Debian
|
||||||
|
* fuser: Return early if have nulls
|
||||||
|
* peekfd: Add support for ARM64
|
||||||
|
* pstree: Add color by age
|
||||||
|
* fuser: Use larger inode sizes
|
||||||
|
- Rebase 0001-Use-mountinfo-to-be-able-to-use-the-mount-identity.patch
|
||||||
|
- Rebase 0002-Use-new-statx-2-system-call-to-avoid-hangs-on-NFS.patch
|
||||||
|
- Rebase psmisc-22.21-pstree.patch
|
||||||
|
|
||||||
|
-------------------------------------------------------------------
|
||||||
|
Fri Oct 16 10:18:52 UTC 2020 - Ludwig Nussel <lnussel@suse.de>
|
||||||
|
|
||||||
|
- prepare usrmerge (boo#1029961)
|
||||||
|
|
||||||
|
-------------------------------------------------------------------
|
||||||
|
Mon Apr 27 14:57:57 UTC 2020 - Dr. Werner Fink <werner@suse.de>
|
||||||
|
|
||||||
|
- Modify patch 0001-Use-mountinfo-to-be-able-to-use-the-mount-identity.patch
|
||||||
|
* Allow not unique mounts as well as not unique mountpoint (bsc#1170247)
|
||||||
|
|
||||||
|
-------------------------------------------------------------------
|
||||||
|
Thu Sep 19 11:57:44 UTC 2019 - Ludwig Nussel <lnussel@suse.de>
|
||||||
|
|
||||||
|
- Do not recommend lang package. The lang package already has a
|
||||||
|
supplements.
|
||||||
|
|
||||||
|
-------------------------------------------------------------------
|
||||||
|
Fri Nov 30 13:21:44 UTC 2018 - Dr. Werner Fink <werner@suse.de>
|
||||||
|
|
||||||
|
- Modify patch 0001-Use-mountinfo-to-be-able-to-use-the-mount-identity.patch
|
||||||
|
* Always initialize head of simple linked list (bsc#1098697)
|
||||||
|
* stat(2) on binary does not see subvol dev
|
||||||
|
|
||||||
|
-------------------------------------------------------------------
|
||||||
|
Wed Nov 14 07:44:55 UTC 2018 - Dr. Werner Fink <werner@suse.de>
|
||||||
|
|
||||||
|
- Modify patch 0001-Use-mountinfo-to-be-able-to-use-the-mount-identity.patch
|
||||||
|
to handle sub volumes of the btrFS (bsc#1112780)
|
||||||
|
|
||||||
|
-------------------------------------------------------------------
|
||||||
|
Mon Nov 5 07:48:25 UTC 2018 - Dr. Werner Fink <werner@suse.de>
|
||||||
|
|
||||||
|
- Modify patch 0002-Use-new-statx-2-system-call-to-avoid-hangs-on-NFS.patch
|
||||||
|
to support older systems with statx kernel support
|
||||||
|
|
||||||
|
-------------------------------------------------------------------
|
||||||
|
Fri Nov 2 13:37:49 UTC 2018 - Dr. Werner Fink <werner@suse.de>
|
||||||
|
|
||||||
|
- Modify patch 0001-Use-mountinfo-to-be-able-to-use-the-mount-identity.patch
|
||||||
|
to respect autofs as well as afs file system
|
||||||
|
- Add patch 0002-Use-new-statx-2-system-call-to-avoid-hangs-on-NFS.patch
|
||||||
|
to use statx(2) system call since kernel 4.12. Now it is possible
|
||||||
|
to avoid sync with remote file servers as well as trigger autofs
|
||||||
|
mounts due stat(x) calls.
|
||||||
|
|
||||||
|
-------------------------------------------------------------------
|
||||||
|
Tue Oct 23 10:10:12 UTC 2018 - Dr. Werner Fink <werner@suse.de>
|
||||||
|
|
||||||
|
- Support also btrFS entries in mountinfo, that is use stat(2) to
|
||||||
|
determine the device of the mounted subvolume (bsc#1098697, bsc#1112780)
|
||||||
|
|
||||||
|
-------------------------------------------------------------------
|
||||||
|
Mon Oct 22 10:52:10 UTC 2018 - Dr. Werner Fink <werner@suse.de>
|
||||||
|
|
||||||
|
- Update to version 23.2
|
||||||
|
* misc: Command names increased from 16 to 64 characters
|
||||||
|
* buildsys: signals.c depends on signames.h !16
|
||||||
|
* docs: Fix fuser.1 groff errors Debian #900225
|
||||||
|
* killall: look at all namespaces by default
|
||||||
|
* killall: Fix -INT option parsing #11
|
||||||
|
* killall: ignore -n 0 #15
|
||||||
|
* killall: another crack at fixing getopt #12 #13
|
||||||
|
* peekfd: Attach to all threads option !15
|
||||||
|
* pslog: Define PATH_MAX if required Debian:#905797
|
||||||
|
- Modify patch 0001-Use-mountinfo-to-be-able-to-use-the-mount-identity.patch
|
||||||
|
- Remove patches now upstream solved
|
||||||
|
* psmisc-23.0-killall-signals.patch
|
||||||
|
* psmisc-23.0-killall.patch
|
||||||
|
- Modify and rename patch psmisc-23.0.dif which now becomes psmisc-v23.2.dif
|
||||||
|
|
||||||
|
-------------------------------------------------------------------
|
||||||
|
Mon Sep 17 12:08:31 UTC 2018 - Dr. Werner Fink <werner@suse.de>
|
||||||
|
|
||||||
|
- Add COPYING to file list as otherwise a required fix does not
|
||||||
|
reach anything
|
||||||
|
|
||||||
|
-------------------------------------------------------------------
|
||||||
|
Fri Jun 22 16:33:00 UTC 2018 - werner@suse.de
|
||||||
|
|
||||||
|
- 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)
|
||||||
|
|
||||||
|
-------------------------------------------------------------------
|
||||||
|
Thu May 17 10:32:53 UTC 2018 - werner@suse.de
|
||||||
|
|
||||||
|
- Modify patch 0001-Use-mountinfo-to-be-able-to-use-the-mount-identity.patch
|
||||||
|
to let fuser -m also work for private mounts as well (boo#1093665)
|
||||||
|
|
||||||
|
-------------------------------------------------------------------
|
||||||
|
Fri Oct 13 07:10:39 UTC 2017 - werner@suse.de
|
||||||
|
|
||||||
|
- Modify patch 0001-Use-mountinfo-to-be-able-to-use-the-mount-identity.patch
|
||||||
|
to run even on older kernels missing mnt_id tag in fdinfo
|
||||||
|
|
||||||
|
-------------------------------------------------------------------
|
||||||
|
Mon Sep 18 10:17:52 UTC 2017 - werner@suse.de
|
||||||
|
|
||||||
|
- Add patch psmisc-23.0-killall-signals.patch to fix boo#1058990
|
||||||
|
by prior scanning for signal names in the arguments of killall
|
||||||
|
|
||||||
|
-------------------------------------------------------------------
|
||||||
|
Thu Jul 6 13:59:36 UTC 2017 - werner@suse.de
|
||||||
|
|
||||||
|
- Update patch
|
||||||
|
0001-Use-mountinfo-to-be-able-to-use-the-mount-identity.patch
|
||||||
|
|
||||||
|
-------------------------------------------------------------------
|
||||||
|
Wed Jul 5 13:24:01 UTC 2017 - werner@suse.de
|
||||||
|
|
||||||
|
- Remove patches
|
||||||
|
* psmisc-22.21-lessnfs.patch
|
||||||
|
* psmisc-22.21-mntpt.patch
|
||||||
|
* psmisc-23.0-net.patch
|
||||||
|
- Add patch
|
||||||
|
0001-Use-mountinfo-to-be-able-to-use-the-mount-identity.patch
|
||||||
|
from https://gitlab.com/bitstreamout/psmisc/tree/mountinfo
|
||||||
|
which is a heavily rework fuser used on NFS
|
||||||
|
* Use mountinfo to be able to use the mount identity
|
||||||
|
which allows to distinguish different mounts with the
|
||||||
|
same device number as it happens with NFS shares.
|
||||||
|
* Smaller cleanup as support of chroot environments
|
||||||
|
and older systems.
|
||||||
|
* Add support for name_to_handle_at() system call to
|
||||||
|
get the real mount ID for each file
|
||||||
|
- Use test suite of psmisc in %check rpm section
|
||||||
|
|
||||||
|
-------------------------------------------------------------------
|
||||||
|
Wed Jun 28 13:11:49 UTC 2017 - werner@suse.de
|
||||||
|
|
||||||
|
- Add patch psmisc-23.0-net.patch to reenable network support
|
||||||
|
broken to my own upstream commit
|
||||||
|
|
||||||
|
-------------------------------------------------------------------
|
||||||
|
Wed Jun 28 10:00:16 UTC 2017 - werner@suse.de
|
||||||
|
|
||||||
|
- Add patch psmisc-23.0-killall.patch to remove left over debug
|
||||||
|
output in killall utility (boo#1046237)
|
||||||
|
|
||||||
|
-------------------------------------------------------------------
|
||||||
|
Tue Jun 20 15:06:43 UTC 2017 - werner@suse.de
|
||||||
|
|
||||||
|
- Update to version 23.0
|
||||||
|
* killall: Fix process age race condition !11 Debian #822861
|
||||||
|
* killall: only use scope of current namespace by default
|
||||||
|
* killall: better parsing of command names
|
||||||
|
* pstree: add cgroup namespaces !10
|
||||||
|
* peekfd: Help give long options too !5
|
||||||
|
* killall: correctly report when 32+ procs match !8
|
||||||
|
* prtat: Remove duplicate options in man page !3 Debian #846387
|
||||||
|
* pslog: New program to check what logs are open merge !1
|
||||||
|
* fuser: increase path length for octal escaping SF [#37]
|
||||||
|
* Make usage of linked lists of devices found in
|
||||||
|
/proc/self/mountinfo optional
|
||||||
|
* Make timeout() in timeout.c work with shared mmap to
|
||||||
|
reduce the load due write/read the stat buffers
|
||||||
|
* Add list_sort() to lists.h to be able to sort lists
|
||||||
|
* fuser: Fixed typo for -M flag. Debian #740275
|
||||||
|
* pstree: by default doesn't show threadnames, use -t to show
|
||||||
|
as it disables compaction. SF [#33] Debian #815902
|
||||||
|
* pstree: Removed need for PATH_MAX Debian #750405
|
||||||
|
* pstree: ignores disappeared processes. SF [#34]
|
||||||
|
* killall: -o and -y work with -r flags. SF [#64]
|
||||||
|
* m4/gettext.m4: Upgrade to gettext-0.19.4.
|
||||||
|
* m4/iconv.m4: Upgrade to gettext-0.19.4.
|
||||||
|
* m4/lib-ld.m4: Upgrade to gettext-0.19.4.
|
||||||
|
* m4/lib-link.m4: Upgrade to gettext-0.19.4.
|
||||||
|
* m4/lib-prefix.m4: Upgrade to gettext-0.19.4.
|
||||||
|
* m4/nls.m4: Upgrade to gettext-0.19.4.
|
||||||
|
* m4/po.m4: Upgrade to gettext-0.19.4.
|
||||||
|
* m4/progtest.m4: Upgrade to gettext-0.19.4.
|
||||||
|
* configure.ac (AM_GNU_GETTEXT_VERSION): Bump to 0.19.4.
|
||||||
|
- Make it build, that is create a po/POTFILES.in
|
||||||
|
- Remove obsolete patches
|
||||||
|
* psmisc-22.21-boo908063.patch
|
||||||
|
* psmisc-22.12-tigetstr.patch
|
||||||
|
* psmisc-22.21-upstream.patch
|
||||||
|
* psmisc-git-3638cc55b4d08851faba46635d737b24d016665b.patch
|
||||||
|
- Rename patch psmisc-22.21.dif which becomes psmisc-23.0.dif
|
||||||
|
- Make /bin/fuser a symblic link of /usr/bin/fuser (boo#1029973)
|
||||||
|
- Last revision was 78
|
||||||
|
|
||||||
|
-------------------------------------------------------------------
|
||||||
|
Tue Jun 20 14:00:36 UTC 2017 - werner@suse.de
|
||||||
|
|
||||||
|
- Modify psmisc-22.21.dif to enforce the usage of `m' flag in
|
||||||
|
sscanf() instead of `a' for allocation. Also avoid to small
|
||||||
|
buffers and include sys/sysmacros.h for makedev macro.
|
||||||
|
- Add the patch psmisc-22.21-lessnfs.patch to support device
|
||||||
|
files of mount points as well (boo#1044638)
|
||||||
|
- Add the patch psmisc-22.21-mntpt.patch to do strinfg comparision
|
||||||
|
only for NFS shares
|
||||||
|
|
||||||
|
-------------------------------------------------------------------
|
||||||
|
Thu May 21 13:39:34 UTC 2015 - schwab@suse.de
|
||||||
|
|
||||||
|
- Replace negative list %nopeek with positive list %have_peekfd
|
||||||
|
|
||||||
|
-------------------------------------------------------------------
|
||||||
|
Tue Mar 24 11:58:08 UTC 2015 - werner@suse.de
|
||||||
|
|
||||||
|
- Add patch psmisc-22.21-boo908063.patch to avoid to close files
|
||||||
|
which are never open (boo#908063)
|
||||||
|
|
||||||
|
-------------------------------------------------------------------
|
||||||
|
Fri Apr 25 00:59:39 CEST 2014 - ro@suse.de
|
||||||
|
|
||||||
|
- add patch to fix fuser -M option active all the time (bnc#874983)
|
||||||
|
psmisc-git-3638cc55b4d08851faba46635d737b24d016665b.patch
|
||||||
|
|
||||||
|
-------------------------------------------------------------------
|
||||||
|
Mon Mar 24 16:01:51 UTC 2014 - werner@suse.de
|
||||||
|
|
||||||
|
- Update to version 22.21
|
||||||
|
* Missing comma in fuser(1) added Debian #702391
|
||||||
|
* pstree uses COLUMN env variable Debian #717017
|
||||||
|
* pstree shows proper thread names SF Bug#57
|
||||||
|
* pstree shows namespace options SF Patch#30
|
||||||
|
* killall.1 minor fixes SF Bug#59
|
||||||
|
* peekfd for m68k SF Patch#31
|
||||||
|
* Fixing some derefefed pointers SF Patch#32
|
||||||
|
* Minor typos in man pages SF Bug#61 Bug#60
|
||||||
|
* fuser -m and -M flags work either way Debian #606178
|
||||||
|
- Remove patch
|
||||||
|
psmisc-22.20-pstree.patch as now part of upstream
|
||||||
|
peekfd-m68k.patch as now part of upstream
|
||||||
|
- Port the patches
|
||||||
|
psmisc-22.20-upstream.patch which becomes psmisc-22.21-upstream.patch
|
||||||
|
psmisc-22.20.dif which becomes psmisc-22.21.dif
|
||||||
|
psmisc-22.12-pstree.patch which becomes psmisc-22.21-pstree.patch
|
||||||
|
|
||||||
|
-------------------------------------------------------------------
|
||||||
|
Wed Oct 23 14:35:46 UTC 2013 - p.drouand@gmail.com
|
||||||
|
|
||||||
|
- Remove %fillup_prereq %insserv_prereq PreReq; package provides
|
||||||
|
neither sysconfigfile or sysvinit script
|
||||||
|
- Use %lang_package instead of define a lang subpackage manually
|
||||||
|
- Use %configure instead of ./configure
|
||||||
|
- Don't define CC and CXX flags manually
|
||||||
|
- Remove redundant %clean section
|
||||||
|
|
||||||
|
-------------------------------------------------------------------
|
||||||
|
Wed Oct 9 12:33:26 UTC 2013 - schwab@suse.de
|
||||||
|
|
||||||
|
- peekfd-m68k.patch: Port peekfd to m68k
|
||||||
|
|
||||||
|
-------------------------------------------------------------------
|
||||||
|
Sat Feb 9 12:46:46 UTC 2013 - schwab@suse.de
|
||||||
|
|
||||||
|
- peekfd hasn't been ported to aarch64 yet
|
||||||
|
|
||||||
|
-------------------------------------------------------------------
|
||||||
|
Tue Dec 18 17:16:02 UTC 2012 - werner@suse.de
|
||||||
|
|
||||||
|
- Update to version 22.20 + upstream patch
|
||||||
|
* Make usage of linked lists of devices found in
|
||||||
|
/proc/self/mountinfo optional
|
||||||
|
* Make timeout() in timeout.c work with shared mmap to
|
||||||
|
reduce the load due write/read the stat buffers
|
||||||
|
* Add list_sort() to lists.h to be able to sort lists
|
||||||
|
* pstree sorts properly on names Debian #682014
|
||||||
|
* fuser -m regresion fixed SF #3559232, thanks to hanpt
|
||||||
|
* pstree finds orphaned processes SF#3537508
|
||||||
|
* fuser finds unix sockets again SF #3502649
|
||||||
|
* pstree finds pid 0 stops looping Debian #687829
|
||||||
|
* killall with no args exits again SF #3536526
|
||||||
|
* Added AC_CANONICAL_TARGET for target_os Debian #673485
|
||||||
|
* sed doesn't have [0-9]+ replace with [0-9][0-9]*
|
||||||
|
* assert in killall triggered for small lifetimes Debian #628617
|
||||||
|
* killall MAX_NAMES off by one Debian #677428
|
||||||
|
* Removed remaining parts of pidof
|
||||||
|
* fuser uses correct timeout_stat define Debian #661723
|
||||||
|
* fuser is not compiled on hurd-i386 Debian #673485
|
||||||
|
* No TEXTRELS in src/lists built as PIE on x86
|
||||||
|
* Fake pstree root for kernels with hidepid turned on
|
||||||
|
* More fixes for Cygwin SF Patch #3511920
|
||||||
|
* pstree can show PGIDs SF Patch #3471056
|
||||||
|
- This should fix the bug reported by Madhu
|
||||||
|
|
||||||
|
-------------------------------------------------------------------
|
||||||
|
Tue Mar 13 15:26:37 UTC 2012 - werner@suse.de
|
||||||
|
|
||||||
|
- Submit ASCII null fix in pstree upsrtream
|
||||||
|
- Submit support for static background process for stat system call
|
||||||
|
upstream
|
||||||
|
- Rebuild package with upstream patches
|
||||||
|
|
||||||
|
-------------------------------------------------------------------
|
||||||
|
Mon Feb 27 17:43:46 UTC 2012 - werner@suse.de
|
||||||
|
|
||||||
|
- Update to version 22.16
|
||||||
|
* Use strncpy for COMM_LEN and make it 18 characters to cover
|
||||||
|
brackets in name.
|
||||||
|
* don't change COMM_LEN, it breaks matching long commands
|
||||||
|
Debian #661145
|
||||||
|
* Enable some harden AM_CFLAGS by default, use configure option
|
||||||
|
--disable-harden-flags to not use it.
|
||||||
|
* Use ENOENT not EBADE for FreeBSD Debian #631566
|
||||||
|
* Fix prstat typos
|
||||||
|
* Stop zombies by using waitpid Ubuntu #876387 by Peter Holik, SF#3429674
|
||||||
|
* Fixed minor older/younger typo in killall.1 thanks to Maikel Linke
|
||||||
|
* Correct defines for timeout in configure.ac
|
||||||
|
|
||||||
|
-------------------------------------------------------------------
|
||||||
|
Thu Dec 1 15:57:50 UTC 2011 - coolo@suse.com
|
||||||
|
|
||||||
|
- add automake as buildrequire to avoid implicit dependency
|
||||||
|
|
||||||
|
-------------------------------------------------------------------
|
||||||
|
Tue Oct 11 15:36:40 UTC 2011 - werner@suse.de
|
||||||
|
|
||||||
|
- Use __builtin___strcpy_ instead of __builtin___strcpy_chk to avoid
|
||||||
|
trouble with char path[0] tag in struct handle (bnc#723304)
|
||||||
|
|
||||||
|
-------------------------------------------------------------------
|
||||||
|
Fri Oct 7 14:08:31 UTC 2011 - werner@suse.de
|
||||||
|
|
||||||
|
- Make main fuser process more robust against broken pipe and check
|
||||||
|
for helper process within a SIGCHLD handler
|
||||||
|
|
||||||
|
-------------------------------------------------------------------
|
||||||
|
Wed Oct 5 09:47:38 UTC 2011 - werner@suse.de
|
||||||
|
|
||||||
|
- Handle internal size of structure stat by including config.h
|
||||||
|
to avoid size missmatch during copy result back (bnc#720882)
|
||||||
|
|
||||||
|
-------------------------------------------------------------------
|
||||||
|
Mon Oct 3 10:56:19 UTC 2011 - mmarek@suse.cz
|
||||||
|
|
||||||
|
- Fix segfault in pstree, patch by Tetsuo Handa (bnc#718915).
|
||||||
|
|
||||||
|
-------------------------------------------------------------------
|
||||||
|
Wed Sep 28 10:43:03 UTC 2011 - coolo@suse.com
|
||||||
|
|
||||||
|
- back out the timeout patch, it breaks fuser on i586 completely
|
||||||
|
(bnc#720882)
|
||||||
|
|
||||||
|
-------------------------------------------------------------------
|
||||||
|
Mon Sep 12 14:28:38 UTC 2011 - werner@suse.de
|
||||||
|
|
||||||
|
- Update to pre version 22.15
|
||||||
|
+ Really apply patch for SF#31110178 RH#651794
|
||||||
|
+ Conditionally use fork before stat calls
|
||||||
|
+ Patch from Corrina Vinschen for compiling on cygwin
|
||||||
|
+ Remove doubled content in src/lists.h
|
||||||
|
+ Add another 2 for thread brackets in pstree.c
|
||||||
|
- Change fork before stat calls to be in best case a second process
|
||||||
|
using two pipes for bidirectional communication with main.
|
||||||
|
|
||||||
-------------------------------------------------------------------
|
-------------------------------------------------------------------
|
||||||
Tue Jun 21 15:56:45 CEST 2011 - werner@suse.de
|
Tue Jun 21 15:56:45 CEST 2011 - werner@suse.de
|
||||||
|
|
||||||
|
|||||||
114
psmisc.spec
114
psmisc.spec
@@ -1,7 +1,7 @@
|
|||||||
#
|
#
|
||||||
# spec file for package psmisc
|
# spec file for package psmisc
|
||||||
#
|
#
|
||||||
# Copyright (c) 2011 SUSE LINUX Products GmbH, Nuernberg, Germany.
|
# Copyright (c) 2025 SUSE LLC
|
||||||
#
|
#
|
||||||
# All modifications and additions to the file contributed by third parties
|
# All modifications and additions to the file contributed by third parties
|
||||||
# remain the property of their copyright owners, unless otherwise agreed
|
# remain the property of their copyright owners, unless otherwise agreed
|
||||||
@@ -12,32 +12,46 @@
|
|||||||
# license that conforms to the Open Source Definition (Version 1.9)
|
# license that conforms to the Open Source Definition (Version 1.9)
|
||||||
# published by the Open Source Initiative.
|
# published by the Open Source Initiative.
|
||||||
|
|
||||||
# Please submit bugfixes or comments via http://bugs.opensuse.org/
|
# Please submit bugfixes or comments via https://bugs.opensuse.org/
|
||||||
#
|
#
|
||||||
|
|
||||||
# norootforbuild
|
|
||||||
|
|
||||||
|
%bcond_without apparmor
|
||||||
|
|
||||||
Name: psmisc
|
Name: psmisc
|
||||||
BuildRequires: gcc-c++ glibc-devel ncurses-devel
|
BuildRequires: autoconf
|
||||||
|
BuildRequires: automake
|
||||||
|
BuildRequires: dejagnu
|
||||||
|
BuildRequires: gcc-c++
|
||||||
|
BuildRequires: gettext-devel
|
||||||
|
BuildRequires: glibc-devel
|
||||||
BuildRequires: libselinux-devel
|
BuildRequires: libselinux-devel
|
||||||
Url: http://sourceforge.net/projects/psmisc/
|
BuildRequires: linux-glibc-devel >= 4.12
|
||||||
License: GPLv2+
|
BuildRequires: ncurses-devel
|
||||||
Group: System/Monitoring
|
BuildRequires: netcat-openbsd
|
||||||
PreReq: %fillup_prereq %insserv_prereq
|
%if %{with apparmor}
|
||||||
Version: 22.14
|
BuildRequires: pkgconfig(libapparmor)
|
||||||
Release: 1
|
%endif
|
||||||
|
URL: https://gitlab.com/psmisc/psmisc/
|
||||||
|
Version: 23.7
|
||||||
|
Release: 0
|
||||||
Provides: ps:/usr/bin/killall
|
Provides: ps:/usr/bin/killall
|
||||||
Summary: Utilities for managing processes on your system
|
Summary: Utilities for managing processes on your system
|
||||||
Source: http://sourceforge.net/projects/psmisc/files/psmisc/%{name}-%{version}.tar.gz
|
License: GPL-2.0-or-later
|
||||||
Patch0: %name-22.14.dif
|
Group: System/Monitoring
|
||||||
Patch1: %name-22.12-tigetstr.patch
|
Source: https://gitlab.com/%{name}/%{name}/-/archive/v%{version}/%{name}-v%{version}.tar.bz2
|
||||||
Patch2: %name-22.12-pstree_overflow.patch
|
Patch0: %{name}-v%{version}.dif
|
||||||
Patch3: %name-22.12-pstree.patch
|
Patch1: 0001-killall,pstree-use-clock_gettime-not-uptime.patch
|
||||||
Patch4: %name-22.14-toomuch.dif
|
Patch2: %{name}-22.21-pstree.patch
|
||||||
|
# PATCH-ADD-SUSE boo#908068, boo#1046237, boo#1046237
|
||||||
|
# https://gitlab.com/bitstreamout/psmisc/tree/mountinfo
|
||||||
|
Patch3: 0001-Use-mountinfo-to-be-able-to-use-the-mount-identity.patch
|
||||||
|
# https://gitlab.com/psmisc/psmisc/-/issues/59
|
||||||
|
Patch4: psmisc-gcc15.patch
|
||||||
|
# https://gitlab.com/psmisc/psmisc/-/issues/57
|
||||||
|
Patch5: 0001-fuser-Fix-expandpath.patch
|
||||||
|
|
||||||
BuildRoot: %{_tmppath}/%{name}-%{version}-build
|
%define have_peekfd %ix86 x86_64 ppc ppc64 ppc64le %arm mipsel m68k aarch64 loongarch64
|
||||||
%define nopeek s390 s390x ia64 %sparc hppa
|
|
||||||
|
|
||||||
%description
|
%description
|
||||||
The psmisc package contains utilities for managing processes on your
|
The psmisc package contains utilities for managing processes on your
|
||||||
@@ -47,52 +61,74 @@ command sends a specified signal (SIGTERM if nothing is specified) to
|
|||||||
processes identified by name. The fuser command identifies the PIDs of
|
processes identified by name. The fuser command identifies the PIDs of
|
||||||
processes that are using specified files or filesystems.
|
processes that are using specified files or filesystems.
|
||||||
|
|
||||||
|
%lang_package
|
||||||
|
|
||||||
%prep
|
%prep
|
||||||
%setup -q
|
%setup -q -n %{name}-v%{version}
|
||||||
%patch1 -p0 -b .tigetstr
|
%patch -P 1 -p0 -b .uptime
|
||||||
%patch2 -p0 -b .pstreeovfl
|
%patch -P 2 -p0 -b .pstree
|
||||||
%patch3 -p0 -b .pstree
|
%patch -P 3 -p0 -b .mntinf
|
||||||
%patch4 -p0 -b .2much
|
%patch -P 5 -p1 -b .tcp
|
||||||
%patch0 -p0 -b .0
|
%patch -P 0 -p0 -b .p0
|
||||||
|
%patch -P 4 -p1
|
||||||
|
|
||||||
%build
|
%build
|
||||||
|
grep -h src/ po/*.po|\
|
||||||
|
sed -r 's/^#: //'|\
|
||||||
|
tr ' ' '\n'|\
|
||||||
|
sort -t : -k1,1 -u|\
|
||||||
|
sed -r 's/:[0-9]+$//' > po/POTFILES.in
|
||||||
|
echo %version > .tarball-version
|
||||||
autoreconf -fi
|
autoreconf -fi
|
||||||
CFLAGS="-D_GNU_SOURCE ${RPM_OPT_FLAGS} -pipe"
|
CFLAGS="-D_GNU_SOURCE -D_DEFAULT_SOURCE ${RPM_OPT_FLAGS} -pipe -fPIE"
|
||||||
CXXFLAGS="$CFLAGS"
|
CXXFLAGS="$CFLAGS"
|
||||||
|
LDFLAGS=-pie
|
||||||
CC=gcc
|
CC=gcc
|
||||||
CXX=g++
|
export CFLAGS CXXFLAGS LDFLAGS CC
|
||||||
export CFLAGS CXXFLAGS CC CXX
|
%configure --disable-rpath \
|
||||||
sh ./configure --prefix=%{_prefix} --mandir=%{_mandir} --enable-selinux
|
--with-gnu-ld \
|
||||||
|
%{?with_apparmor:--enable-apparmor} \
|
||||||
|
--enable-selinux
|
||||||
make %{?_smp_mflags} CFLAGS="$CFLAGS" "CC=$CC"
|
make %{?_smp_mflags} CFLAGS="$CFLAGS" "CC=$CC"
|
||||||
|
|
||||||
|
%check
|
||||||
|
make check
|
||||||
|
|
||||||
%install
|
%install
|
||||||
make DESTDIR=$RPM_BUILD_ROOT install
|
make DESTDIR=%{buildroot} install
|
||||||
mkdir -p $RPM_BUILD_ROOT/bin/
|
%if 0%{?suse_version} < 1550
|
||||||
mv $RPM_BUILD_ROOT/usr/bin/fuser $RPM_BUILD_ROOT/bin/
|
mkdir -p %{buildroot}/bin/
|
||||||
%ifarch %nopeek
|
ln -sf %{_bindir}/fuser %{buildroot}/bin/
|
||||||
rm -f $RPM_BUILD_ROOT%{_mandir}/man1/peekfd.1*
|
%endif
|
||||||
|
%ifnarch %have_peekfd
|
||||||
|
rm -f %{buildroot}%{_mandir}/man1/peekfd.1*
|
||||||
%endif
|
%endif
|
||||||
%find_lang psmisc
|
%find_lang psmisc
|
||||||
|
|
||||||
%clean
|
%files
|
||||||
rm -rf $RPM_BUILD_ROOT
|
|
||||||
|
|
||||||
%files -f psmisc.lang
|
|
||||||
%defattr (-,root,root,755)
|
%defattr (-,root,root,755)
|
||||||
|
%license COPYING
|
||||||
|
%if 0%{?suse_version} < 1550
|
||||||
/bin/fuser
|
/bin/fuser
|
||||||
|
%endif
|
||||||
|
%{_bindir}/fuser
|
||||||
%{_bindir}/killall
|
%{_bindir}/killall
|
||||||
%ifnarch %nopeek
|
%ifarch %have_peekfd
|
||||||
%{_bindir}/peekfd
|
%{_bindir}/peekfd
|
||||||
%endif
|
%endif
|
||||||
%{_bindir}/prtstat
|
%{_bindir}/prtstat
|
||||||
|
%{_bindir}/pslog
|
||||||
%{_bindir}/pstree
|
%{_bindir}/pstree
|
||||||
%{_bindir}/pstree.x11
|
%{_bindir}/pstree.x11
|
||||||
%{_mandir}/man1/fuser.1*
|
%{_mandir}/man1/fuser.1*
|
||||||
%{_mandir}/man1/killall.1*
|
%{_mandir}/man1/killall.1*
|
||||||
%ifnarch %nopeek
|
%ifarch %have_peekfd
|
||||||
%{_mandir}/man1/peekfd.1*
|
%{_mandir}/man1/peekfd.1*
|
||||||
%endif
|
%endif
|
||||||
%{_mandir}/man1/prtstat.1*
|
%{_mandir}/man1/prtstat.1*
|
||||||
|
%{_mandir}/man1/pslog.1*
|
||||||
%{_mandir}/man1/pstree.1*
|
%{_mandir}/man1/pstree.1*
|
||||||
|
|
||||||
|
%files lang -f %{name}.lang
|
||||||
|
|
||||||
%changelog
|
%changelog
|
||||||
|
|||||||
Reference in New Issue
Block a user