summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
-rw-r--r--groups.d/231.native_packages_etc.d/procps_ng.package8
-rw-r--r--patches/procps_ng-3.3.17.local.patch215
-rw-r--r--patches/procps_ng-4.0.4.local.patch124
3 files changed, 128 insertions, 219 deletions
diff --git a/groups.d/231.native_packages_etc.d/procps_ng.package b/groups.d/231.native_packages_etc.d/procps_ng.package
index ab4c6201..59757fea 100644
--- a/groups.d/231.native_packages_etc.d/procps_ng.package
+++ b/groups.d/231.native_packages_etc.d/procps_ng.package
@@ -1,10 +1,10 @@
: ${PKG_PROCPS_NG_DEPENDS:="ncurses ncursesw"};
-: ${PKG_PROCPS_NG_SHA256SUM:=4518b3e7aafd34ec07d0063d250fd474999b20b200218c3ae56f5d2113f141b4};
-: ${PKG_PROCPS_NG_VERSION:=3.3.17};
-: ${PKG_PROCPS_NG_URL:=http://mirror.internode.on.net/pub/slackware/slackware64/source/a/procps-ng/procps-ng-${PKG_PROCPS_NG_VERSION}.tar.xz};
+: ${PKG_PROCPS_NG_SHA256SUM:=22870d6feb2478adb617ce4f09a787addaf2d260c5a8aa7b17d889a962c5e42e};
+: ${PKG_PROCPS_NG_VERSION:=4.0.4};
+: ${PKG_PROCPS_NG_URL:=https://fossies.org/linux/misc/procps-ng-${PKG_PROCPS_NG_VERSION}.tar.xz};
: ${PKG_PROCPS_NG_CONFIGURE_ARGS_EXTRA:="--disable-kill"};
: ${PKG_PROCPS_NG_CFLAGS_CONFIGURE_EXTRA:=-I${PREFIX_NATIVE}/include/ncursesw};
-: ${PKG_PROCPS_NG_SUBDIR:=procps-${PKG_PROCPS_NG_VERSION}};
+#: ${PKG_PROCPS_NG_SUBDIR:=procps-${PKG_PROCPS_NG_VERSION}};
: ${PKG_PROCPS_NG_IN_TREE:=1};
: ${PKG_PROCPS_NG_MAKEFLAGS_BUILD:="LIBS=-Wl,-lncurses,-ltinfo"};
: ${PKG_PROCPS_NG_FNAME:=procps_ng-${PKG_PROCPS_NG_VERSION}.tar.xz};
diff --git a/patches/procps_ng-3.3.17.local.patch b/patches/procps_ng-3.3.17.local.patch
deleted file mode 100644
index d4f8119d..00000000
--- a/patches/procps_ng-3.3.17.local.patch
+++ /dev/null
@@ -1,215 +0,0 @@
-diff -ru procps-3.3.17.orig/lib/nsutils.c procps-3.3.17/lib/nsutils.c
---- procps-3.3.17.orig/lib/nsutils.c 2021-02-09 11:11:25.000000000 +0100
-+++ procps-3.3.17/lib/nsutils.c 2022-11-07 00:01:25.779153614 +0100
-@@ -16,7 +16,7 @@
- int i, rc = 0;
-
- for (i = 0; i < NUM_NS; i++) {
-- snprintf(buff, sizeof(buff), "/proc/%i/ns/%s", pid,
-+ snprintf(buff, sizeof(buff), "/proc/sysproc/%i/ns/%s", pid,
- get_ns_name(i));
- if (stat(buff, &st)) {
- if (errno != ENOENT)
-diff -ru procps-3.3.17.orig/pidof.c procps-3.3.17/pidof.c
---- procps-3.3.17.orig/pidof.c 2021-02-09 11:11:25.000000000 +0100
-+++ procps-3.3.17/pidof.c 2022-11-07 00:01:45.927153736 +0100
-@@ -117,7 +117,7 @@
- ssize_t path_alloc_size;
- ssize_t len;
-
-- snprintf(link, sizeof(link), "/proc/%d/%s", pid, base_name);
-+ snprintf(link, sizeof(link), "/proc/sysproc/%d/%s", pid, base_name);
-
- len = path_alloc_size = 0;
- result = NULL;
-diff -ru procps-3.3.17.orig/pmap.c procps-3.3.17/pmap.c
---- procps-3.3.17.orig/pmap.c 2021-02-09 11:11:25.000000000 +0100
-+++ procps-3.3.17/pmap.c 2022-11-07 00:02:54.791154154 +0100
-@@ -539,11 +539,11 @@
- printf("%u: %s\n", p->tgid, cmdbuf);
-
- if (x_option || X_option || c_option) {
-- snprintf(buf, sizeof buf, "/proc/%u/smaps", p->tgid);
-+ snprintf(buf, sizeof buf, "/proc/sysproc/%u/smaps", p->tgid);
- if ((fp = fopen(buf, "r")) == NULL)
- return 1;
- } else {
-- snprintf(buf, sizeof buf, "/proc/%u/maps", p->tgid);
-+ snprintf(buf, sizeof buf, "/proc/sysproc/%u/maps", p->tgid);
- if ((fp = fopen(buf, "r")) == NULL)
- return 1;
- }
-diff -ru procps-3.3.17.orig/proc/devname.c procps-3.3.17/proc/devname.c
---- procps-3.3.17.orig/proc/devname.c 2021-02-09 11:11:25.000000000 +0100
-+++ procps-3.3.17/proc/devname.c 2022-11-06 23:54:22.462970842 +0100
-@@ -289,7 +289,7 @@
- struct stat sbuf;
- char path[32];
- ssize_t count;
-- const int len = snprintf(path, sizeof path, "/proc/%d/%s", pid, name); /* often permission denied */
-+ const int len = snprintf(path, sizeof path, "/proc/sysproc/%d/%s", pid, name); /* often permission denied */
- if(len <= 0 || (size_t)len >= sizeof path) return 0;
- count = readlink(path,buf,TTY_NAME_SIZE-1);
- if(count <= 0 || count >= TTY_NAME_SIZE-1) return 0;
-diff -ru procps-3.3.17.orig/proc/escape.c procps-3.3.17/proc/escape.c
---- procps-3.3.17.orig/proc/escape.c 2021-02-09 11:11:25.000000000 +0100
-+++ procps-3.3.17/proc/escape.c 2022-11-04 15:46:20.305190037 +0100
-@@ -21,6 +21,7 @@
- #include <sys/types.h>
- #include <string.h>
- #include <limits.h>
-+#include <langinfo.h>
- #include "procps.h"
- #include "escape.h"
- #include "readproc.h"
-diff -ru procps-3.3.17.orig/proc/readproc.c procps-3.3.17/proc/readproc.c
---- procps-3.3.17.orig/proc/readproc.c 2021-02-09 11:11:25.000000000 +0100
-+++ procps-3.3.17/proc/readproc.c 2022-11-06 23:57:14.382411315 +0100
-@@ -883,7 +883,7 @@
- // warning: interface may change
- int read_cmdline(char *restrict const dst, unsigned sz, unsigned pid) {
- char path[PROCPATHLEN];
-- snprintf(path, sizeof(path), "/proc/%u", pid);
-+ snprintf(path, sizeof(path), "/proc/sysproc/%u", pid);
- return read_unvectored(dst, sz, path, "cmdline", ' ');
- }
-
-@@ -1239,7 +1239,7 @@
- }
- p->tgid = strtoul(ent->d_name, NULL, 10);
- p->tid = p->tgid;
-- snprintf(path, PROCPATHLEN, "/proc/%s", ent->d_name);
-+ snprintf(path, PROCPATHLEN, "/proc/sysproc/%s", ent->d_name);
- return 1;
- }
-
-@@ -1253,7 +1253,7 @@
- closedir(PT->taskdir);
- }
- // use "path" as some tmp space
-- snprintf(path, PROCPATHLEN, "/proc/%d/task", p->tgid);
-+ snprintf(path, PROCPATHLEN, "/proc/sysproc/%d/task", p->tgid);
- PT->taskdir = opendir(path);
- if(!PT->taskdir) return 0;
- PT->taskdir_user = p->tgid;
-@@ -1266,7 +1266,7 @@
- t->tid = strtoul(ent->d_name, NULL, 10);
- t->tgid = p->tgid;
- //t->ppid = p->ppid; // cover for kernel behavior? we want both actually...?
-- snprintf(path, PROCPATHLEN, "/proc/%d/task/%s", p->tgid, ent->d_name);
-+ snprintf(path, PROCPATHLEN, "/proc/sysproc/%d/task/%s", p->tgid, ent->d_name);
- return 1;
- }
-
-@@ -1277,7 +1277,7 @@
- char *restrict const path = PT->path;
- pid_t tgid = *(PT->pids)++;
- if(likely(tgid)){
-- snprintf(path, PROCPATHLEN, "/proc/%d", tgid);
-+ snprintf(path, PROCPATHLEN, "/proc/sysproc/%d", tgid);
- p->tgid = tgid;
- p->tid = tgid; // they match for leaders
- }
-@@ -1677,7 +1677,7 @@
- static char path[32];
- struct stat statbuf;
-
-- snprintf(path, sizeof path, "/proc/%d", pid);
-+ snprintf(path, sizeof path, "/proc/sysproc/%d", pid);
- if (stat(path, &statbuf)) {
- perror("stat");
- return NULL;
-diff -ru procps-3.3.17.orig/proc/sysinfo.c procps-3.3.17/proc/sysinfo.c
---- procps-3.3.17.orig/proc/sysinfo.c 2021-02-09 11:11:25.000000000 +0100
-+++ procps-3.3.17/proc/sysinfo.c 2022-11-06 23:53:23.999176866 +0100
-@@ -488,7 +488,7 @@
- char c;
-
- if (!isdigit(ent->d_name[0])) continue;
-- snprintf(tbuf, sizeof(tbuf), "/proc/%s/stat", ent->d_name);
-+ snprintf(tbuf, sizeof(tbuf), "/proc/sysproc/%s/stat", ent->d_name);
-
- fd = open(tbuf, O_RDONLY, 0);
- if (fd == -1) continue;
-diff -ru procps-3.3.17.orig/proc/wchan.c procps-3.3.17/proc/wchan.c
---- procps-3.3.17.orig/proc/wchan.c 2021-02-09 11:11:25.000000000 +0100
-+++ procps-3.3.17/proc/wchan.c 2022-11-06 23:55:15.750410595 +0100
-@@ -32,7 +32,7 @@
- ssize_t num;
- int fd;
-
-- snprintf(buf, sizeof buf, "/proc/%d/wchan", pid);
-+ snprintf(buf, sizeof buf, "/proc/sysproc/%d/wchan", pid);
- fd = open(buf, O_RDONLY);
- if (fd==-1) return "?";
-
-diff -ru procps-3.3.17.orig/ps/output.c procps-3.3.17/ps/output.c
---- procps-3.3.17.orig/ps/output.c 2021-02-09 11:11:25.000000000 +0100
-+++ procps-3.3.17/ps/output.c 2022-11-06 23:59:52.026412271 +0100
-@@ -1229,7 +1229,7 @@
- int fd;
- u_int32_t luid;
-
-- snprintf(filename, sizeof filename, "/proc/%d/loginuid", pp->tgid);
-+ snprintf(filename, sizeof filename, "/proc/sysproc/%d/loginuid", pp->tgid);
-
- if ((fd = open(filename, O_RDONLY, 0)) != -1) {
- num_read = read(fd, outbuf, OUTBUF_SIZE - 1);
-@@ -1255,7 +1255,7 @@
- char filename[48];
- ssize_t num_read;
-
-- snprintf(filename, sizeof filename, "/proc/%d/exe", pp->tgid);
-+ snprintf(filename, sizeof filename, "/proc/sysproc/%d/exe", pp->tgid);
-
- num_read = readlink(filename, outbuf, OUTBUF_SIZE-1);
- if (num_read > 0) {
-@@ -1371,7 +1371,7 @@
-
- // wchan file is suitable for testing
- //snprintf(filename, sizeof filename, "/proc/%d/wchan", pp->tgid);
-- snprintf(filename, sizeof filename, "/proc/%d/attr/current", pp->tgid);
-+ snprintf(filename, sizeof filename, "/proc/sysproc/%d/attr/current", pp->tgid);
-
- if ((fd = open(filename, O_RDONLY, 0)) != -1) {
- num_read = read(fd, outbuf, OUTBUF_SIZE-1);
-diff -ru procps-3.3.17.orig/pwdx.c procps-3.3.17/pwdx.c
---- procps-3.3.17.orig/pwdx.c 2021-02-09 11:11:25.000000000 +0100
-+++ procps-3.3.17/pwdx.c 2022-11-07 00:00:51.339153405 +0100
-@@ -118,7 +118,7 @@
- * the first char is possible
- */
- if (argv[i][0] != '/')
-- snprintf(buf, buflen, "/proc/%s/cwd", argv[i]);
-+ snprintf(buf, buflen, "/proc/sysproc/%s/cwd", argv[i]);
- else
- snprintf(buf, buflen, "%s/cwd", argv[i]);
-
-diff -ru procps-3.3.17.orig/skill.c procps-3.3.17/skill.c
---- procps-3.3.17.orig/skill.c 2021-02-09 11:11:25.000000000 +0100
-+++ procps-3.3.17/skill.c 2022-11-07 00:00:34.811153304 +0100
-@@ -181,7 +181,7 @@
- if (pid == my_pid || pid == 0)
- return;
- /* pid (cmd) state ppid pgrp session tty */
-- sprintf(buf, "/proc/%d/stat", pid);
-+ sprintf(buf, "/proc/sysproc/%d/stat", pid);
- fd = open(buf, O_RDONLY);
- if (fd == -1) {
- /* process exited maybe */
-diff -ru procps-3.3.17.orig/w.c procps-3.3.17/w.c
---- procps-3.3.17.orig/w.c 2021-02-09 11:11:25.000000000 +0100
-+++ procps-3.3.17/w.c 2022-11-04 15:46:20.305190037 +0100
-@@ -55,11 +55,7 @@
- #include <termios.h>
- #include <time.h>
- #include <unistd.h>
--#ifdef HAVE_UTMPX_H
--# include <utmpx.h>
--#else
--# include <utmp.h>
--#endif
-+#include <utmp.h>
- #include <arpa/inet.h>
-
- static int ignoreuser = 0; /* for '-u' */
diff --git a/patches/procps_ng-4.0.4.local.patch b/patches/procps_ng-4.0.4.local.patch
new file mode 100644
index 00000000..37fb117a
--- /dev/null
+++ b/patches/procps_ng-4.0.4.local.patch
@@ -0,0 +1,124 @@
+diff -ru procps-ng-4.0.4.orig/library/devname.c procps-ng-4.0.4/library/devname.c
+--- procps-ng-4.0.4.orig/library/devname.c 2023-07-11 11:09:18.436786212 +0200
++++ procps-ng-4.0.4/library/devname.c 2024-08-13 11:40:55.012140114 +0200
+@@ -287,7 +287,7 @@
+ struct stat sbuf;
+ char path[32];
+ ssize_t count;
+- const int len = snprintf(path, sizeof path, "/proc/%d/%s", pid, name); /* often permission denied */
++ const int len = snprintf(path, sizeof path, "/proc/sysproc/%d/%s", pid, name); /* often permission denied */
+ if(len <= 0 || (size_t)len >= sizeof path) return 0;
+ count = readlink(path,buf,TTY_NAME_SIZE-1);
+ if(count <= 0 || count >= TTY_NAME_SIZE-1) return 0;
+@@ -305,7 +305,7 @@
+ char path[32];
+ FILE *fp;
+ char *lf;
+- sprintf (path, "/proc/%d/ctty", pid); /* often permission denied */
++ sprintf (path, "/proc/sysproc/%d/ctty", pid); /* often permission denied */
+ fp = fopen (path, "r");
+ if (!fp)
+ return 0;
+diff -ru procps-ng-4.0.4.orig/library/readproc.c procps-ng-4.0.4/library/readproc.c
+--- procps-ng-4.0.4.orig/library/readproc.c 2023-07-11 11:09:18.436786212 +0200
++++ procps-ng-4.0.4/library/readproc.c 2024-08-13 11:38:26.689488350 +0200
+@@ -1389,7 +1389,7 @@
+ p->tgid = strtoul(ent->d_name, NULL, 10);
+ if (errno == 0) {
+ p->tid = p->tgid;
+- snprintf(path, PROCPATHLEN, "/proc/%d", p->tgid);
++ snprintf(path, PROCPATHLEN, "/proc/sysproc/%d", p->tgid);
+ return 1;
+ }
+ }
+@@ -1408,7 +1408,7 @@
+ closedir(PT->taskdir);
+ }
+ // use "path" as some tmp space
+- snprintf(path, PROCPATHLEN, "/proc/%d/task", p->tgid);
++ snprintf(path, PROCPATHLEN, "/proc/sysproc/%d/task", p->tgid);
+ PT->taskdir = opendir(path);
+ if(!PT->taskdir) return 0;
+ PT->taskdir_user = p->tgid;
+@@ -1421,7 +1421,7 @@
+ t->tid = strtoul(ent->d_name, NULL, 10);
+ t->tgid = p->tgid;
+ //t->ppid = p->ppid; // cover for kernel behavior? we want both actually...?
+- snprintf(path, PROCPATHLEN, "/proc/%d/task/%.10s", p->tgid, ent->d_name);
++ snprintf(path, PROCPATHLEN, "/proc/sysproc/%d/task/%.10s", p->tgid, ent->d_name);
+ return 1;
+ }
+
+@@ -1435,7 +1435,7 @@
+ char *path = PT->path;
+
+ if (pid) {
+- snprintf(path, PROCPATHLEN, "/proc/%d", pid);
++ snprintf(path, PROCPATHLEN, "/proc/sysproc/%d", pid);
+ p->tid = p->tgid = pid; // this tgid may be a huge fib |
+
+ /* the 'status' directory is the only place where we find the |
+diff -ru procps-ng-4.0.4.orig/src/pidof.c procps-ng-4.0.4/src/pidof.c
+--- procps-ng-4.0.4.orig/src/pidof.c 2023-08-15 13:02:25.783784823 +0200
++++ procps-ng-4.0.4/src/pidof.c 2024-08-13 11:31:47.634655407 +0200
+@@ -124,7 +124,7 @@
+ ssize_t path_alloc_size;
+ ssize_t len;
+
+- snprintf(link, sizeof(link), "/proc/%d/%s", pid, base_name);
++ snprintf(link, sizeof(link), "/proc/sysproc/%d/%s", pid, base_name);
+
+ len = path_alloc_size = 0;
+ result = NULL;
+diff -ru procps-ng-4.0.4.orig/src/pmap.c procps-ng-4.0.4/src/pmap.c
+--- procps-ng-4.0.4.orig/src/pmap.c 2023-08-15 12:43:38.772140122 +0200
++++ procps-ng-4.0.4/src/pmap.c 2024-08-13 11:28:36.375534274 +0200
+@@ -554,11 +554,11 @@
+ printf("%u: %s\n", PIDS_VAL(tgid, s_int, p, Pids_info), PIDS_VAL(cmdline, str, p, Pids_info));
+
+ if (x_option || X_option || c_option) {
+- snprintf(buf, sizeof buf, "/proc/%u/smaps", PIDS_VAL(tgid, s_int, p, Pids_info));
++ snprintf(buf, sizeof buf, "/proc/sysproc/%u/smaps", PIDS_VAL(tgid, s_int, p, Pids_info));
+ if ((fp = fopen(buf, "r")) == NULL)
+ return 1;
+ } else {
+- snprintf(buf, sizeof buf, "/proc/%u/maps", PIDS_VAL(tgid, s_int, p, Pids_info));
++ snprintf(buf, sizeof buf, "/proc/sysproc/%u/maps", PIDS_VAL(tgid, s_int, p, Pids_info));
+ if ((fp = fopen(buf, "r")) == NULL)
+ return 1;
+ }
+diff -ru procps-ng-4.0.4.orig/src/ps/global.c procps-ng-4.0.4/src/ps/global.c
+--- procps-ng-4.0.4.orig/src/ps/global.c 2023-08-16 00:54:03.759538026 +0200
++++ procps-ng-4.0.4/src/ps/global.c 2024-08-13 11:25:38.536358536 +0200
+@@ -176,7 +176,7 @@
+ const char *bsd_v_format = (const char *)0xdeadbeef;
+ int bsd_c_option = -1;
+ int bsd_e_option = -1;
+-unsigned cached_euid = 0xffffffff;
++uid_t cached_euid = 0xffffffff;
+ int cached_tty = -1;
+ char forest_prefix[4 * 32*1024 + 100]; // FIXME
+ int forest_type = -1;
+diff -ru procps-ng-4.0.4.orig/src/pwdx.c procps-ng-4.0.4/src/pwdx.c
+--- procps-ng-4.0.4.orig/src/pwdx.c 2023-07-11 11:09:18.464787022 +0200
++++ procps-ng-4.0.4/src/pwdx.c 2024-08-13 11:31:25.734756041 +0200
+@@ -53,8 +53,8 @@
+ long pid;
+ char *end = NULL;
+
+- if (!strncmp("/proc/", input, 6))
+- skip = 6;
++ if (!strncmp("/proc/sysproc/", input, 14))
++ skip = 14;
+ errno = 0;
+ pid = strtol(input + skip, &end, 10);
+
+@@ -122,7 +122,7 @@
+ * the first char is possible
+ */
+ if (argv[i][0] != '/')
+- snprintf(buf, buflen, "/proc/%s/cwd", argv[i]);
++ snprintf(buf, buflen, "/proc/sysproc/%s/cwd", argv[i]);
+ else
+ snprintf(buf, buflen, "%s/cwd", argv[i]);
+