Sync from SUSE:SLFO:Main procps revision 90cf1b80923b9f8269a440e1d362954c

This commit is contained in:
Adrian Schröter 2024-10-01 08:51:58 +02:00
parent 844627c634
commit fb2f19b539
40 changed files with 1019 additions and 1445 deletions

176
79042e07.patch Normal file
View File

@ -0,0 +1,176 @@
From 79042e07fab9956135a21b1df7a69d1fbde7ef79 Mon Sep 17 00:00:00 2001
From: Craig Small <csmall@dropbear.xyz>
Date: Tue, 12 Sep 2023 16:59:18 +1000
Subject: [PATCH] ps: Don't crash when using short option
ps would crash with the -si or -sf options with systemd enabled.
The issue was the utmp wasn't filled in, the long option checked, the
short option did not.
Refactored the showinfo() function so instead of a branch with duplicate
prints for the items in both long and short we just branch on the items
for long output.
Also, made the function prototypes not dependendent on systemd enabled,
it was too messy that way and passing a char* NULL is not really going
to hurt anything.
References:
#301
Signed-off-by: Craig Small <csmall@dropbear.xyz>
---
NEWS | 1 +
src/w.c | 61 ++++++++++++++++++++-------------------------------------
2 files changed, 22 insertions(+), 40 deletions(-)
|diff --git a/NEWS b/NEWS
|index 4ad9f74e..883f9139 100644
|--- a/NEWS
|+++ b/NEWS
|@@ -1,5 +1,6 @@
| procps-ng-NEXT
| ---------------
|+ * w: Don't segfault with -s option issue #301
|
| procps-ng-4.0.4
| ---------------
diff --git a/src/w.c b/src/w.c
index fd6e75f7..e2d754b5 100644
--- a/src/w.c
+++ b/src/w.c
@@ -207,9 +207,7 @@ static void print_display_or_interface(const char *restrict host, int len, int r
/* This routine prints either the hostname or the IP address of the remote */
static void print_from(
-#if (defined(WITH_SYSTEMD) || defined(WITH_ELOGIND)) && defined(HAVE_SD_SESSION_GET_LEADER)
const char *session,
-#endif
const utmp_t *restrict const u, const int ip_addresses, const int fromlen) {
#if (defined(WITH_SYSTEMD) || defined(WITH_ELOGIND)) && defined(HAVE_SD_SESSION_GET_LEADER)
if (session) {
@@ -508,11 +506,10 @@ static int find_best_proc(
#undef PIDS_GETSTR
}
+
static void showinfo(
-#if (defined(WITH_SYSTEMD) || defined(WITH_ELOGIND)) && defined(HAVE_SD_SESSION_GET_LEADER)
const char *session, const char *name,
-#endif
- utmp_t * u, int formtype, int maxcmd, int from,
+ utmp_t * u, const int longform, int maxcmd, int from,
const int userlen, const int fromlen, const int ip_addresses,
const int pids)
{
@@ -575,25 +572,20 @@ static void showinfo(
/* force NUL term for printf */
uname[UT_NAMESIZE] = '\0';
- if (formtype) {
- printf("%-*.*s%-9.8s", userlen + 1, userlen, uname, tty + 5);
+ printf("%-*.*s%-9.8s", userlen + 1, userlen, uname, tty + 5);
+ if (from)
+ print_from(session, NULL, ip_addresses, fromlen);
+
+ /* login time */
+ if (longform) {
#if (defined(WITH_SYSTEMD) || defined(WITH_ELOGIND)) && defined(HAVE_SD_SESSION_GET_LEADER)
if (session) {
uint64_t ltime;
- if (from)
- print_from(session, NULL, ip_addresses, fromlen);
-
sd_session_get_start_time(session, &ltime);
print_logintime(ltime/((uint64_t) 1000000ULL), stdout);
} else {
#endif
- if (from)
- print_from(
-#if (defined(WITH_SYSTEMD) || defined(WITH_ELOGIND)) && defined(HAVE_SD_SESSION_GET_LEADER)
- NULL,
-#endif
- u, ip_addresses, fromlen);
#ifdef HAVE_UTMPX_H
print_logintime(u->ut_tv.tv_sec, stdout);
@@ -603,11 +595,16 @@ static void showinfo(
#if (defined(WITH_SYSTEMD) || defined(WITH_ELOGIND)) && defined(HAVE_SD_SESSION_GET_LEADER)
}
#endif
- if (u && *u->ut_line == ':')
- /* idle unknown for xdm logins */
- printf(" ?xdm? ");
- else
- print_time_ival7(idletime(tty), 0, stdout);
+ }
+ /* idle */
+ if (u && *u->ut_line == ':')
+ /* idle unknown for xdm logins */
+ printf(" ?xdm? ");
+ else
+ print_time_ival7(idletime(tty), 0, stdout);
+
+ /* jpcpu/pcpu */
+ if (longform) {
print_time_ival7(jcpu / hertz, (jcpu % hertz) * (100. / hertz),
stdout);
if (pcpu > 0)
@@ -616,20 +613,8 @@ static void showinfo(
stdout);
else
printf(" ? ");
- } else {
- printf("%-*.*s%-9.8s", userlen + 1, userlen, uname, tty + 5);
- if (from)
- print_from(
-#if (defined(WITH_SYSTEMD) || defined(WITH_ELOGIND)) && defined(HAVE_SD_SESSION_GET_LEADER)
- NULL,
-#endif
- u, ip_addresses, fromlen);
- if (u && *u->ut_line == ':')
- /* idle unknown for xdm logins */
- printf(" ?xdm? ");
- else
- print_time_ival7(idletime(tty), 0, stdout);
}
+ /* what */
if (pids) {
pid_t ut_pid = -1;
if (u)
@@ -798,9 +783,9 @@ int main(int argc, char **argv)
* headers. Try to keep alignment intact. */
printf(_("%-*s TTY "), userlen, _("USER"));
if (from)
- printf("%-*s", fromlen - 1, _("FROM"));
+ printf("%-*s", fromlen, _("FROM"));
if (longform)
- printf(_(" LOGIN@ IDLE JCPU PCPU WHAT\n"));
+ printf(_(" LOGIN@ IDLE JCPU PCPU WHAT\n"));
else
printf(_(" IDLE WHAT\n"));
}
@@ -857,9 +842,7 @@ int main(int argc, char **argv)
continue;
if (!strncmp(u->ut_user, user, UT_NAMESIZE))
showinfo(
-#if (defined(WITH_SYSTEMD) || defined(WITH_ELOGIND)) && defined(HAVE_SD_SESSION_GET_LEADER)
NULL, NULL,
-#endif
u, longform, maxcmd, from, userlen,
fromlen, ip_addresses, pids);
}
@@ -876,9 +859,7 @@ int main(int argc, char **argv)
continue;
if (*u->ut_user)
showinfo(
-#if (defined(WITH_SYSTEMD) || defined(WITH_ELOGIND)) && defined(HAVE_SD_SESSION_GET_LEADER)
NULL, NULL,
-#endif
u, longform, maxcmd, from, userlen,
fromlen, ip_addresses, pids);
}
--
GitLab

View File

@ -1,102 +0,0 @@
From 2c933ecba3bb1d3041a5a7a53a7b4078a6003413 Mon Sep 17 00:00:00 2001
From: Craig Small <csmall@dropbear.xyz>
Date: Thu, 10 Aug 2023 21:18:38 +1000
Subject: [PATCH] ps: Fix possible buffer overflow in -C option
ps allocates memory using malloc(length of arg * len of struct).
In certain strange circumstances, the arg length could be very large
and the multiplecation will overflow, allocating a small amount of
memory.
Subsequent strncpy() will then write into unallocated memory.
The fix is to use calloc. It's slower but this is a one-time
allocation. Other malloc(x * y) calls have also been replaced
by calloc(x, y)
References:
https://www.freelists.org/post/procps/ps-buffer-overflow-CVE-20234016
https://nvd.nist.gov/vuln/detail/CVE-2023-4016
https://gitlab.com/procps-ng/procps/-/issues/297
https://bugs.debian.org/1042887
Signed-off-by: Craig Small <csmall@dropbear.xyz>
---
ps/parser.c | 24 ++++++++++++------------
1 file changed, 12 insertions(+), 12 deletions(-)
--- ps/parser.c
+++ ps/parser.c 2023-08-15 12:19:13.375422122 +0000
@@ -183,8 +183,7 @@ static const char *parse_list(const char
int need_item;
const char *err; /* error code that could or did happen */
/*** prepare to operate ***/
- node = malloc(sizeof(selection_node));
- node->u = malloc(strlen(arg)*sizeof(sel_union)); /* waste is insignificant */
+ node = xmalloc(sizeof(selection_node));
node->n = 0;
buf = strdup(arg);
/*** sanity check and count items ***/
@@ -205,6 +204,7 @@ static const char *parse_list(const char
} while (*++walk);
if(need_item) goto parse_error;
node->n = items;
+ node->u = xcalloc(items*sizeof(sel_union));
/*** actually parse the list ***/
walk = buf;
while(items--){
@@ -569,8 +569,8 @@ static const char *parse_bsd_option(void
/* put our tty on a tiny list */
{
selection_node *node;
- node = malloc(sizeof(selection_node));
- node->u = malloc(sizeof(sel_union));
+ node = xmalloc(sizeof(selection_node));
+ node->u = xmalloc(sizeof(sel_union));
node->u[0].tty = cached_tty;
node->typecode = SEL_TTY;
node->n = 1;
@@ -706,8 +706,8 @@ static const char *parse_bsd_option(void
if(!arg){
/* Wow, obsolete BSD syntax. Put our tty on a tiny list. */
selection_node *node;
- node = malloc(sizeof(selection_node));
- node->u = malloc(sizeof(sel_union));
+ node = xmalloc(sizeof(selection_node));
+ node->u = xmalloc(sizeof(sel_union));
node->u[0].tty = cached_tty;
node->typecode = SEL_TTY;
node->n = 1;
@@ -1030,16 +1030,16 @@ static const char *parse_trailing_pids(v
argp = ps_argv + thisarg;
thisarg = ps_argc - 1; /* we must be at the end now */
- pidnode = malloc(sizeof(selection_node));
- pidnode->u = malloc(i*sizeof(sel_union)); /* waste is insignificant */
+ pidnode = xmalloc(sizeof(selection_node));
+ pidnode->u = xcalloc(i*sizeof(sel_union)); /* waste is insignificant */
pidnode->n = 0;
- grpnode = malloc(sizeof(selection_node));
- grpnode->u = malloc(i*sizeof(sel_union)); /* waste is insignificant */
+ grpnode = xmalloc(sizeof(selection_node));
+ grpnode->u = xcalloc(i*sizeof(sel_union)); /* waste is insignificant */
grpnode->n = 0;
- sidnode = malloc(sizeof(selection_node));
- sidnode->u = malloc(i*sizeof(sel_union)); /* waste is insignificant */
+ sidnode = xmalloc(sizeof(selection_node));
+ sidnode->u = xcalloc(i*sizeof(sel_union)); /* waste is insignificant */
sidnode->n = 0;
while(i--){
--- proc/libprocps.sym
+++ proc/libprocps.sym 2023-08-15 12:43:18.905661726 +0000
@@ -67,6 +67,8 @@ global:
unix_print_signals;
uptime;
xalloc_err_handler;
+ xcalloc;
+ xmalloc;
local:
*;
};

View File

@ -1,33 +0,0 @@
From 23da4f40ea27afe998e92ca317f2dcb48a6ffc1f Mon Sep 17 00:00:00 2001
From: Tommi Rantala <tommi.t.rantala@nokia.com>
Date: Mon, 11 Oct 2021 13:33:18 +0300
Subject: [PATCH] ps: ignore SIGURG
Stop registering signal handler for SIGURG, to avoid ps failure if
someone sends such signal. Without the signal handler, SIGURG will
just be ignored.
Signal 23 (URG) caught by ps (3.3.16).
ps:ps/display.c:66: please report this bug
https://man7.org/linux/man-pages/man7/signal.7.html
https://www.freebsd.org/cgi/man.cgi?sektion=3&query=signal
---
ps/display.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/ps/display.c b/ps/display.c
index 04803c3b..346e21a7 100644
--- a/ps/display.c
+++ b/ps/display.c
@@ -673,6 +673,7 @@ int main(int argc, char *argv[]){
case SIGKILL: /* can not catch */
case SIGSTOP: /* can not catch */
case SIGWINCH: /* don't care if window size changes */
+ case SIGURG: /* Urgent condition on socket (4.2BSD) */
;
}
} while (0);
--
GitLab

View File

@ -1,45 +0,0 @@
From 3dd1661a3d91671ca6c977c2e514f47d807be79d Mon Sep 17 00:00:00 2001
From: Craig Small <csmall@dropbear.xyz>
Date: Mon, 29 Mar 2021 22:11:27 +1100
Subject: [PATCH] docs: psr ps field is last run processor
The ps.1 manpage incorrectly stated that psr field showed the
processor the process was assigned to. However if the assignment
has changed but the process has not run, then the field doesn't
change.
Some digging by @srikard showed it wasn't the processor assigned
but the last one it was run on. The man page now correctly
describes psr in that way.
References:
procps-ng/procps#187
---
ps/ps.1 | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git ps/ps.1 ps/ps.1
index 8678123..b433655 100644
--- ps/ps.1
+++ ps/ps.1
|@@ -4,7 +4,7 @@
| .\" Quick hack conversion by Albert Cahalan, 1998.
| .\" Licensed under version 2 of the Gnu General Public License.
| .\"
|-.TH PS "1" "2021-03-05" "procps-ng" "User Commands"
|+.TH PS "1" "2021-03-29" "procps-ng" "User Commands"
| .\"
| .\" To render this page:
| .\" groff -t -b -man -X -P-resolution -P100 -Tps ps.1 &
@@ -1518,7 +1518,7 @@ priority of the process. Higher number means lower priority.
T}
psr PSR T{
-processor that process is currently assigned to.
+processor that process last executed on.
T}
rgid RGID T{
--
2.26.2

View File

@ -1,11 +0,0 @@
--- procps-3.3.17/sysctl.c.old 2021-02-09 11:11:25.000000000 +0100
+++ procps-3.3.17/sysctl.c 2023-12-14 13:56:36.785976315 +0100
@@ -546,6 +546,8 @@
fp = (globbuf.gl_pathv[j][0] == '-' && !globbuf.gl_pathv[j][1])
? stdin : fopen(globbuf.gl_pathv[j], "r");
if (!fp) {
+ if (strcmp ("/usr/lib/sysctl.d/99-sysctl.conf", globbuf.gl_pathv[j]) == 0)
+ continue;
xwarn(_("cannot open \"%s\""), globbuf.gl_pathv[j]);
rc = -1;
goto out;

View File

@ -1,41 +0,0 @@
---
free.1 | 2 +-
proc/sysinfo.c | 9 +++++----
2 files changed, 6 insertions(+), 5 deletions(-)
--- free.1
+++ free.1 2022-12-15 09:40:32.807087343 +0000
@@ -19,7 +19,7 @@ columns are:
Total installed memory (MemTotal and SwapTotal in /proc/meminfo)
.TP
\fBused\fR
-Used memory (calculated as \fBtotal\fR - \fBfree\fR - \fBbuffers\fR - \fBcache\fR)
+Used memory (calculated as \fBtotal\fR - \fBavailable\fR)
.TP
\fBfree\fR
Unused memory (MemFree and SwapFree in /proc/meminfo)
--- proc/sysinfo.c
+++ proc/sysinfo.c 2022-06-22 11:29:39.240066488 +0000
@@ -794,10 +794,6 @@ nextline:
where such values will be dramatically distorted over those of the host. */
if (kb_main_available > kb_main_total)
kb_main_available = kb_main_free;
- mem_used = kb_main_total - kb_main_free - kb_main_cached - kb_main_buffers;
- if (mem_used < 0)
- mem_used = kb_main_total - kb_main_free;
- kb_main_used = (unsigned long)mem_used;
/* zero? might need fallback for 2.6.27 <= kernel <? 3.14 */
if (!kb_main_available) {
@@ -821,6 +817,11 @@ nextline:
kb_main_available = kb_main_free;
#endif /* linux */
}
+
+ mem_used = kb_main_total - kb_main_available;
+ if (mem_used < 0)
+ mem_used = kb_main_total - kb_main_free;
+ kb_main_used = (unsigned long)mem_used;
}
/*****************************************************************/

View File

@ -1,37 +0,0 @@
---
top/top.1 | 4 ++--
top/top.c | 6 ++++--
2 files changed, 6 insertions(+), 4 deletions(-)
--- top/top.1
+++ top/top.1 2022-06-22 12:05:55.572154830 +0000
@@ -565,8 +565,8 @@ visual graphs of those representations.
In the case of \*(MP, the percentage represents the \fBtotal\fR minus the estimated
\fBavail\fR noted above.
-The `Mem' graph itself is divided between \fBused\fR and any remaining memory not
-otherwise accounted for by \fBavail\fR.
+The `Mem' graph itself is divided between the non-cached portion of \fBused\fR and
+any remaining memory not otherwise accounted for by \fBavail\fR.
\*(XT 4b. SUMMARY AREA Commands and the `m' command for additional information
on that special 4-way toggle.
--- top/top.c
+++ top/top.c 2022-06-22 12:03:17.911044097 +0000
@@ -6086,12 +6086,14 @@ numa_nope:
char used[SMLBUFSIZ], util[SMLBUFSIZ], dual[MEDBUFSIZ];
float pct_used, pct_misc, pct_swap;
int ix, num_used, num_misc;
+ unsigned long my_ulong;
- pct_used = (float)kb_main_used * (100.0 / (float)kb_main_total);
+ my_ulong = kb_main_total - kb_main_buffers - kb_main_cached - kb_main_free;
+ pct_used = (float)my_ulong * (100.0 / (float)kb_main_total);
#ifdef MEMGRAPH_OLD
pct_misc = (float)(kb_main_buffers + kb_main_cached) * (100.0 / (float)kb_main_total);
#else
- pct_misc = (float)(kb_main_total - kb_main_available - kb_main_used) * (100.0 / (float)kb_main_total);
+ pct_misc = (float)(kb_main_total - kb_main_available - my_ulong) * (100.0 / (float)kb_main_total);
#endif
if (pct_used + pct_misc > 100.0 || pct_misc < 0) pct_misc = 0;
pct_swap = kb_swap_total ? (float)kb_swap_used * (100.0 / (float)kb_swap_total) : 0;

View File

@ -1,61 +0,0 @@
---
proc/libprocps.sym | 1 +
proc/sysinfo.c | 13 +++++++++++--
proc/sysinfo.h | 2 ++
3 files changed, 14 insertions(+), 2 deletions(-)
--- proc/libprocps.sym
+++ proc/libprocps.sym 2018-04-04 11:30:51.841725161 +0000
@@ -60,6 +60,7 @@ global:
signal_name_to_number;
signal_number_to_name;
smp_num_cpus;
+ __smp_num_cpus;
sprint_uptime;
strtosig;
tty_to_dev;
--- proc/sysinfo.c
+++ proc/sysinfo.c 2018-04-04 11:33:26.306886237 +0000
@@ -47,7 +47,8 @@
#endif
#include <elf.h>
-long smp_num_cpus; /* number of CPUs */
+#undef smp_num_cpus
+long smp_num_cpus=-1; /* number of CPUs */
long page_bytes; /* this architecture's page size */
#define BAD_OPEN_MESSAGE \
@@ -1166,7 +1167,11 @@ out:
///////////////////////////////////////////////////////////////////////////
-void cpuinfo (void) {
+long __smp_num_cpus (void) {
+
+ if (smp_num_cpus != -1)
+ return(smp_num_cpus);
+
// ought to count CPUs in /proc/stat instead of relying
// on glibc, which foolishly tries to parse /proc/cpuinfo
// note: that may have been the case but now /proc/stat
@@ -1181,4 +1186,8 @@ void cpuinfo (void) {
smp_num_cpus = sysconf(_SC_NPROCESSORS_ONLN);
if (smp_num_cpus<1) /* SPARC glibc is buggy */
smp_num_cpus=1;
+
+ return smp_num_cpus;
}
+
+void cpuinfo (void) { (void)__smp_num_cpus(); }
--- proc/sysinfo.h
+++ proc/sysinfo.h 2018-04-04 11:30:51.841725161 +0000
@@ -8,6 +8,8 @@ EXTERN_C_BEGIN
extern unsigned long long Hertz; /* clock tick frequency */
extern long smp_num_cpus; /* number of CPUs */
+extern long __smp_num_cpus(void);
+#define smp_num_cpus __smp_num_cpus()
extern int have_privs; /* boolean, true if setuid or similar */
extern long page_bytes; /* this architecture's bytes per page */

View File

@ -6,20 +6,20 @@ open("/usr/lib/locale/de_DE.utf8/LC_NUMERIC", O_RDONLY|O_CLOEXEC) = 3
and this causes a problem later on (bsc#908516)
---
free.c | 5 +++++
src/free.c | 5 +++++
1 file changed, 5 insertions(+)
--- free.c
+++ free.c 2018-04-04 12:47:06.360757839 +0000
@@ -197,6 +197,7 @@ int main(int argc, char **argv)
{
int c, flags = 0, unit_set = 0;
--- src/free.c
+++ src/free.c 2022-10-20 13:33:28.880818112 +0000
@@ -208,6 +208,7 @@ int main(int argc, char **argv)
int c, flags = 0, unit_set = 0, rc = 0;
struct commandline_arguments args;
struct meminfo_info *mem_info = NULL;
+ int errsv;
/*
* For long options that have no equivalent short option, use a
@@ -247,10 +248,12 @@ int main(int argc, char **argv)
@@ -260,10 +261,12 @@ int main(int argc, char **argv)
#ifdef HAVE_PROGRAM_INVOCATION_NAME
program_invocation_name = program_invocation_short_name;
#endif
@ -30,9 +30,9 @@ and this causes a problem later on (bsc#908516)
atexit(close_stdout);
+ errno = errsv;
while ((c = getopt_long(argc, argv, "bkmghltCc:ws:V", longopts, NULL)) != -1)
while ((c = getopt_long(argc, argv, "bkmghlLtvCc:ws:V", longopts, NULL)) != -1)
switch (c) {
@@ -317,11 +320,13 @@ int main(int argc, char **argv)
@@ -336,11 +339,13 @@ int main(int argc, char **argv)
break;
case 's':
flags |= FREE_REPEAT;

View File

@ -1,38 +0,0 @@
---
vmstat.c | 7 +++----
1 file changed, 3 insertions(+), 4 deletions(-)
--- vmstat.c
+++ vmstat.c 2018-04-04 11:16:07.577968520 +0000
@@ -40,6 +40,7 @@
#include <string.h>
#include <sys/ioctl.h>
#include <sys/types.h>
+#include <sys/stat.h>
#include <termios.h>
#include <unistd.h>
#include <time.h>
@@ -708,13 +709,12 @@ static void slabheader(void)
static void slabformat(void)
{
- FILE *fSlab;
+ struct stat fSlab;
struct slab_cache *slabs;
unsigned long nSlab, i, j, k;
const char format[] = "%-24s %6u %6u %6u %6u\n";
- fSlab = fopen("/proc/slabinfo", "rb");
- if (!fSlab) {
+ if (stat("/proc/slabinfo", &fSlab) < 0) {
xwarnx(_("your kernel does not support slabinfo or your permissions are insufficient"));
return;
}
@@ -746,7 +746,6 @@ static void slabformat(void)
}
free(slabs);
}
- fclose(fSlab);
}
static void disksum_format(void)

View File

@ -1,61 +0,0 @@
---
free.c | 19 ++++++++++++++++---
proc/sysinfo.c | 5 ++++-
2 files changed, 20 insertions(+), 4 deletions(-)
--- free.c
+++ free.c 2021-02-10 09:58:35.409695062 +0000
@@ -134,7 +134,7 @@ static const char *scale_size(unsigned l
if (args.exponent > 1) {
/* In desired scale. */
snprintf(buf, sizeof(buf), "%ld",
- (long int)((size * 1024.0) / power(base, args.exponent-1))
+ (long int)(((long long int)size * 1024) / power(base, args.exponent-1))
);
return buf;
}
@@ -381,15 +381,28 @@ int main(int argc, char **argv)
* to print the high info, even if it is zero.
*/
if (flags & FREE_LOHI) {
+ unsigned long kb_low_used;
+ unsigned long kb_high_used;
+
+ if (kb_low_total > kb_low_free)
+ kb_low_used = kb_low_total - kb_low_free;
+ else
+ kb_low_used = 0;
+
+ if (kb_high_total > kb_high_free)
+ kb_high_used = kb_high_total - kb_high_free;
+ else
+ kb_high_used = 0;
+
printf("%-9s", _("Low:"));
printf("%11s", scale_size(kb_low_total, flags, args));
- printf(" %11s", scale_size(kb_low_total - kb_low_free, flags, args));
+ printf(" %11s", scale_size(kb_low_used, flags, args));
printf(" %11s", scale_size(kb_low_free, flags, args));
printf("\n");
printf("%-9s", _("High:"));
printf("%11s", scale_size(kb_high_total, flags, args));
- printf(" %11s", scale_size(kb_high_total - kb_high_free, flags, args));
+ printf(" %11s", scale_size(kb_high_used, flags, args));
printf(" %11s", scale_size(kb_high_free, flags, args));
printf("\n");
}
--- proc/sysinfo.c
+++ proc/sysinfo.c 2021-02-10 10:00:35.227385913 +0000
@@ -783,7 +783,10 @@ nextline:
kb_main_cached = kb_page_cache + kb_slab_reclaimable;
if ((ev=getenv("PS_FULL_CACHE")))
kb_main_cached += kb_swap_cached + kb_nfs_unstable;
- kb_swap_used = kb_swap_total - kb_swap_free;
+ if (kb_swap_total > kb_swap_free)
+ kb_swap_used = kb_swap_total - kb_swap_free;
+ else
+ kb_swap_used = 0;
/* if kb_main_available is greater than kb_main_total or our calculation of
mem_used overflows, that's symptomatic of running within a lxc container

View File

@ -1,19 +0,0 @@
---
top/top.c | 6 +++++-
1 file changed, 5 insertions(+), 1 deletion(-)
--- top/top.c
+++ top/top.c 2018-04-04 12:09:16.087193018 +0000
@@ -2404,7 +2404,11 @@ static void zap_fieldstab (void) {
Cpu_pmax = 99.9;
if (Rc.mode_irixps && smp_num_cpus > 1 && !Thread_mode) {
Cpu_pmax = 100.0 * smp_num_cpus;
- if (smp_num_cpus > 10) {
+ if (smp_num_cpus > 1000) {
+ if (Cpu_pmax > 9999999.0) Cpu_pmax = 9999999.0;
+ } else if (smp_num_cpus > 100) {
+ if (Cpu_pmax > 999999.0) Cpu_pmax = 999999.0;
+ } else if (smp_num_cpus > 10) {
if (Cpu_pmax > 99999.0) Cpu_pmax = 99999.0;
} else {
if (Cpu_pmax > 999.9) Cpu_pmax = 999.9;

View File

@ -1,13 +1,43 @@
---
free.1 | 6 ++++++
free.c | 7 ++++++-
proc/sysinfo.c | 4 ++++
vmstat.c | 6 +++++-
4 files changed, 21 insertions(+), 2 deletions(-)
library/meminfo.c | 7 ++++++-
man/free.1 | 6 ++++++
src/free.c | 7 ++++++-
src/vmstat.c | 7 ++++++-
4 files changed, 24 insertions(+), 3 deletions(-)
--- free.1
+++ free.1 2019-12-11 06:20:16.659772479 +0000
@@ -100,6 +100,12 @@ Switch to the wide mode. The wide mode p
--- library/meminfo.c
+++ library/meminfo.c 2023-09-12 12:08:41.033738450 +0000
@@ -3,6 +3,7 @@
*
* Copyright © 2015-2023 Jim Warner <james.warner@comcast.net>
* Copyright © 2015-2023 Craig Small <csmall@dropbear.xyz>
+ * Copyright © 2008 Bart Van Assche.
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
@@ -640,6 +641,7 @@ static int meminfo_read_failed (
int size;
unsigned long *valptr;
signed long mem_used;
+ const char *ev;
// remember history from last time around
memcpy(&info->hist.old, &info->hist.new, sizeof(struct meminfo_data));
@@ -692,7 +694,10 @@ static int meminfo_read_failed (
if (0 == mHr(MemAvailable))
mHr(MemAvailable) = mHr(MemFree);
- mHr(derived_mem_cached) = mHr(Cached) + mHr(SReclaimable);
+ if ((ev=getenv("PS_FULL_CACHE")))
+ mHr(derived_mem_cached) = mHr(Cached) + mHr(SReclaimable) + mHr(NFS_Unstable);
+ else
+ mHr(derived_mem_cached) = mHr(Cached) + mHr(SReclaimable);
/* if 'available' is greater than 'total' or our calculation of mem_used
overflows, that's symptomatic of running within a lxc container where
--- man/free.1
+++ man/free.1 2023-09-12 12:08:41.029738522 +0000
@@ -110,6 +110,12 @@ Switch to the wide mode. The wide mode p
than 80 characters. In this mode \fBbuffers\fR and \fBcache\fR
are reported in two separate columns.
.TP
@ -20,34 +50,34 @@
\fB\-c\fR, \fB\-\-count\fR \fIcount\fR
Display the result
.I count
--- free.c
+++ free.c 2019-12-11 06:20:16.659772479 +0000
@@ -90,6 +90,7 @@ static void __attribute__ ((__noreturn__
fputs(_(" -t, --total show total for RAM + swap\n"), out);
--- src/free.c
+++ src/free.c 2023-09-12 12:10:26.647842455 +0000
@@ -92,6 +92,7 @@ static void __attribute__ ((__noreturn__
fputs(_(" -v, --committed show committed memory and commit limit\n"), out);
fputs(_(" -s N, --seconds N repeat printing every N seconds\n"), out);
fputs(_(" -c N, --count N repeat printing N times, then exit\n"), out);
+ fputs(_(" -C, --full-cache add further cache lines to main cache\n"), out);
fputs(_(" -w, --wide wide output\n"), out);
fputs(USAGE_SEPARATOR, out);
fputs(_(" --help display this help and exit\n"), out);
@@ -231,6 +232,7 @@ int main(int argc, char **argv)
{ "total", no_argument, NULL, 't' },
@@ -244,6 +245,7 @@ int main(int argc, char **argv)
{ "committed", no_argument, NULL, 'v' },
{ "seconds", required_argument, NULL, 's' },
{ "count", required_argument, NULL, 'c' },
+ { "full-cache",required_argument, NULL, HELP_OPTION },
+ { "full-cache",no_argument, NULL, 'C' },
{ "wide", no_argument, NULL, 'w' },
{ "help", no_argument, NULL, HELP_OPTION },
{ "version", no_argument, NULL, 'V' },
@@ -250,7 +252,7 @@ int main(int argc, char **argv)
@@ -263,7 +265,7 @@ int main(int argc, char **argv)
textdomain(PACKAGE);
atexit(close_stdout);
- while ((c = getopt_long(argc, argv, "bkmghltc:ws:V", longopts, NULL)) != -1)
+ while ((c = getopt_long(argc, argv, "bkmghltCc:ws:V", longopts, NULL)) != -1)
- while ((c = getopt_long(argc, argv, "bkmghlLtvc:ws:V", longopts, NULL)) != -1)
+ while ((c = getopt_long(argc, argv, "bkmghlLtvCc:ws:V", longopts, NULL)) != -1)
switch (c) {
case 'b':
check_unit_set(&unit_set);
@@ -333,6 +335,9 @@ int main(int argc, char **argv)
@@ -352,6 +354,9 @@ int main(int argc, char **argv)
case 'w':
flags |= FREE_WIDE;
break;
@ -57,59 +87,40 @@
case HELP_OPTION:
usage(stdout);
case 'V':
--- proc/sysinfo.c
+++ proc/sysinfo.c 2019-12-11 06:20:16.659772479 +0000
@@ -3,6 +3,7 @@
* Copyright (C) 1992-1998 by Michael K. Johnson, johnsonm@redhat.com
* Copyright 1998-2003 Albert Cahalan
* June 2003, Fabian Frederick, disk and slab info
+ * Copyright (c) 2008 Bart Van Assche.
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
@@ -700,6 +701,7 @@ void meminfo(void){
int linux_version_code = procps_linux_version();
mem_table_struct findme = { namebuf, NULL};
mem_table_struct *found;
+ const char *ev;
char *head;
char *tail;
static const mem_table_struct mem_table[] = {
@@ -779,6 +781,8 @@ nextline:
kb_inactive = kb_inact_dirty + kb_inact_clean + kb_inact_laundry;
}
kb_main_cached = kb_page_cache + kb_slab_reclaimable;
+ if ((ev=getenv("PS_FULL_CACHE")))
+ kb_main_cached += kb_swap_cached + kb_nfs_unstable;
kb_swap_used = kb_swap_total - kb_swap_free;
--- src/vmstat.c
+++ src/vmstat.c 2023-09-12 12:08:41.033738450 +0000
@@ -230,6 +230,7 @@ static void __attribute__ ((__noreturn__
fputs(_(" -p, --partition <dev> partition specific statistics\n"), out);
fputs(_(" -S, --unit <char> define display unit\n"), out);
fputs(_(" -w, --wide wide output\n"), out);
+ fputs(_(" -C, --full-cache add further cache lines to main cache\n"), out);
fputs(_(" -t, --timestamp show timestamp\n"), out);
fputs(_(" -y, --no-first skips first line of output\n"), out);
fputs(USAGE_SEPARATOR, out);
@@ -951,6 +952,7 @@ int main(int argc, char *argv[])
{"partition", required_argument, NULL, 'p'},
{"unit", required_argument, NULL, 'S'},
{"wide", no_argument, NULL, 'w'},
+ {"full-cache", no_argument, NULL, 'C'},
{"timestamp", no_argument, NULL, 't'},
{"help", no_argument, NULL, 'h'},
{"version", no_argument, NULL, 'V'},
@@ -967,7 +969,7 @@ int main(int argc, char *argv[])
atexit(close_stdout);
/* if kb_main_available is greater than kb_main_total or our calculation of
--- vmstat.c
+++ vmstat.c 2019-12-11 06:22:44.716984764 +0000
@@ -103,6 +103,7 @@ static void __attribute__ ((__noreturn__
fputs(_(" -p, --partition <dev> partition specific statistics\n"), out);
fputs(_(" -S, --unit <char> define display unit\n"), out);
fputs(_(" -w, --wide wide output\n"), out);
+ fputs(_(" -C, --full-cache add further cache lines to main cache\n"), out);
fputs(_(" -t, --timestamp show timestamp\n"), out);
fputs(USAGE_SEPARATOR, out);
fputs(USAGE_HELP, out);
@@ -899,7 +900,7 @@ int main(int argc, char *argv[])
atexit(close_stdout);
while ((c =
- getopt_long(argc, argv, "afmnsdDp:S:wthV", longopts,
+ getopt_long(argc, argv, "aCfmnsdDp:S:wthV", longopts,
NULL)) != -1)
switch (c) {
case 'V':
@@ -968,6 +969,9 @@ int main(int argc, char *argv[])
case 't':
t_option = 1;
break;
+ case 'C':
+ setenv("PS_FULL_CACHE", "yes", 1);
+ break;
default:
/* no other aguments defined yet. */
usage(stderr);
while ((c =
- getopt_long(argc, argv, "afmnsdDp:S:wthVy", longopts, NULL)) != -1)
+ getopt_long(argc, argv, "aCfmnsdDp:S:wthVy", longopts, NULL)) != -1)
switch (c) {
case 'V':
printf(PROCPS_NG_VERSION);
@@ -1034,6 +1036,9 @@ int main(int argc, char *argv[])
case 't':
t_option = 1;
break;
+ case 'C':
+ setenv("PS_FULL_CACHE", "yes", 1);
+ break;
case 'y':
/* Don't display stats since system restart */
y_option = 1;

View File

@ -1,29 +1,33 @@
--- vmstat.c
+++ vmstat.c 2015-01-27 14:57:19.467491788 +0000
@@ -295,7 +295,7 @@ static void new_format(void)
unsigned int intr[2], ctxt[2];
unsigned int sleep_half;
unsigned long kb_per_page = sysconf(_SC_PAGESIZE) / 1024ul;
- int debt = 0; /* handle idle ticks running backwards */
+ long long debt = 0; /* handle idle ticks running backwards */
struct tm *tm_ptr;
time_t the_time;
char timebuf[32];
@@ -386,12 +386,12 @@ static void new_format(void)
---
vmstat.c | 12 ++++++------
1 file changed, 6 insertions(+), 6 deletions(-)
--- src/vmstat.c
+++ src/vmstat.c 2022-03-29 09:21:41.156855432 +0000
@@ -357,7 +357,7 @@ static void new_format(void)
unsigned long pgpgin[2], pgpgout[2], pswpin[2] = {0,0}, pswpout[2];
unsigned int sleep_half;
unsigned long kb_per_page = sysconf(_SC_PAGESIZE) / 1024ul;
- int debt = 0; /* handle idle ticks running backwards */
+ long long debt = 0; /* handle idle ticks running backwards */
struct tm *tm_ptr;
time_t the_time;
char timebuf[32];
@@ -484,12 +484,12 @@ static void new_format(void)
/* idle can run backwards for a moment -- kernel "feature" */
if (debt) {
- didl = (int)didl + debt;
- debt = 0;
+ didl = (long long)didl + debt;
+ debt = 0LL;
}
- if ((int)didl < 0) {
- debt = (int)didl;
- didl = 0;
+ if ((long long)didl < 0) {
+ debt = (long long)didl;
+ didl = 0ULL;
}
/* idle can run backwards for a moment -- kernel "feature" */
if (debt) {
- cpu_idl = (int)cpu_idl + debt;
- debt = 0;
+ cpu_idl = cpu_idl + debt;
+ debt = 0LL;
}
- if ((int)cpu_idl < 0) {
- debt = (int)cpu_idl;
- cpu_idl = 0;
+ if (cpu_idl < 0) {
+ debt = cpu_idl;
+ cpu_idl = 0LL;
}
Div = duse + dsys + didl + diow + dstl;
Div = cpu_use + cpu_sys + cpu_idl + cpu_iow + cpu_sto;

View File

@ -1,11 +1,11 @@
---
pmap.c | 47 ++++++++++++++++++++++++++++++++-----------
src/pmap.c | 47 ++++++++++++++++++++++++++++++++-----------
testsuite/pmap.test/pmap.exp | 17 +++++++--------
2 files changed, 44 insertions(+), 20 deletions(-)
--- pmap.c
+++ pmap.c 2018-06-05 09:37:34.404294888 +0000
@@ -49,7 +49,9 @@ const char *nls_Address,
--- src/pmap.c
+++ src/pmap.c 2023-09-12 12:23:39.537610124 +0000
@@ -59,7 +59,9 @@ const char *nls_Address,
*nls_Kbytes,
*nls_Mode,
*nls_RSS,
@ -16,7 +16,7 @@
static void nls_initialize(void)
{
@@ -73,7 +75,9 @@ static void nls_initialize(void)
@@ -83,7 +85,9 @@ static void nls_initialize(void)
nls_Kbytes = _("Kbytes");
nls_Mode = _("Mode");
nls_RSS = _("RSS");
@ -26,20 +26,20 @@
}
static int justify_print(const char *str, int width, int right)
@@ -141,10 +145,10 @@ static int d_option;
static int n_option;
static int N_option;
static int q_option;
-static int x_option;
@@ -150,10 +154,10 @@ static int d_option = 0;
static int n_option = 0;
static int N_option = 0;
static int q_option = 0;
-static int x_option = 0;
+static int x_option = 1;
static int X_option;
static int X_option = 0;
-static int map_desc_showpath;
+static int map_desc_showpath = 1;
static unsigned shm_minor = ~0u;
@@ -522,12 +526,17 @@ static int one_proc(const proc_t * p)
@@ -544,12 +548,17 @@ static int one_proc (struct pids_stack *
char perms[32] = "";
const char *cp2 = NULL;
unsigned long long rss = 0ull;
@ -55,12 +55,12 @@
int maxw1=0, maxw2=0, maxw3=0, maxw4=0, maxw5=0;
+ int maxw6=0, maxw7=0;
/* Overkill, but who knows what is proper? The "w" prog uses
* the tty width to determine this.
@@ -557,13 +566,15 @@ static int one_proc(const proc_t * p)
printf("%u: %s\n", PIDS_VAL(tgid, s_int, p, Pids_info), PIDS_VAL(cmdline, str, p, Pids_info));
@@ -572,13 +581,15 @@ static int one_proc (struct pids_stack *
if (x_option) {
maxw1 = 16;
if (sizeof(KLONG) == 4) maxw1 = 8;
if (sizeof(long) == 4) maxw1 = 8;
- maxw2 = maxw3 = maxw4 = 7;
+ maxw2 = maxw3 = maxw4 = maxw6 = maxw7 = 7;
maxw5 = 5;
@ -74,7 +74,7 @@
maxw5 = justify_print(nls_Mode, maxw5, 0);
justify_print(nls_Mapping, 0, 0);
}
@@ -603,6 +614,11 @@ static int one_proc(const proc_t * p)
@@ -618,6 +629,11 @@ static int one_proc (struct pids_stack *
total_rss += smap_value;
continue;
}
@ -86,29 +86,30 @@
if (strcmp("Shared_Dirty", smap_key) == 0) {
shared_dirty = smap_value;
total_shared_dirty += smap_value;
@@ -615,15 +631,19 @@ static int one_proc(const proc_t * p)
@@ -630,16 +646,20 @@ static int one_proc (struct pids_stack *
}
if (strcmp("Swap", smap_key) == 0) {
/* doesn't matter as long as last */
- if (cp2) printf("%0*" KLF "x %*lu %*llu %*llu %*s %s\n",
+ swap = smap_value;
+ total_swap += smap_value;
+ if (cp2) printf("%0*" KLF "x %*lu %*llu %*llu %*llu %*llu %*s %s\n",
maxw1, start,
maxw2, (unsigned long)(diff >> 10),
maxw3, rss,
+ maxw6, pss,
maxw4, (private_dirty + shared_dirty),
+ maxw7, swap,
maxw5, perms,
cp2);
if (cp2)
- printf("%0*lx %*lu %*llu %*llu %*s %s\n",
+ printf("%0*lx %*lu %*llu %*llu %*llu %*llu %*s %s\n",
maxw1, start_To_Avoid_Warning,
maxw2, (unsigned long)(diff >> 10),
maxw3, rss,
+ maxw6, pss,
maxw4, (private_dirty + shared_dirty),
+ maxw7, swap,
maxw5, perms,
cp2);
/* reset some counters */
- rss = shared_dirty = private_dirty = 0ull;
+ rss = pss = shared_dirty = private_dirty = swap = 0ull;
start = diff = end = 0;
perms[0] = '\0';
cp2 = NULL;
@@ -656,7 +676,6 @@ static int one_proc(const proc_t * p)
diff = end = 0;
perms[0] = '\0';
cp2 = NULL;
@@ -673,7 +693,6 @@ static int one_proc (struct pids_stack *
if (perms[3] == 's')
total_shared += diff;
if (perms[3] == 'p') {
@ -116,7 +117,7 @@
if (perms[1] == 'w')
total_private_writeable += diff;
else
@@ -708,17 +727,21 @@ static int one_proc(const proc_t * p)
@@ -725,17 +744,21 @@ static int one_proc (struct pids_stack *
justify_print("----------------", maxw1, 0);
justify_print("-------", maxw2, 1);
justify_print("-------", maxw3, 1);
@ -140,7 +141,7 @@
}
if (d_option) {
printf
@@ -1028,16 +1051,18 @@ int main(int argc, char **argv)
@@ -1052,16 +1075,18 @@ int main(int argc, char **argv)
while ((c = getopt_long(argc, argv, "xXrdqA:hVcC:nN:p", longopts, NULL)) != -1)
switch (c) {
case 'x':
@ -162,7 +163,7 @@
case 'q':
q_option = 1;
--- testsuite/pmap.test/pmap.exp
+++ testsuite/pmap.test/pmap.exp 2018-06-05 09:23:53.955370363 +0000
+++ testsuite/pmap.test/pmap.exp 2023-09-12 12:25:22.375764402 +0000
@@ -8,16 +8,16 @@ set pmap_procname "${mypid}:\\s+\\S+\[^\
set pmap_initname "1:\\s+\\S+\[^\\r\]+\\s+"
set pmap_std_header $pmap_procname
@ -205,12 +206,12 @@
set test "pmap device output quiet (dq)"
spawn $pmap -dq $mypid
expect_table $test $pmap_procname $pmap_device_items "\$"
@@ -47,7 +46,7 @@ expect_table $test $pmap_procname $pmap_
@@ -50,7 +49,7 @@ if { [ file readable "/proc/self/smaps"
} else {
set test "pmap extended output"
spawn $pmap -x $mypid
- expect_table $test $pmap_ext_header $pmap_ext_items $pmap_ext_footer
+ expect_table $test $pmap_std_header $pmap_std_items $pmap_std_footer
set test "pmap extended output"
spawn $pmap -x $mypid
-expect_table $test $pmap_ext_header $pmap_ext_items $pmap_ext_footer
+expect_table $test $pmap_std_header $pmap_std_items $pmap_std_footer
# -X and -XX have no real format as its dependent on smaps
set test "pmap extra extended output"
# -X and -XX have no real format as its dependent on smaps
set test "pmap extra extended output"

View File

@ -1,407 +0,0 @@
diff -ur procps-3.3.17/configure.ac procps-3.3.17-no-utmp/configure.ac
--- procps-3.3.17/configure.ac 2023-10-27 17:02:55.230522174 +0200
+++ procps-3.3.17-no-utmp/configure.ac 2023-10-27 17:05:56.027565296 +0200
@@ -214,6 +214,13 @@
AS_IF([test "x$with_systemd" != "xno"], [
PKG_CHECK_MODULES([SYSTEMD], [libsystemd])
AC_DEFINE(WITH_SYSTEMD, 1, [enable systemd support])
+
+ # The functions needed to replace utmp with logind are only available
+ # with systemd v254 or later.
+ old_LIBS="$LIBS"
+ LIBS="$LIBS $SYSTEMD_LIBS"
+ AC_CHECK_FUNCS([sd_session_get_leader])
+ LIBS="$old_LIBS"
])
AM_CONDITIONAL([WITH_SYSTEMD], [test x$with_systemd != xno])
diff -ur procps-3.3.17/proc/whattime.c procps-3.3.17-no-utmp/proc/whattime.c
--- procps-3.3.17/proc/whattime.c 2021-02-09 11:11:25.000000000 +0100
+++ procps-3.3.17-no-utmp/proc/whattime.c 2023-10-27 17:05:56.027565296 +0200
@@ -38,6 +38,15 @@
#include "whattime.h"
#include "sysinfo.h"
+#ifdef WITH_SYSTEMD
+#include <systemd/sd-daemon.h>
+#include <systemd/sd-login.h>
+#endif
+#ifdef WITH_ELOGIND
+#include <elogind/sd-daemon.h>
+#include <elogind/sd-login.h>
+#endif
+
static char buf[256];
static double av[3];
@@ -98,6 +107,11 @@
/* count the number of users */
numuser = 0;
+#if defined(WITH_SYSTEMD) || defined(WITH_ELOGIND)
+ if (sd_booted() > 0)
+ numuser = sd_get_sessions(NULL);
+ else {
+#endif
setutent();
while ((utmpstruct = getutent())) {
if ((utmpstruct->ut_type == USER_PROCESS) &&
@@ -105,6 +119,10 @@
numuser++;
}
endutent();
+#if defined(WITH_SYSTEMD) || defined(WITH_ELOGIND)
+ }
+#endif
+
pos += sprintf(buf + pos, "%2d user%s, ", numuser, numuser == 1 ? "" : "s");
Datei procps-3.3.17/screen.620TQo/23075..f05 ist ein Socket, während Datei procps-3.3.17-no-utmp/screen.620TQo/23075..f05 ein Socket ist.
diff -ur procps-3.3.17/w.c procps-3.3.17-no-utmp/w.c
--- procps-3.3.17/w.c 2023-10-27 17:02:55.194521966 +0200
+++ procps-3.3.17-no-utmp/w.c 2023-10-27 18:10:00.371042829 +0200
@@ -56,11 +56,22 @@
#include <time.h>
#include <unistd.h>
#ifdef HAVE_UTMPX_H
-# include <utmpx.h>
+#include <utmpx.h>
+#ifndef HAVE_UT_HOSTSIZE_IN_UTMPX
+#include <utmp.h>
+#endif
#else
# include <utmp.h>
#endif
#include <arpa/inet.h>
+#ifdef WITH_SYSTEMD
+# include <systemd/sd-login.h>
+# include <systemd/sd-daemon.h>
+#endif
+#ifdef WITH_ELOGIND
+# include <elogind/sd-login.h>
+# include <elogind/sd-daemon.h>
+#endif
static int ignoreuser = 0; /* for '-u' */
static int oldstyle = 0; /* for '-o' */
@@ -72,12 +83,6 @@
typedef struct utmp utmp_t;
#endif
-#if !defined(UT_HOSTSIZE) || defined(__UT_HOSTSIZE)
-# define UT_HOSTSIZE __UT_HOSTSIZE
-# define UT_LINESIZE __UT_LINESIZE
-# define UT_NAMESIZE __UT_NAMESIZE
-#endif
-
#ifdef W_SHOWFROM
# define FROM_STRING "on"
#else
@@ -198,7 +203,25 @@
/* This routine prints either the hostname or the IP address of the remote */
-static void print_from(const utmp_t *restrict const u, const int ip_addresses, const int fromlen) {
+static void print_from(
+#if (defined(WITH_SYSTEMD) || defined(WITH_ELOGIND)) && defined(HAVE_SD_SESSION_GET_LEADER)
+ const char *session,
+#endif
+ const utmp_t *restrict const u, const int ip_addresses, const int fromlen) {
+#if (defined(WITH_SYSTEMD) || defined(WITH_ELOGIND)) && defined(HAVE_SD_SESSION_GET_LEADER)
+ if (session) {
+ char *host = NULL;
+ int r;
+
+ r = sd_session_get_remote_host(session, &host);
+ if (r < 0 || host == NULL)
+ print_host("", 0, fromlen);
+ else {
+ print_host(host, strlen(host), fromlen == 0?strlen(host):fromlen);
+ free(host);
+ }
+ } else {
+#endif
char buf[fromlen + 1];
char buf_ipv6[INET6_ADDRSTRLEN];
int len;
@@ -243,6 +266,9 @@
#else
print_host(u->ut_host, UT_HOSTSIZE, fromlen);
#endif
+#if (defined(WITH_SYSTEMD) || defined(WITH_ELOGIND)) && defined(HAVE_SD_SESSION_GET_LEADER)
+ }
+#endif
}
@@ -341,7 +367,11 @@
* the user for that login session is doing currently. This the
* essential core of 'w'.
*/
-static const proc_t *getproc(const utmp_t * restrict const u,
+static const proc_t *getproc(
+#if (defined(WITH_SYSTEMD) || defined(WITH_ELOGIND)) && defined(HAVE_SD_SESSION_GET_LEADER)
+ const char *session,
+#endif
+ const utmp_t * restrict const u,
const char *restrict const tty,
unsigned long long *restrict const jcpu,
int *restrict const found_utpid)
@@ -351,9 +381,16 @@
const proc_t *best = NULL;
const proc_t *secondbest = NULL;
unsigned uid = ~0U;
+ pid_t ut_pid = -1;
*found_utpid = 0;
if (!ignoreuser) {
+#if (defined(WITH_SYSTEMD) || defined(WITH_ELOGIND)) && defined(HAVE_SD_SESSION_GET_LEADER)
+ if (session) {
+ if (sd_session_get_uid(session, &uid) < 0)
+ return 0;
+ } else {
+#endif
char buf[UT_NAMESIZE + 1];
/* pointer to static data */
struct passwd *passwd_data;
@@ -364,12 +401,21 @@
return NULL;
uid = passwd_data->pw_uid;
/* OK to have passwd_data go out of scope here */
+#if (defined(WITH_SYSTEMD) || defined(WITH_ELOGIND)) && defined(HAVE_SD_SESSION_GET_LEADER)
+ }
+#endif
}
line = tty_to_dev(tty);
*jcpu = 0;
+ if (u)
+ ut_pid = u->ut_pid;
+#if (defined(WITH_SYSTEMD) || defined(WITH_ELOGIND)) && defined(HAVE_SD_SESSION_GET_LEADER)
+ else
+ sd_session_get_leader(session, &ut_pid);
+#endif
for (; *pptr; pptr++) {
- const proc_t *restrict const tmp = *pptr;
- if (unlikely(tmp->tgid == u->ut_pid)) {
+ const proc_t *restrict const tmp = *pptr;
+ if (unlikely(tmp->tgid == ut_pid)) {
*found_utpid = 1;
if (!best)
best = tmp;
@@ -393,7 +439,11 @@
return best ? best : secondbest;
}
-static void showinfo(utmp_t * u, int formtype, int maxcmd, int from,
+static void showinfo(
+#if (defined(WITH_SYSTEMD) || defined(WITH_ELOGIND)) && defined(HAVE_SD_SESSION_GET_LEADER)
+ const char *session, const char *name,
+#endif
+ utmp_t * u, int formtype, int maxcmd, int from,
int userlen, int fromlen, const int ip_addresses)
{
unsigned long long jcpu;
@@ -402,14 +452,36 @@
char uname[UT_NAMESIZE + 1] = "", tty[5 + UT_LINESIZE + 1] = "/dev/";
const proc_t *best;
+#if (defined(WITH_SYSTEMD) || defined(WITH_ELOGIND)) && defined(HAVE_SD_SESSION_GET_LEADER)
+ if (session) {
+ char *sd_tty;
+
+ if (sd_session_get_tty(session, &sd_tty) >= 0) {
+ for (i = 0; i < strlen (sd_tty); i++)
+ /* clean up tty if garbled */
+ if (isalnum(sd_tty[i]) || (sd_tty[i] == '/'))
+ tty[i + 5] = sd_tty[i];
+ else
+ tty[i + 5] = '\0';
+ free(sd_tty);
+ }
+ } else {
+#endif
for (i = 0; i < UT_LINESIZE; i++)
/* clean up tty if garbled */
if (isalnum(u->ut_line[i]) || (u->ut_line[i] == '/'))
tty[i + 5] = u->ut_line[i];
else
tty[i + 5] = '\0';
+#if (defined(WITH_SYSTEMD) || defined(WITH_ELOGIND)) && defined(HAVE_SD_SESSION_GET_LEADER)
+ }
+#endif
- best = getproc(u, tty + 5, &jcpu, &ut_pid_found);
+ best = getproc(
+#if (defined(WITH_SYSTEMD) || defined(WITH_ELOGIND)) && defined(HAVE_SD_SESSION_GET_LEADER)
+ session,
+#endif
+ u, tty + 5, &jcpu, &ut_pid_found);
/*
* just skip if stale utmp entry (i.e. login proc doesn't
@@ -420,26 +492,56 @@
if (!ut_pid_found)
return;
+#if (defined(WITH_SYSTEMD) || defined(WITH_ELOGIND)) && defined(HAVE_SD_SESSION_GET_LEADER)
+ if (name)
+ strncpy(uname, name, UT_NAMESIZE);
+ else
+#endif
+ strncpy(uname, u->ut_user, UT_NAMESIZE);
/* force NUL term for printf */
- strncpy(uname, u->ut_user, UT_NAMESIZE);
+ uname[UT_NAMESIZE] = '\0';
if (formtype) {
- int utlnlen = 8;
- if (formtype > 1) {
- userlen = strnlen(uname, UT_NAMESIZE);
- fromlen = strnlen(u->ut_host, UT_HOSTSIZE);
- utlnlen = strnlen(u->ut_line, UT_LINESIZE);
- maxcmd = MAX_CMD_WIDTH;
+ int utlnlen = 8;
+ if (formtype > 1) {
+ userlen = strnlen(uname, UT_NAMESIZE);
+ if (u) {
+ fromlen = strnlen(u->ut_host, UT_HOSTSIZE);
+ utlnlen = strnlen(u->ut_line, UT_LINESIZE);
+ } else {
+ fromlen = 0;
+ utlnlen = strlen (tty+5);
}
- printf("%-*.*s%-*.*s", userlen + 1, userlen, uname, utlnlen + 1, utlnlen, u->ut_line);
+ maxcmd = MAX_CMD_WIDTH;
+ }
+ printf("%-*.*s%-*.*s", userlen + 1, userlen, uname, utlnlen + 1, utlnlen, tty+5);
+#if (defined(WITH_SYSTEMD) || defined(WITH_ELOGIND)) && defined(HAVE_SD_SESSION_GET_LEADER)
+ if (session) {
+ uint64_t ltime;
+
if (from)
- print_from(u, ip_addresses, fromlen);
+ print_from(session, NULL, ip_addresses, fromlen);
+
+ sd_session_get_start_time(session, &ltime);
+ print_logintime(ltime/((uint64_t) 1000000ULL), stdout);
+ } else {
+#endif
+ if (from)
+ print_from(
+#if (defined(WITH_SYSTEMD) || defined(WITH_ELOGIND)) && defined(HAVE_SD_SESSION_GET_LEADER)
+ NULL,
+#endif
+ u, ip_addresses, fromlen);
+
#ifdef HAVE_UTMPX_H
print_logintime(u->ut_tv.tv_sec, stdout);
#else
print_logintime(u->ut_time, stdout);
#endif
- if (*u->ut_line == ':')
+#if (defined(WITH_SYSTEMD) || defined(WITH_ELOGIND)) && defined(HAVE_SD_SESSION_GET_LEADER)
+ }
+#endif
+ if (u && *u->ut_line == ':')
/* idle unknown for xdm logins */
printf(" ?xdm? ");
else
@@ -454,11 +556,15 @@
} else
printf(" ? ");
} else {
- printf("%-*.*s%-9.8s", userlen + 1, userlen, u->ut_user,
- u->ut_line);
+ printf("%-*.*s%-9.8s", userlen + 1, userlen, uname,
+ tty+5);
if (from)
- print_from(u, ip_addresses, fromlen);
- if (*u->ut_line == ':')
+ print_from(
+#if (defined(WITH_SYSTEMD) || defined(WITH_ELOGIND)) && defined(HAVE_SD_SESSION_GET_LEADER)
+ session,
+#endif
+ u, ip_addresses, fromlen);
+ if (u && *u->ut_line == ':')
/* idle unknown for xdm logins */
printf(" ?xdm? ");
else
@@ -635,7 +741,40 @@
else
printf(_(" IDLE WHAT\n"));
}
-
+#if (defined(WITH_SYSTEMD) || defined(WITH_ELOGIND)) && defined(HAVE_SD_SESSION_GET_LEADER)
+ if (sd_booted() > 0) {
+ char **sessions_list;
+ int sessions;
+ int i;
+
+ sessions = sd_get_sessions (&sessions_list);
+ if (sessions < 0 && sessions != -ENOENT)
+ error(EXIT_FAILURE, -sessions, _("error getting sessions"));
+
+ if (sessions >= 0) {
+ for (int i = 0; i < sessions; i++) {
+ char *name;
+ int r;
+
+ if ((r = sd_session_get_username(sessions_list[i], &name)) < 0)
+ error(EXIT_FAILURE, -r, _("get user name failed"));
+
+ if (user) {
+ if (!strcmp(name, user))
+ showinfo(sessions_list[i], name, NULL, longform,
+ maxcmd, from, userlen, fromlen,
+ ip_addresses);
+ } else {
+ showinfo(sessions_list[i], name, NULL, longform, maxcmd,
+ from, userlen, fromlen, ip_addresses);
+ }
+ free(name);
+ free(sessions_list[i]);
+ }
+ free(sessions_list);
+ }
+ } else {
+#endif
#ifdef HAVE_UTMPX_H
setutxent();
#else
@@ -654,7 +793,11 @@
if (u->ut_type != USER_PROCESS)
continue;
if (!strncmp(u->ut_user, user, UT_NAMESIZE))
- showinfo(u, longform, maxcmd, from, userlen,
+ showinfo(
+#if (defined(WITH_SYSTEMD) || defined(WITH_ELOGIND)) && defined(HAVE_SD_SESSION_GET_LEADER)
+ NULL, NULL,
+#endif
+ u, longform, maxcmd, from, userlen,
fromlen, ip_addresses);
}
} else {
@@ -669,7 +812,11 @@
if (u->ut_type != USER_PROCESS)
continue;
if (*u->ut_user)
- showinfo(u, longform, maxcmd, from, userlen,
+ showinfo(
+#if (defined(WITH_SYSTEMD) || defined(WITH_ELOGIND)) && defined(HAVE_SD_SESSION_GET_LEADER)
+ NULL, NULL,
+#endif
+ u, longform, maxcmd, from, userlen,
fromlen, ip_addresses);
}
}
@@ -678,6 +825,9 @@
#else
endutent();
#endif
+#if (defined(WITH_SYSTEMD) || defined(WITH_ELOGIND)) && defined(HAVE_SD_SESSION_GET_LEADER)
+ }
+#endif
return EXIT_SUCCESS;
}

BIN
procps-ng-3.3.17.tar.xz (Stored with Git LFS)

Binary file not shown.

View File

@ -1,99 +0,0 @@
---
ps/common.h | 1 +
ps/global.c | 5 ++++-
ps/output.c | 19 ++++++++++---------
3 files changed, 15 insertions(+), 10 deletions(-)
--- ps/common.h
+++ ps/common.h 2018-04-04 11:14:33.915688098 +0000
@@ -303,6 +303,7 @@ extern int running_only;
extern int screen_cols;
extern int screen_rows;
extern time_t seconds_since_boot;
+extern unsigned long long jiffies_since_boot;
extern selection_node *selection_list;
extern unsigned simple_select;
extern sort_node *sort_list;
--- ps/global.c
+++ ps/global.c 2018-04-04 11:14:33.915688098 +0000
@@ -78,6 +78,7 @@ int prefer_bsd_defaults = -1
int screen_cols = -1;
int screen_rows = -1;
time_t seconds_since_boot = -1;
+unsigned long long jiffies_since_boot = -1;
selection_node *selection_list = (selection_node *)0xdeadbeef;
unsigned simple_select = 0xffffffff;
sort_node *sort_list = (sort_node *)0xdeadbeef; /* ready-to-use sort list */
@@ -361,6 +362,7 @@ static const char *set_personality(void)
/************ Call this to reinitialize everything ***************/
void reset_global(void){
static proc_t p;
+ double uptime_secs;
reset_selection_list();
look_up_our_self(&p);
set_screen_size();
@@ -383,7 +385,8 @@ void reset_global(void){
negate_selection = 0;
page_size = getpagesize();
running_only = 0;
- seconds_since_boot = uptime(0,0);
+ seconds_since_boot = uptime(&uptime_secs,0);
+ jiffies_since_boot = ((long double)uptime_secs * Hertz);
selection_list = NULL;
simple_select = 0;
sort_list = NULL;
--- ps/output.c
+++ ps/output.c 2018-04-04 11:14:33.915688098 +0000
@@ -134,6 +134,7 @@ static int sr_ ## NAME (const proc_t* P,
#define cook_time(P) (P->utime + P->stime) / Hertz
#define cook_etime(P) (((unsigned long long)seconds_since_boot >= (P->start_time / Hertz)) ? ((unsigned long long)seconds_since_boot - (P->start_time / Hertz)) : 0)
+#define cook_jtime(P) (((unsigned long long)jiffies_since_boot >= (P->start_time)) ? ((unsigned long long)jiffies_since_boot - (P->start_time)) : 0)
#define CMP_COOKED_TIME(NAME) \
static int sr_ ## NAME (const proc_t* P, const proc_t* Q) { \
@@ -507,11 +508,11 @@ static int pr_etimes(char *restrict cons
static int pr_c(char *restrict const outbuf, const proc_t *restrict const pp){
unsigned long long total_time; /* jiffies used by this process */
unsigned pcpu = 0; /* scaled %cpu, 99 means 99% */
- unsigned long long seconds; /* seconds of process life */
+ unsigned long long jiffies; /* jiffies of process life */
total_time = pp->utime + pp->stime;
if(include_dead_children) total_time += (pp->cutime + pp->cstime);
- seconds = cook_etime(pp);
- if(seconds) pcpu = (total_time * 100ULL / Hertz) / seconds;
+ jiffies = cook_jtime(pp);
+ if(jiffies) pcpu = (total_time * 100ULL) / jiffies;
if (pcpu > 99U) pcpu = 99U;
return snprintf(outbuf, COLWID, "%2u", pcpu);
}
@@ -519,11 +520,11 @@ static int pr_c(char *restrict const out
static int pr_pcpu(char *restrict const outbuf, const proc_t *restrict const pp){
unsigned long long total_time; /* jiffies used by this process */
unsigned pcpu = 0; /* scaled %cpu, 999 means 99.9% */
- unsigned long long seconds; /* seconds of process life */
+ unsigned long long jiffies; /* jiffies of process life */
total_time = pp->utime + pp->stime;
if(include_dead_children) total_time += (pp->cutime + pp->cstime);
- seconds = cook_etime(pp);
- if(seconds) pcpu = (total_time * 1000ULL / Hertz) / seconds;
+ jiffies = cook_jtime(pp);
+ if(jiffies) pcpu = (total_time * 1000ULL) / jiffies;
if (pcpu > 999U)
return snprintf(outbuf, COLWID, "%u", pcpu/10U);
return snprintf(outbuf, COLWID, "%u.%u", pcpu/10U, pcpu%10U);
@@ -532,11 +533,11 @@ static int pr_pcpu(char *restrict const
static int pr_cp(char *restrict const outbuf, const proc_t *restrict const pp){
unsigned long long total_time; /* jiffies used by this process */
unsigned pcpu = 0; /* scaled %cpu, 999 means 99.9% */
- unsigned long long seconds; /* seconds of process life */
+ unsigned long long jiffies; /* jiffies of process life */
total_time = pp->utime + pp->stime;
if(include_dead_children) total_time += (pp->cutime + pp->cstime);
- seconds = cook_etime(pp);
- if(seconds) pcpu = (total_time * 1000ULL / Hertz) / seconds;
+ jiffies = cook_jtime(pp);
+ if(jiffies) pcpu = (total_time * 1000ULL) / jiffies;
if (pcpu > 999U) pcpu = 999U;
return snprintf(outbuf, COLWID, "%3u", pcpu);
}

View File

@ -1,29 +0,0 @@
Do not setup SIGHUP signal handler if we are in the batch mode
Top enables a signal handler for the SIGHUP signal (loss of terminal). While
this makes sense for top's default interactive mode, it doesn't make any sense
for batch mode. If you run top in nohup just to collect data over time and
disconnect top finishes which is not what one would expect.
Index: procps-3.2.8/top.c
---
top/top.c | 8 +++++++-
1 file changed, 7 insertions(+), 1 deletion(-)
--- top/top.c
+++ top/top.c 2018-04-04 11:33:59.278280201 +0000
@@ -3691,7 +3691,13 @@ static void before (char *me) {
sa.sa_flags = 0;
for (i = SIGRTMAX; i; i--) {
switch (i) {
- case SIGALRM: case SIGHUP: case SIGINT:
+ case SIGHUP:
+ if (Batch)
+ sa.sa_handler = SIG_IGN;
+ else
+ sa.sa_handler = sig_endpgm;
+ break;
+ case SIGALRM: case SIGINT:
case SIGPIPE: case SIGQUIT: case SIGTERM:
case SIGUSR1: case SIGUSR2:
sa.sa_handler = sig_endpgm;

View File

@ -8,12 +8,12 @@ Ignore it for avoiding the kernel warning message.
Signed-off-by: Takashi Iwai <tiwai@suse.de>
---
sysctl.c | 1 +
src/sysctl.c | 1 +
1 file changed, 1 insertion(+)
--- a/sysctl.c
+++ b/sysctl.c
@@ -59,6 +59,7 @@ static const char DEFAULT_PRELOAD[] = "/
--- a/src/sysctl.c
+++ b/src/sysctl.c
@@ -63,6 +58,7 @@ static const char DEFAULT_PRELOAD[] = "/
static const char *DEPRECATED[] = {
"base_reachable_time",
"retrans_time",

View File

@ -1,11 +1,11 @@
---
top/top.c | 6 +++---
src/top/top.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
--- top/top.c
+++ top/top.c 2018-04-04 11:49:56.472660056 +0000
@@ -1626,9 +1626,9 @@ static inline const char *make_str_utf8
static const char *scale_mem (int target, unsigned long num, int width, int justr) {
--- src/top/top.c
+++ src/top/top.c 2022-03-29 10:24:43.327490984 +0000
@@ -1684,9 +1684,9 @@ static inline const char *make_str_utf8
static const char *scale_mem (int target, float num, int width, int justr) {
// SK_Kb SK_Mb SK_Gb SK_Tb SK_Pb SK_Eb
#ifdef BOOST_MEMORY
- static const char *fmttab[] = { "%.0f", "%#.1f%c", "%#.3f%c", "%#.3f%c", "%#.3f%c", NULL };
@ -15,13 +15,13 @@
+ static const char *fmttab[] = { "%.0f", "%.1f%c", "%.1f%c", "%.1f%c", "%.1f%c", "%.1f%c", NULL };
#endif
static char buf[SMLBUFSIZ];
float scaled_num;
@@ -1640,7 +1640,7 @@ static const char *scale_mem (int target
char *psfx;
@@ -1696,7 +1696,7 @@ static const char *scale_mem (int target
if (Rc.zero_suppress && 0 >= num)
goto end_justifies;
scaled_num = num;
- for (i = SK_Kb, psfx = Scaled_sfxtab; i < SK_Eb; psfx++, i++) {
+ for (i = SK_Kb, psfx = Scaled_sfxtab; i <= SK_Eb; psfx++, i++) {
if (i >= target
&& (width >= snprintf(buf, sizeof(buf), fmttab[i], scaled_num, *psfx)))
&& (width >= snprintf(buf, sizeof(buf), fmttab[i], num, *psfx)))
goto end_justifies;

View File

@ -1,11 +1,11 @@
---
proc/readproc.c | 20 ++++++++++----------
library/readproc.c | 20 ++++++++++----------
1 file changed, 10 insertions(+), 10 deletions(-)
--- proc/readproc.c
+++ proc/readproc.c 2018-06-05 08:54:06.408030693 +0000
@@ -675,7 +675,7 @@ static int file2str(const char *director
else ub->buf = xcalloc((ub->siz = buffGRW));
--- library/readproc.c
+++ library/readproc.c 2022-03-28 11:51:04.751862744 +0000
@@ -735,7 +735,7 @@ static int file2str(const char *director
}
len = snprintf(path, sizeof path, "%s/%s", directory, what);
if (len <= 0 || (size_t)len >= sizeof path) return -1;
- if (-1 == (fd = open(path, O_RDONLY, 0))) return -1;
@ -13,9 +13,9 @@
while (0 < (num = read(fd, ub->buf + tot_read, ub->siz - tot_read))) {
tot_read += num;
if (tot_read < ub->siz) break;
@@ -695,25 +695,25 @@ static int file2str(const char *director
static char** file2strvec(const char* directory, const char* what) {
char buf[2048]; /* read buf bytes at a time */
@@ -759,25 +759,25 @@ static int file2str(const char *director
static char **file2strvec(const char *directory, const char *what) {
char buf[2048]; /* read buf bytes at a time */
char *p, *rbuf = 0, *endbuf, **q, **ret, *strp;
- int fd, tot = 0, n, c, end_of_file = 0;
- int align;
@ -30,37 +30,37 @@
/* read whole file into a memory buffer, allocating as we go */
while ((n = read(fd, buf, sizeof buf - 1)) >= 0) {
- if (n < (int)(sizeof buf - 1))
+ if (n < sizeof buf - 1)
end_of_file = 1;
- if (n <= 0 && tot <= 0) { /* nothing read now, nothing read before */
+ if (n <= 0 && tot <= 0) /* nothing read now, nothing read before */
break; /* process died between our open and read */
- }
- if (n < (int)(sizeof buf - 1))
+ if (n < (sizeof(buf) - 1))
end_of_file = 1;
- if (n <= 0 && tot <= 0) { /* nothing read now, nothing read before */
+ if (n <= 0 && tot <= 0) /* nothing read now, nothing read before */
break; /* process died between our open and read */
- }
+
/* ARG_LEN is our guesstimated median length of a command-line argument
or environment variable (the minimum is 1, the maximum is 131072) */
#define ARG_LEN 64
- if (tot >= INT_MAX / (ARG_LEN + (int)sizeof(char*)) * ARG_LEN - n) {
+ if (tot >= INT_MAX / (ARG_LEN + sizeof(char*)) * ARG_LEN - n) {
end_of_file = 1; /* integer overflow: null-terminate and break */
n = 0; /* but tot > 0 */
}
@@ -741,7 +741,7 @@ static char** file2strvec(const char* di
c = sizeof(char*); /* one extra for NULL term */
/* ARG_LEN is our guesstimated median length of a command-line argument
or environment variable (the minimum is 1, the maximum is 131072) */
#define ARG_LEN 64
- if (tot >= INT_MAX / (ARG_LEN + (int)sizeof(char*)) * ARG_LEN - n) {
+ if (tot >= INT_MAX / (ARG_LEN + sizeof(char*)) * ARG_LEN - n) {
end_of_file = 1; /* integer overflow: null-terminate and break */
n = 0; /* but tot > 0 */
}
@@ -811,7 +811,7 @@ static char **file2strvec(const char *di
c = sizeof(char*); /* one extra for NULL term */
for (p = rbuf; p < endbuf; p++) {
if (!*p || *p == '\n') {
- if (c >= INT_MAX - (tot + (int)sizeof(char*) + align)) break;
+ if (c >= INT_MAX - (tot + sizeof(char*) + align)) break;
c += sizeof(char*);
}
if (*p == '\n')
@@ -753,7 +753,7 @@ static char** file2strvec(const char* di
q = ret = (char**) (endbuf+align); /* ==> free(*ret) to dealloc */
if (!*p || *p == '\n') {
- if (c >= INT_MAX - (tot + (int)sizeof(char*) + align)) break;
+ if (c >= INT_MAX - (tot + sizeof(char*) + align)) break;
c += sizeof(char*);
}
if (*p == '\n')
@@ -824,7 +824,7 @@ static char **file2strvec(const char *di
q = ret = (char**) (endbuf+align); /* ==> free(*ret) to dealloc */
for (strp = p = rbuf; p < endbuf; p++) {
if (!*p) { /* NUL char implies that */
- if (c < 2 * (int)sizeof(char*)) break;
+ if (c < 2 * sizeof(char*)) break;
c -= sizeof(char*);
*q++ = strp; /* point ptrs to the strings */
strp = p+1; /* next string -> next char */
if (!*p) { /* NUL char implies that */
- if (c < 2 * (int)sizeof(char*)) break;
+ if (c < 2 * sizeof(char*)) break;
c -= sizeof(char*);
*q++ = strp; /* point ptrs to the strings */
strp = p+1; /* next string -> next char */

View File

@ -4,32 +4,30 @@
2 files changed, 9 insertions(+), 1 deletion(-)
--- Makefile.am
+++ Makefile.am 2018-04-04 12:28:14.937957527 +0000
@@ -171,7 +171,7 @@ else
slabtop_LDADD = $(LDADD) @NCURSES_LIBS@
+++ Makefile.am 2022-10-20 13:21:37.505517043 +0000
@@ -191,7 +191,7 @@ src_top_top_SOURCES += local/strverscmp.
endif
-top_top_LDADD = $(LDADD) @NCURSES_LIBS@ $(DL_LIB)
+top_top_LDADD = $(LDADD) @TOP_NCURSES_LIBS@ $(DL_LIB)
src_top_top_CFLAGS = @NCURSES_CFLAGS@
-src_top_top_LDADD = $(LDADD) @NCURSES_LIBS@ $(DL_LIB)
+src_top_top_LDADD = $(LDADD) @TOP_NCURSES_LIBS@ $(DL_LIB)
endif
if BUILD_SKILL
--- configure.ac
+++ configure.ac 2018-04-04 12:29:23.364676155 +0000
@@ -194,8 +194,16 @@ else
else
WATCH_NCURSES_LIBS="$NCURSES_LIBS"
fi
+ cf_tinfo=""
+ AC_CHECK_LIB(tinfo, setupterm, [cf_tinfo="tinfo"])
+ if test x$cf_tinfo = xtinfo ; then
+ TOP_NCURSES_LIBS="-ltinfo"
+ else
+ TOP_NCURSES_LIBS="$NCURSES_LIBS"
+ fi
fi
AC_SUBST([NCURSES_LIBS])
+++ configure.ac 2022-10-20 13:23:50.707138810 +0000
@@ -281,6 +281,14 @@ fi
# else
# WATCH_NCURSES_LIBS="$NCURSES_LIBS"
# fi
+cf_tinfo=""
+AC_CHECK_LIB(tinfo, setupterm, [cf_tinfo="tinfo"])
+if test x$cf_tinfo = xtinfo ; then
+ TOP_NCURSES_LIBS="-ltinfo"
+else
+ TOP_NCURSES_LIBS="$NCURSES_LIBS"
+fi
+AC_SUBST([TOP_NCURSES_LIBS])
AC_SUBST([WATCH_NCURSES_LIBS])
AC_SUBST([WATCH_NCURSES_CFLAGS])
AC_ARG_WITH([systemd],
[AS_HELP_STRING([--with-systemd], [enable systemd support])],

View File

@ -1,17 +1,17 @@
---
vmstat.c | 4 ++--
src/vmstat.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
--- vmstat.c
+++ vmstat.c 2016-07-11 13:18:04.993371059 +0000
@@ -273,8 +273,8 @@ static void new_header(void)
--- src/vmstat.c
+++ src/vmstat.c 2023-02-08 08:59:05.175343180 +0000
@@ -333,8 +333,8 @@ static void new_header(void)
static unsigned long unitConvert(unsigned long size)
{
- float cvSize;
- cvSize = (float)size / dataUnit * ((statMode == SLABSTAT) ? 1 : 1024);
+ long double cvSize;
+ cvSize = (long double)size / dataUnit * ((statMode == SLABSTAT) ? 1 : 1024);
return ((unsigned long)cvSize);
- double cvSize;
- cvSize = (double)size / dataUnit * ((statMode == SLABSTAT) ? 1 : 1024);
+ long double cvSize;
+ cvSize = (long double)size / dataUnit * ((statMode == SLABSTAT) ? 1 : 1024);
return ((unsigned long)cvSize);
}

View File

@ -1,11 +1,11 @@
---
w.1 | 3 +++
w.c | 19 ++++++++++++++++---
2 files changed, 19 insertions(+), 3 deletions(-)
procps-ng-4.0.4/man/w.1 | 3 +++
procps-ng-4.0.4/src/w.c | 27 +++++++++++++++++++++++----
2 files changed, 26 insertions(+), 4 deletions(-)
--- w.1
+++ w.1 2023-08-18 08:21:51.764340794 +0000
@@ -40,6 +40,9 @@ and a
--- procps-ng-4.0.4/man/w.1
+++ procps-ng-4.0.4/man/w.1 2023-11-13 12:22:54.245834105 +0000
@@ -51,6 +51,9 @@ and a
\fB\-s\fR, \fB\-\-short\fR
Use the short format. Don't print the login time, JCPU or PCPU times.
.TP
@ -15,34 +15,56 @@
\fB\-f\fR, \fB\-\-from\fR
Toggle printing the
.B from
--- w.c
+++ w.c 2023-08-18 08:37:32.143482035 +0000
@@ -394,7 +394,7 @@ static const proc_t *getproc(const utmp_
}
static void showinfo(utmp_t * u, int formtype, int maxcmd, int from,
- const int userlen, const int fromlen, const int ip_addresses)
+ int userlen, int fromlen, const int ip_addresses)
--- procps-ng-4.0.4/src/w.c
+++ procps-ng-4.0.4/src/w.c 2023-11-13 12:47:16.843483082 +0000
@@ -218,7 +218,8 @@ static void print_from(
if (r < 0 || host == NULL)
print_host("", 0, fromlen);
else {
- print_host(host, strlen(host), fromlen);
+ print_host(host, strlen(host),
+ fromlen == 0?strlen(host):fromlen);
free(host);
}
} else {
@@ -510,7 +511,7 @@ static int find_best_proc(
static void showinfo(
const char *session, const char *name,
utmp_t * u, const int longform, int maxcmd, int from,
- const int userlen, const int fromlen, const int ip_addresses,
+ int userlen, int fromlen, const int ip_addresses,
const int pids)
{
unsigned long long jcpu;
int ut_pid_found;
@@ -424,7 +424,14 @@ static void showinfo(utmp_t * u, int for
strncpy(uname, u->ut_user, UT_NAMESIZE);
unsigned long long jcpu, pcpu;
@@ -520,6 +521,7 @@ static void showinfo(
char cmdline[MAX_CMD_WIDTH + 1];
pid_t best_pid = -1;
int pids_length = 0;
+ int utlnlen = 8;
if (formtype) {
- printf("%-*.*s%-9.8s", userlen + 1, userlen, uname, u->ut_line);
+ int utlnlen = 8;
+ if (formtype > 1) {
+ userlen = strnlen(uname, UT_NAMESIZE);
+ fromlen = strnlen(u->ut_host, UT_HOSTSIZE);
+ utlnlen = strnlen(u->ut_line, UT_LINESIZE);
+ maxcmd = MAX_CMD_WIDTH;
+ }
+ printf("%-*.*s%-*.*s", userlen + 1, userlen, uname, utlnlen + 1, utlnlen, u->ut_line);
if (from)
print_from(u, ip_addresses, fromlen);
#ifdef HAVE_UTMPX_H
@@ -478,6 +485,7 @@ static void __attribute__ ((__noreturn__
strcpy(cmdline, "-");
@@ -572,7 +574,18 @@ static void showinfo(
/* force NUL term for printf */
uname[UT_NAMESIZE] = '\0';
- printf("%-*.*s%-9.8s", userlen + 1, userlen, uname, tty + 5);
+ if (longform > 1) {
+ userlen = strlen(uname);
+ if (u) {
+ fromlen = strnlen(u->ut_host, UT_HOSTSIZE);
+ utlnlen = strnlen(u->ut_line, UT_LINESIZE);
+ } else {
+ fromlen = 0;
+ utlnlen = strlen (tty+5);
+ }
+ maxcmd = MAX_CMD_WIDTH;
+ }
+ printf("%-*.*s%-*.*s", userlen + 1, userlen, uname, utlnlen + 1, utlnlen, tty+5);
if (from)
print_from(session, NULL, ip_addresses, fromlen);
@@ -643,6 +656,7 @@ static void __attribute__ ((__noreturn__
fputs(_(" -h, --no-header do not print header\n"),out);
fputs(_(" -u, --no-current ignore current process username\n"),out);
fputs(_(" -s, --short short format\n"),out);
@ -50,7 +72,7 @@
fputs(_(" -f, --from show remote hostname field\n"),out);
fputs(_(" -o, --old-style old style output\n"),out);
fputs(_(" -i, --ip-addr display IP address instead of hostname (if possible)\n"), out);
@@ -514,6 +522,7 @@ int main(int argc, char **argv)
@@ -681,6 +695,7 @@ int main(int argc, char **argv)
{"no-header", no_argument, NULL, 'h'},
{"no-current", no_argument, NULL, 'u'},
{"short", no_argument, NULL, 's'},
@ -58,16 +80,16 @@
{"from", no_argument, NULL, 'f'},
{"old-style", no_argument, NULL, 'o'},
{"ip-addr", no_argument, NULL, 'i'},
@@ -535,7 +544,7 @@ int main(int argc, char **argv)
@@ -703,7 +718,7 @@ int main(int argc, char **argv)
#endif
while ((ch =
- getopt_long(argc, argv, "husfoVi", longopts, NULL)) != -1)
+ getopt_long(argc, argv, "husnfoVi", longopts, NULL)) != -1)
- getopt_long(argc, argv, "husfoVip", longopts, NULL)) != -1)
+ getopt_long(argc, argv, "husnfoVip", longopts, NULL)) != -1)
switch (ch) {
case 'h':
header = 0;
@@ -546,6 +555,10 @@ int main(int argc, char **argv)
@@ -711,6 +726,10 @@ int main(int argc, char **argv)
case 's':
longform = 0;
break;

View File

@ -1,14 +0,0 @@
---
proc/libprocps.sym | 1 +
1 file changed, 1 insertion(+)
--- proc/libprocps.sym
+++ proc/libprocps.sym 2016-07-11 12:45:32.463107052 +0000
@@ -13,6 +13,7 @@ global:
get_ns_id;
get_ns_name;
get_pid_digits;
+ get_proc_stats;
get_slabinfo;
getbtime;
getdiskstat;

View File

@ -0,0 +1,65 @@
---
local/strutils.c | 22 ++++++++++++----------
1 file changed, 12 insertions(+), 10 deletions(-)
--- local/strutils.c
+++ local/strutils.c 2021-02-09 10:11:25.000000000 +0000
@@ -20,6 +20,8 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
+#include <float.h>
+#include <math.h>
#include <stdlib.h>
#include <ctype.h>
@@ -71,9 +73,9 @@ double strtod_or_err(const char *str, co
*/
double strtod_nol_or_err(char *str, const char *errmesg)
{
- double num;
+ long double num;
const char *cp, *radix;
- double mult;
+ long double mult;
int negative = 0;
if (str != NULL && *str != '\0') {
@@ -95,29 +97,29 @@ double strtod_nol_or_err(char *str, cons
mult=0.1;
while(isdigit(*radix)) {
radix++;
- mult *= 10;
+ mult *= 10.0;
}
while(isdigit(*cp)) {
- num += (*cp - '0') * mult;
- mult /= 10;
+ num += (long double)(*cp - '0') * mult;
+ mult /= 10.0;
cp++;
}
/* got the integers */
if (*cp == '\0')
- return (negative?-num:num);
+ return (double)(negative?-num:num);
if (*cp != '.' && *cp != ',')
error(EXIT_FAILURE, EINVAL, "%s: '%s'", errmesg, str);
cp++;
mult = 0.1;
while(isdigit(*cp)) {
- num += (*cp - '0') * mult;
- mult /= 10;
+ num += (long double)(*cp - '0') * mult;
+ mult /= 10.0;
cp++;
}
if (*cp == '\0')
- return (negative?-num:num);
+ return (double)(negative?-num:num);
}
error(EXIT_FAILURE, errno, "%s: '%s'", errmesg, str);
- return 0;
+ return (double)0;
}

View File

@ -0,0 +1,26 @@
---
library/meminfo.c | 6 +++++-
1 file changed, 5 insertions(+), 1 deletion(-)
--- library/meminfo.c
+++ library/meminfo.c 2022-03-29 09:50:45.076823155 +0000
@@ -710,7 +710,9 @@ static int meminfo_read_failed (
mHr(derived_mem_used) = (unsigned long)mem_used;
if (mHr(HighFree) < mHr(HighTotal))
- mHr(derived_mem_hi_used) = mHr(HighTotal) - mHr(HighFree);
+ mHr(derived_mem_hi_used) = mHr(HighTotal) - mHr(HighFree);
+ else
+ mHr(derived_mem_hi_used) = 0;
if (0 == mHr(LowTotal)) {
mHr(LowTotal) = mHr(MemTotal);
@@ -718,6 +720,8 @@ static int meminfo_read_failed (
}
if (mHr(LowFree) < mHr(LowTotal))
mHr(derived_mem_lo_used) = mHr(LowTotal) - mHr(LowFree);
+ else
+ mHr(derived_mem_lo_used) = 0;
if (mHr(SwapFree) < mHr(SwapTotal))
mHr(derived_swap_used) = mHr(SwapTotal) - mHr(SwapFree);

View File

@ -0,0 +1,15 @@
---
src/sysctl.c | 2 ++
1 file changed, 2 insertions(+)
--- src/sysctl.c
+++ src/sysctl.c 2023-12-14 13:46:09.181625220 +0000
@@ -772,6 +772,8 @@ static int Preload(SettingList *setlist,
fp = (globbuf.gl_pathv[j][0] == '-' && !globbuf.gl_pathv[j][1])
? stdin : fopen(globbuf.gl_pathv[j], "r");
if (!fp) {
+ if (strcmp ("/usr/lib/sysctl.d/99-sysctl.conf", globbuf.gl_pathv[j]) == 0)
+ continue;
xwarn(_("cannot open \"%s\""), globbuf.gl_pathv[j]);
return EXIT_FAILURE;
}

View File

@ -0,0 +1,38 @@
---
testsuite/pmap.test/pmap.exp | 25 -------------------------
1 file changed, 25 deletions(-)
--- testsuite/pmap.test/pmap.exp
+++ testsuite/pmap.test/pmap.exp 2023-11-15 15:34:02.613151770 +0000
@@ -69,31 +69,6 @@ if { [ file readable "/proc/self/smaps"
expect_pass $test "$pmap_initname\$"
}
-
-proc expect_twice_total { test } {
- set totkb 0
- expect {
- -re "\r\n\\s+(\\d+)\[0-9 \]*KB" {
- set totkb $expect_out(1,string)
- expect {
- -re "\r\n\\s+$totkb\[0-9 \]*KB" { pass "$test" }
- eof { fail "$test" }
- timeout { fail "$test" }
- }
- }
- eof { fail "$test" }
- timeout { fail "$test" }
- }
-}
-
-set test "pmap X pid pid has same total"
-spawn $pmap -X $mypid $mypid
-expect_twice_total "$test"
-
-set test "pmap XX pid pid has same total"
-spawn $pmap -XX $mypid $mypid
-expect_twice_total "$test"
-
set test "pmap finding shm"
make_testshm_proc
if { $shmid == "" } {

BIN
procps-ng-4.0.4.tar.xz (Stored with Git LFS) Normal file

Binary file not shown.

View File

@ -0,0 +1,16 @@
-----BEGIN PGP SIGNATURE-----
iQIzBAABCgAdFiEEXT3w9TizJ8CqeneiAiFmwP88hOMFAmTwbLAACgkQAiFmwP88
hONNRg//a6SXHpenZGCpz6bu6qL6UVGGbanjXOCVzEo0eMwX7/b/Pk3r/wLmtP+a
zpfjYVxyLHakeN4gThphLp01SnkuOmFoqXZBe8XZUQTbRm1BMBmmAi7E8GamDJbw
TgpAIW1qKZPgYRMKB1nSxA5a0OCoM1t8ntXrZdau72LoEnGwuEJEeV4F8GmjZnd/
2XIocwuz3xlm7/ByziZ7GuRqibCs+crhBO3vk120LSCRBCNfoS1uSMrdodO95vpX
EMYCYYMomxOYxq2p1gHDQ+KtEy61zDJ9LbMvzs+9TpHy5Ihw+wXNYu8CQmJIIlnT
7gLoAxhl4Ix0QoyUSgvAu7ANYyndFrz7KBPkOCC/2Ig6BJJzf+YEzWSs1QTh2Lld
vKEDjwqc9UiGW/2yKc0rAmeO1EiQf9dyOe+Sray5OiyLUTtoTUxVLSlXiMwsBWiK
E6dtebUIfxm5uxN5z6Ysmcx+hlxbSVPZkjdWG1W8LQdECsNR8/pPO14VpBYZjvSC
MAvzmONM3FSryxw3y5AeuQLS4lrNw+XuG4y8q7zisBtW7RzS9HkM0yFPco5DlnYm
DlMpnY4PIAltZTO2secnV12CdDljVZ6GjoJqnmLKhM6H4M3H/p3oFiZEIvgd2bKK
D/PV9XZJF1/wnNMxBUgJ9cQuqlh013UOuwUzxJ11q9uDj63n9do=
=XLqg
-----END PGP SIGNATURE-----

View File

@ -1 +1,2 @@
addFilter(".*W:.*shared-lib-calls-exit.*libprocps\.so.*")
addFilter(".*W:.*shared-lib-calls-exit.*libproc2\.so.*")
addFilter(".*W:.*macro-in-comment.*%{version}.*")

View File

@ -2,9 +2,9 @@
ps/global.c | 13 ++++++++++---
1 file changed, 10 insertions(+), 3 deletions(-)
--- ps/global.c
+++ ps/global.c 2016-07-11 13:04:59.600533764 +0000
@@ -147,8 +147,11 @@ static void set_screen_size(void){
--- src/ps/global.c
+++ src/ps/global.c 2022-03-29 09:31:24.242140877 +0000
@@ -264,8 +264,11 @@ static void set_screen_size(void){
screen_cols = ws.ws_col; // hmmm, NetBSD subtracts 1
screen_rows = ws.ws_row;
@ -18,7 +18,7 @@
columns = getenv("COLUMNS");
if(columns && *columns){
@@ -290,6 +293,7 @@ static const char *set_personality(void)
@@ -407,6 +410,7 @@ static const char *set_personality(void)
return NULL;
case_aix:
@ -26,7 +26,7 @@
bsd_j_format = "FB_j";
bsd_l_format = "FB_l";
/* bsd_s_format not used */
@@ -317,6 +321,7 @@ static const char *set_personality(void)
@@ -434,6 +438,7 @@ static const char *set_personality(void)
case_sunos4:
personality = PER_NO_DEFAULT_g;
@ -34,7 +34,7 @@
prefer_bsd_defaults = 1;
bsd_j_format = "FB_j";
bsd_l_format = "FB_l";
@@ -342,12 +347,14 @@ static const char *set_personality(void)
@@ -459,12 +464,14 @@ static const char *set_personality(void)
case_hp:
case_hpux:
personality = PER_HPUX_x;
@ -49,10 +49,10 @@
return NULL;
case_posix:
@@ -365,8 +372,8 @@ void reset_global(void){
double uptime_secs;
reset_selection_list();
look_up_our_self(&p);
@@ -505,8 +512,8 @@ void reset_global(void){
}
// --- <pids> interface --------------------------------------------------
- set_screen_size();
set_personality();
+ set_screen_size();

View File

@ -1,7 +1,7 @@
--- proc/devname.c
+++ proc/devname.c 2012-06-01 13:35:43.452010553 +0000
@@ -53,6 +53,10 @@
#define minor <-- do not use -->
--- library/devname.c
+++ library/devname.c 2012-06-01 13:35:43.452010553 +0000
@@ -50,6 +50,10 @@
#define minor(d) ( ((unsigned)(d)&0xffu) | (((unsigned)(d)&0xfff00000u)>>12u) )
#endif
+#ifndef PAGE_SIZE

View File

@ -1,10 +1,10 @@
---
pwdx.c | 1 +
src/pwdx.c | 1 +
1 file changed, 1 insertion(+)
--- pwdx.c
+++ pwdx.c 2016-07-11 13:17:16.154313659 +0000
@@ -109,6 +109,7 @@ int main(int argc, char *argv[])
--- src/pwdx.c
+++ src/pwdx.c 2016-07-11 13:17:16.154313659 +0000
@@ -113,6 +113,7 @@ int main(int argc, char *argv[])
buflen = 10 + strlen(argv[i]) + 1;
buf = xmalloc(buflen);

View File

@ -1,38 +1,38 @@
---
sysctl.8 | 2 ++
sysctl.c | 12 ++++++++++++
man/sysctl.8 | 2 ++
src/sysctl.c | 12 ++++++++++++
2 files changed, 14 insertions(+)
--- sysctl.8
+++ sysctl.8 2021-02-10 10:05:27.781748090 +0000
@@ -81,6 +81,8 @@ directories in the following list in giv
Once a file of a given filename is loaded, any file of the same name
in subsequent directories is ignored.
.br
--- man/sysctl.8
+++ man/sysctl.8 2022-03-29 10:21:47.926686046 +0000
@@ -123,6 +123,8 @@ will read files from directories in the
order from top to bottom. Once a file of a given filename is loaded, any
file of the same name in subsequent directories is ignored.
+/boot/sysctl.conf-<kernelversion>
+.br
/etc/sysctl.d/*.conf
.br
/run/sysctl.d/*.conf
--- sysctl.c
+++ sysctl.c 2021-02-10 10:04:25.290952318 +0000
@@ -39,6 +39,7 @@
--- src/sysctl.c
+++ src/sysctl.c 2022-03-29 10:20:51.795708321 +0000
@@ -45,6 +45,7 @@
#include <string.h>
#include <sys/stat.h>
#include <sys/types.h>
+#include <sys/utsname.h>
#include <unistd.h>
#include <ctype.h>
#include "c.h"
@@ -621,6 +622,7 @@ static int sortpairs(const void *A, cons
static int PreloadSystem(void)
@@ -808,6 +809,7 @@ static int sortpairs(const void *A, cons
static int PreloadSystem(SettingList *setlist)
{
unsigned di, i;
+ struct utsname uts;
const char *dirs[] = {
"/etc/sysctl.d",
"/run/sysctl.d",
@@ -685,6 +687,16 @@ static int PreloadSystem(void)
@@ -872,6 +874,16 @@ static int PreloadSystem(SettingList *se
}
qsort(cfgs, ncfgs, sizeof(struct cfg *), sortpairs);
@ -42,7 +42,7 @@
+ if (access(buf, R_OK) == 0) {
+ if (!Quiet)
+ printf("* Applying %s ...\n", buf);
+ Preload(buf);
+ Preload(setlist, buf);
+ }
+ }
+

View File

@ -1,3 +1,43 @@
-------------------------------------------------------------------
Tue Jul 30 07:14:45 UTC 2024 - Dominique Leuenberger <dimstar@opensuse.org>
- Switch to procps 4 branch, absorbing the former procps4 package:
+ Add provides/obsoletes procps4: make zypper replace procps4
with the main package for users that manually switched.
- Aligning to the existing procps4 package, drop/add/modify
patches:
A 79042e07.patch
A procps-ng-4.0.0-integer-overflow.patch
A procps-ng-4.0.4-ignore-sysctl_conf.patch
A procps-ng-4.0.4-pmapX-not-twice-anymore.patch
A procps-ng-4.0.0-floats.dif
D CVE-2023-4016.patch
D bsc1195468-23da4f40.patch
D procps-3.3.17-bsc1181976.patch
D procps-3.3.17-ignore-sysctl_conf.patch
D procps-3.3.17-library-bsc1181475.patch
D procps-3.3.17-top-bsc1181475.patch
D procps-ng-3.3.10-integer-overflow.patch
D procps-ng-3.3.10-large_pcpu.patch
D procps-ng-3.3.17-logind.patch
D procps-ng-3.3.8-bnc634840.patch
D procps-ng-3.3.9-watch.patch
D procps-ng-3.3.8-accuracy.dif
D procps-ng-3.3.10-bnc634071_procstat2.diff
D procps-ng-3.3.10-fdleak.dif
M procps-ng-3.3.10-errno.patch
M procps-ng-3.3.10-slab.patch
M procps-ng-3.3.11-pmap4suse.patch
M procps-ng-3.3.8-ignore-scan_unevictable_pages.patch
M procps-ng-3.3.8-petabytes.patch
M procps-ng-3.3.8-readeof.patch
M procps-v3.3.3-pwdx.patch
-------------------------------------------------------------------
Thu Feb 29 14:34:38 UTC 2024 - Dominique Leuenberger <dimstar@opensuse.org>
- Use %patch -P N instead of deprecated %patchN.
-------------------------------------------------------------------
Thu Dec 14 13:26:05 UTC 2023 - Thorsten Kukuk <kukuk@suse.com>
@ -14,13 +54,13 @@ Fri Aug 18 09:08:36 UTC 2023 - Dr. Werner Fink <werner@suse.de>
- Modify patches
* procps-ng-3.3.9-w-notruncate.diff
* procps-ng-3.3.17-logind.patch
* procps-ng-3.3.17-logind.patch
to real to not truncate output of w with option -n
-------------------------------------------------------------------
Wed Aug 16 13:50:25 UTC 2023 - Thorsten Kukuk <kukuk@suse.com>
- procps-ng-3.3.17-logind.patch: Backport from 4.x git, prefer
- procps-ng-3.3.17-logind.patch: Backport from 4.x git, prefer
logind over utmp (jsc#PED-3144)
-------------------------------------------------------------------
@ -37,13 +77,13 @@ Tue Dec 27 13:14:52 UTC 2022 - Ludwig Nussel <lnussel@suse.com>
-------------------------------------------------------------------
Thu Dec 15 09:45:46 UTC 2022 - Dr. Werner Fink <werner@suse.de>
- Extend patch procps-3.3.17-library-bsc1181475.patch (bsc#1206412)
- Extend patch procps-3.3.17-library-bsc1181475.patch (bsc#1206412)
- Make sure that correct library version is installed (bsc#1206412)
-------------------------------------------------------------------
Thu Jun 23 11:28:42 UTC 2022 - Dr. Werner Fink <werner@suse.de>
- Some older products do not know about /usr/share/man/uk
- Some older products do not know about /usr/share/man/uk
-------------------------------------------------------------------
Wed Jun 22 12:12:35 UTC 2022 - Dr. Werner Fink <werner@suse.de>
@ -51,7 +91,7 @@ Wed Jun 22 12:12:35 UTC 2022 - Dr. Werner Fink <werner@suse.de>
- Add the patches
* procps-3.3.17-library-bsc1181475.patch
* procps-3.3.17-top-bsc1181475.patch
which are backports of current newlib tree to solve bug bsc#1181475
which are backports of current newlib tree to solve bug bsc#1181475
* 'free' command reports misleading "used" value
-------------------------------------------------------------------
@ -63,13 +103,13 @@ Fri Feb 4 09:21:59 UTC 2022 - Dr. Werner Fink <werner@suse.de>
-------------------------------------------------------------------
Thu Jan 20 13:17:34 UTC 2022 - Dr. Werner Fink <werner@suse.de>
- Correct used URLs
- Correct used URLs
-------------------------------------------------------------------
Fri Jul 2 13:24:08 UTC 2021 - Dr. Werner Fink <werner@suse.de>
- Skip test suite on emulated riscv64 systems as the qemu process
is unexpected on the command lines of processes
is unexpected on the command lines of processes
-------------------------------------------------------------------
Wed Mar 31 10:18:10 UTC 2021 - Dr. Werner Fink <werner@suse.de>
@ -93,7 +133,7 @@ Mon Feb 22 18:57:37 UTC 2021 - Antoine Belvire <antoine.belvire@opensuse.org>
-------------------------------------------------------------------
Thu Feb 11 08:46:36 UTC 2021 - Dr. Werner Fink <werner@suse.de>
- Add /usr/share/man/uk dir to file list for lang sub package
- Add /usr/share/man/uk dir to file list for lang sub package
-------------------------------------------------------------------
Wed Feb 10 17:32:06 UTC 2021 - Antoine Belvire <antoine.belvire@opensuse.org>
@ -338,7 +378,7 @@ Tue Jan 30 09:39:14 UTC 2018 - werner@suse.de
0001-Preload-sysctl-lines-even-if-longer-than-stdio-buffe.patch
0002-Add-flexible-buffered-I-O-based-on-fopencookie-3.patch
0003-Use-new-standard-I-O-for-reading-writing-sysctl-valu.patch
from my project https://gitlab.com/bitstreamout/procps/tree/procio
from my project https://gitlab.com/bitstreamout/procps/tree/procio
which implements a flexible buffer for reading and writing values
below /proc/sys (bsc#1039941)
@ -380,7 +420,7 @@ Mon May 22 08:25:17 UTC 2017 - werner@suse.de
-------------------------------------------------------------------
Wed Apr 26 12:45:15 UTC 2017 - werner@suse.de
- Explain option --no-truncate of command w
- Explain option --no-truncate of command w
-------------------------------------------------------------------
Thu Jan 19 12:20:06 UTC 2017 - werner@suse.de
@ -398,12 +438,12 @@ Mon Dec 12 13:42:04 UTC 2016 - dimstar@opensuse.org
-------------------------------------------------------------------
Tue Aug 9 16:08:03 UTC 2016 - werner@suse.de
- Avoid fillup and insserv on modern systems (bsc#992845)
- Avoid fillup and insserv on modern systems (bsc#992845)
-------------------------------------------------------------------
Tue Jul 12 16:01:19 UTC 2016 - werner@suse.de
- Use test suite but avoid the w command due dummy utmp
- Use test suite but avoid the w command due dummy utmp
* This requires dejagnu for the runtest command
* This requires screen to be able to provide a tty
- Add patch procps-ng-3.3.12-strtod.patch to fix missed extern
@ -595,7 +635,7 @@ Fri Jan 23 15:53:29 UTC 2015 - werner@suse.de
Tue Dec 16 15:32:40 UTC 2014 - werner@suse.de
- Add upstream patch bsc901202-add-better-help-output.patch
which includes the commits
which includes the commits
0f649e2cd2eef94075f1975248953f8c5b85d9f4
4ba9ff5c0df7e94d03a555ac4cec947f6fac2ba6
b4951bfea367eef551b053e9f0240d717c353c11
@ -773,7 +813,7 @@ Tue Mar 25 12:43:12 CET 2014 - tiwai@suse.de
Tue Dec 17 13:17:36 UTC 2013 - werner@suse.de
- Change patch procps-ng-3.3.8-accuracy.dif to really use finally
jiffies to calculate %CPU output (bnc#855861)
jiffies to calculate %CPU output (bnc#855861)
-------------------------------------------------------------------
Mon Oct 7 13:35:36 UTC 2013 - werner@suse.de
@ -813,7 +853,7 @@ Wed Jun 26 14:17:34 UTC 2013 - werner@suse.de
- Add tow upstream patches
0001-top-trade-two-groff_mdoc-macros-for-groff-equivalent.patch
0002-library-for-atexit-support-fix-fileutils-for-EPIPE.patch
0002-library-for-atexit-support-fix-fileutils-for-EPIPE.patch
-------------------------------------------------------------------
Fri Jun 21 11:45:19 UTC 2013 - werner@suse.de
@ -884,7 +924,7 @@ Sun Feb 10 21:24:36 UTC 2013 - crrodriguez@opensuse.org
-------------------------------------------------------------------
Tue Jan 15 11:11:48 UTC 2013 - werner@suse.de
- Make rpmlint happy
- Make rpmlint happy
-------------------------------------------------------------------
Fri Jan 11 16:35:15 UTC 2013 - jengelh@inai.de
@ -900,7 +940,7 @@ Tue Dec 18 17:47:48 UTC 2012 - werner@suse.de
-------------------------------------------------------------------
Tue Oct 30 14:34:52 UTC 2012 - werner@suse.de
- Update to procps-ng-3.3.5
- Update to procps-ng-3.3.5
* Stop SIGFPE on vmstat at times
* Added debian patch for kfreebsd bug, Debian #674785
* Bump the soname
@ -918,7 +958,7 @@ Tue Oct 30 12:35:12 UTC 2012 - werner@suse.de
* top can display a task's environment
* top can display major/minor pg fault deltas, Debian #84992
* top provides additional control over column widths
* top offers user controlled left/right justification
* top offers user controlled left/right justification
-------------------------------------------------------------------
Thu Jul 5 08:13:42 UTC 2012 - werner@suse.de
@ -930,7 +970,7 @@ Thu Jul 5 08:13:42 UTC 2012 - werner@suse.de
Wed Jun 6 12:00:54 UTC 2012 - werner@suse.de
- Avoid to be fooled by a former errno due not existing system
file as this might cause failing pwdx
file as this might cause failing pwdx
-------------------------------------------------------------------
Wed Jun 6 11:43:55 UTC 2012 - werner@suse.de
@ -946,12 +986,12 @@ Wed Jun 6 11:17:37 UTC 2012 - werner@suse.de
-------------------------------------------------------------------
Wed Jun 6 10:35:41 UTC 2012 - werner@suse.de
- Make /bin -> /usr/bin a %bcond
- Make /bin -> /usr/bin a %bcond
-------------------------------------------------------------------
Wed Jun 6 09:44:35 UTC 2012 - werner@suse.de
- Allow SUSE specific pmap to list results for more than one pid
- Allow SUSE specific pmap to list results for more than one pid
-------------------------------------------------------------------
Wed Jun 6 09:30:13 UTC 2012 - werner@suse.de
@ -1114,7 +1154,7 @@ Fri Aug 26 09:36:03 UTC 2011 - lnussel@suse.de
-------------------------------------------------------------------
Wed Aug 24 10:09:36 UTC 2011 - werner@suse.de
- Add large (p)cpu patch from Tony Ernst (bnc#713482)
- Add large (p)cpu patch from Tony Ernst (bnc#713482)
- Add petabytes patch from Tony Ernst (bnc#713482)
-------------------------------------------------------------------
@ -1140,7 +1180,7 @@ Thu May 5 17:49:30 CEST 2011 - jeffm@suse.de
-------------------------------------------------------------------
Tue Mar 22 17:31:22 UTC 2011 - idoenmez@novell.com
- Fix procps-3.2.8.dif: use -Wl for linker options
- Fix procps-3.2.8.dif: use -Wl for linker options
-------------------------------------------------------------------
Fri Dec 3 17:56:27 CET 2010 - werner@suse.de
@ -1449,7 +1489,7 @@ Wed Mar 15 12:15:48 CET 2006 - hvogel@suse.de
-------------------------------------------------------------------
Mon Feb 20 11:59:10 CET 2006 - hvogel@suse.de
- dont crash if a CPU is hotplugged [#151285]
- dont crash if a CPU is hotplugged [#151285]
-------------------------------------------------------------------
Wed Feb 8 17:04:55 CET 2006 - hvogel@suse.de
@ -1583,7 +1623,7 @@ Tue Aug 3 22:45:52 CEST 2004 - garloff@suse.de
-------------------------------------------------------------------
Wed Jun 2 14:05:27 CEST 2004 - uli@suse.de
- fixed crash in small terminal (bug #37651)
- fixed crash in small terminal (bug #37651)
-------------------------------------------------------------------
Tue Mar 30 13:19:14 CEST 2004 - stepan@suse.de
@ -1594,9 +1634,9 @@ Tue Mar 30 13:19:14 CEST 2004 - stepan@suse.de
* ps: STAT flags for fg process group and session leader
* ps: STAT flags for swapped out process dropped (was broken)
* ps: new -M and Z options for security data (SE Linux, etc.)
* slabtop: detect broken /proc/slabinfo -- thanks to Fabian
* slabtop: detect broken /proc/slabinfo -- thanks to Fabian
Frederick
* slabtop: ensure that error messages show up on the screen --
* slabtop: ensure that error messages show up on the screen --
FF again
-------------------------------------------------------------------
@ -1732,11 +1772,11 @@ Mon Jul 14 10:15:14 CEST 2003 - stepan@suse.de
* vmstat: -m displays slabinfo
* vmstat: -d displays disk stats
- update psmisc to 21.3 (has our patch included)
* SELinux SID selection uses -d instead of -S to stop the
* SELinux SID selection uses -d instead of -S to stop the
confusion of signal names.
* Doesnt segfault on long cmdnames, thanks Ben Low
* More fixes for types, also some GCC 3.2 fixes
* Changed a long to a long long in pstree.
* Changed a long to a long long in pstree.
-------------------------------------------------------------------
Fri Jul 4 13:50:34 CEST 2003 - stepan@suse.de
@ -1785,7 +1825,7 @@ Fri Mar 21 14:01:41 CET 2003 - stepan@suse.de
- update procps to 3.1.8
- update xcpustate to 2.6beta
- fix build on itanium
- fix build on itanium
-------------------------------------------------------------------
Wed Mar 5 17:25:45 CET 2003 - stepan@suse.de
@ -1857,7 +1897,7 @@ Fri Aug 16 13:54:35 CEST 2002 - werner@suse.de
-------------------------------------------------------------------
Thu Aug 15 23:24:08 CEST 2002 - ro@suse.de
- modify required-start in boot.sysctl: boot.setup is gone
- modify required-start in boot.sysctl: boot.setup is gone
-------------------------------------------------------------------
Tue Aug 6 13:49:58 CEST 2002 - werner@suse.de
@ -1867,14 +1907,14 @@ Tue Aug 6 13:49:58 CEST 2002 - werner@suse.de
-------------------------------------------------------------------
Mon Aug 5 09:38:42 CEST 2002 - kukuk@suse.de
- boot.sysclt: rename serial to setserial, setserial and
- boot.sysclt: rename serial to setserial, setserial and
boot.isapnp are "should-start".
-------------------------------------------------------------------
Wed Mar 20 14:57:38 CET 2002 - ro@suse.de
- boot.sysctl: don't write out sysctl.conf if it doesn't exist
sysctl can't read the file of a complete dump
sysctl can't read the file of a complete dump
-------------------------------------------------------------------
Fri Feb 22 17:03:16 CET 2002 - werner@suse.de
@ -1886,17 +1926,17 @@ Fri Feb 22 17:03:16 CET 2002 - werner@suse.de
-------------------------------------------------------------------
Fri Feb 1 12:50:25 CET 2002 - ro@suse.de
- added stop/status for sysctl boot script
- added stop/status for sysctl boot script
-------------------------------------------------------------------
Mon Jan 21 17:47:45 CET 2002 - ro@suse.de
- added boot-script for sysctl (inactive by default)
- added boot-script for sysctl (inactive by default)
-------------------------------------------------------------------
Mon Jan 7 17:11:39 CET 2002 - ro@suse.de
- fixed segfault (thanks to andreas)
- fixed segfault (thanks to andreas)
-------------------------------------------------------------------
Thu Dec 20 16:41:52 CET 2001 - werner@suse.de
@ -1947,7 +1987,7 @@ Fri Apr 20 18:37:14 CEST 2001 - werner@suse.de
-------------------------------------------------------------------
Thu Mar 29 18:47:33 CEST 2001 - ro@suse.de
- initialize page_size before first use
- initialize page_size before first use
-------------------------------------------------------------------
Wed Mar 28 11:40:36 CEST 2001 - schwab@suse.de
@ -2017,7 +2057,7 @@ Wed Dec 13 15:58:47 CET 2000 - werner@suse.de
-------------------------------------------------------------------
Mon Dec 4 09:11:51 CET 2000 - ro@suse.de
- don't try to strip man-pages
- don't try to strip man-pages
-------------------------------------------------------------------
Wed Nov 22 18:50:56 CET 2000 - uli@suse.de
@ -2033,12 +2073,12 @@ Fri Nov 17 09:44:00 CET 2000 - ro@suse.de
Sat May 27 11:56:10 CEST 2000 - kukuk@suse.de
- Add Group tag
- Use docdir macro
- Use docdir macro
-------------------------------------------------------------------
Mon May 8 15:16:39 CEST 2000 - ro@suse.de
- procinfo fixed for smp/alpha
- procinfo fixed for smp/alpha
-------------------------------------------------------------------
Mon Feb 28 18:44:11 CET 2000 - werner@suse.de
@ -2064,7 +2104,7 @@ Fri Feb 4 14:53:50 CET 2000 - kasal@suse.cz
-------------------------------------------------------------------
Wed Jan 19 15:06:13 MET 2000 - ro@suse.de
- usr/man -> usr/share/man
- usr/man -> usr/share/man
-------------------------------------------------------------------
Wed Jan 19 12:52:12 CET 2000 - kasal@suse.de
@ -2089,7 +2129,7 @@ Fri Dec 3 18:52:38 CET 1999 - kasal@suse.de
-------------------------------------------------------------------
Wed Nov 24 17:09:50 CET 1999 - kettner@suse.de
- fixed bug in procinfo on AXP
- fixed bug in procinfo on AXP
-------------------------------------------------------------------
Mon Sep 13 17:23:57 CEST 1999 - bs@suse.de
@ -2139,7 +2179,7 @@ Fri Oct 30 16:03:32 MET 1998 - ro@suse.de
- update to procinfo-15 and procps-1.2.9
- extra source for xcpustate-2.5 (no more in procps)
- patched xcpustate to display mem,swap,net for linux
- patched xcpustate to display mem,swap,net for linux
-------------------------------------------------------------------
Thu May 7 09:52:22 MEST 1998 - florian@suse.de
@ -2163,7 +2203,7 @@ Mon Mar 2 16:26:13 MET 1998 - florian@suse.de
-------------------------------------------------------------------
Fri Oct 17 12:57:28 MEST 1997 - ro@suse.de
- ready for autobuild
- ready for autobuild
-------------------------------------------------------------------
Sat Jul 5 10:08:27 MEST 1997 - florian@suse.de

170
procps.keyring Normal file
View File

@ -0,0 +1,170 @@
-----BEGIN PGP PUBLIC KEY BLOCK-----
mQINBE3Mr20BEACryQO8IVg0LeiorBOH5eDORRvthyCslwv5OCqui0r1vg8jXuy4
dRA68UIkVnoLO83i3CcjAyqyn20FO7lg55HySDJWcVD7ltVbrBIv7aDxJqOx2jrt
p66Lk8Ct5ZltBV1nGjNCx3VquMugoGUBtB1ym8zY5NH92LtveSY+bgjPyo9P3Rhl
BzRkd3JehCw97+ELbNqKAxZq6Ku/Oq6E23IQH8h91wzWJ5jMlDdyCXLDxWyXLvjp
2XIbiE2qsRE+/abZNR1Oij3Q7mzY3HJ+AatBzb0JXe87A9Ud19o9IfnlMr8v8SS1
5YE991/9gqqbOsyKJ97kzoFaiea9QSiZzPj+4jCIdM6+jN7F0ToyNZl31GCIcPXc
NEHDBO9c812V2Nc++G6H2aUDAqfTnzQbXhvVI3aqSmvYNh/eBXX/QyYLAhv4qxQL
V4bDuU+JD1a3rqgA+kAhBMsXbDti373wKT5fjpiZsqVXfGhisJmUVLevFaAz8rUA
tCgrIiA9YlMnXqPNZtdoblF/71U46weLTjiLp14Yl8FLnhWV+vK+kwlkZJ/Uv93O
4M7HVRNAG49th8vzKPStMZNwxvg/OyqBxKYvinlDMUzKpVXTxNJICbv2Gg69hrn7
XvgyBxUFZ5CQWKoJm2FoGtwuG1wVTM8F6h7EHA96Lp/UnP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UDTxOOvoPHKRyVULfLGcT9ql56+xzp3WHHB1bnHtUWQ31jM0B1ImZLj3VWQR1kk
1n0ofOG+fDoFbYMj19I6UNexHy0tq/MHoYwsIYCMSiB6KUCB7iDzozDOBObaOLKf
Sp57e4D1sbWl1c11noe+DU2lZ423sE/48NpEeJ2inkUWs9PrM3yQJ4uHxrVr3O1J
pZTen8aVXtSIAC2ecyqNmGOYMF0iLfq4NSsIOOj0y9myIYSifSFb84QFPhPeVU+u
Gnbd/yIbGIwhssQy9EydPwl9iXd/tw9E1ALKj/MHTCSyhFeYYauUgvJxwzBUXJCn
e3PdmiRcrw66AUzV7XjJSZWP/7SFUjf7u+ca56eyyMk3mP6ErDhF1mJC2ZldjGHp
Nf8Hmmfe0suEJt9jOF0b577DdAuZ5MIDSfYjlq7YIdVdp8stHmiivMw=
=enAj
-----END PGP PUBLIC KEY BLOCK-----

View File

@ -1,7 +1,7 @@
#
# spec file for package procps
#
# Copyright (c) 2023 SUSE LLC
# Copyright (c) 2024 SUSE LLC
#
# All modifications and additions to the file contributed by third parties
# remain the property of their copyright owners, unless otherwise agreed
@ -16,8 +16,8 @@
#
%define somajor 8
%define libname libprocps%{somajor}
%define somajor 0
%define libname libproc2-%{somajor}
%if 0%{?suse_version} < 1550
%bcond_with bin2usr
%else
@ -26,30 +26,28 @@
%bcond_without pidof
%bcond_without nls
Name: procps
Version: 3.3.17
Version: 4.0.4
Release: 0
Summary: The ps utilities for /proc
License: GPL-2.0-or-later AND LGPL-2.1-or-later
Group: System/Monitoring
URL: https://sf.net/projects/procps-ng/
Source: https://downloads.sourceforge.net/project/procps-ng/Production/procps-ng-%{version}.tar.xz
Source1: https://downloads.sourceforge.net/project/procps-ng/Production/procps-ng-%{version}.tar.xz.asc
#Alternate: https://gitlab.com/procps-ng/procps/-/archive/v%{version}/procps-v%{version}.tar.gz
Source1: procps-rpmlintrc
Patch0: procps-ng-3.3.9-watch.patch
Source2: procps-rpmlintrc
Source3: procps.keyring
# PATCH-FIX-USTREAM -- w: Don't crash when using short option
Patch0: 79042e07.patch
Patch1: procps-v3.3.3-ia64.diff
Patch3: procps-ng-3.3.9-w-notruncate.diff
Patch7: procps-ng-3.3.8-readeof.patch
Patch8: procps-ng-3.3.10-slab.patch
Patch10: procps-ng-3.3.8-accuracy.dif
Patch11: procps-ng-3.3.10-xen.dif
Patch12: procps-ng-3.3.10-fdleak.dif
Patch13: procps-v3.3.3-columns.dif
Patch14: procps-ng-3.3.10-integer-overflow.patch
Patch15: procps-ng-3.3.10-bnc634071_procstat2.diff
Patch16: procps-ng-3.3.8-bnc634840.patch
Patch14: procps-ng-4.0.0-integer-overflow.patch
Patch17: procps-v3.3.3-read-sysctls-also-from-boot-sysctl.conf-kernelversion.diff
Patch18: procps-ng-3.3.8-petabytes.patch
Patch19: procps-ng-3.3.10-large_pcpu.patch
Patch20: procps-ng-3.3.8-tinfo.dif
Patch21: procps-v3.3.3-pwdx.patch
# PATCH-FIX-OPENSUSE -- trifle rest of the old terabyte patch
@ -60,20 +58,16 @@ Patch31: procps-ng-3.3.8-ignore-scan_unevictable_pages.patch
Patch32: procps-ng-3.3.10-errno.patch
# PATCH-FEATURE-SUSE -- Let upstream pmap behave similar to old suse pmap
Patch33: procps-ng-3.3.11-pmap4suse.patch
# PATCH-FIX-UPSTREAM -- bsc#1181976
Patch34: procps-3.3.17-bsc1181976.patch
# PATCH-FIX-UPSTREAM -- bsc#1195468
Patch35: bsc1195468-23da4f40.patch
# PATCH-FIX-UPSTREAM -- bsc#1214290
Patch36: CVE-2023-4016.patch
# PATCH-BACKPORT-FROM-UPSTREAM -- bsc#1181475: 'free' command reports misleading "used" value
Patch42: procps-3.3.17-library-bsc1181475.patch
Patch43: procps-3.3.17-top-bsc1181475.patch
Patch44: procps-ng-3.3.17-logind.patch
Patch45: procps-3.3.17-ignore-sysctl_conf.patch
# PATCH-FIX-SUSE -- Avoid float errors on 32bit architectures
Patch37: procps-ng-4.0.0-floats.dif
# PATCH-FIX-SUSE -- with 4.0.4 the totals on -X option are always reset for each pid
Patch38: procps-ng-4.0.4-pmapX-not-twice-anymore.patch
# PATCH-FIX-SUSE -- ignore dangling symlink to missing /etc/sysctl.conf file
Patch39: procps-ng-4.0.4-ignore-sysctl_conf.patch
BuildRequires: automake
BuildRequires: dejagnu
BuildRequires: diffutils
BuildRequires: libnuma-devel
BuildRequires: libselinux-devel
BuildRequires: libtool
BuildRequires: ncurses-devel
@ -81,13 +75,10 @@ BuildRequires: pkgconfig
BuildRequires: screen
BuildRequires: xz
BuildRequires: pkgconfig(libsystemd)
Provides: procps4 = %{version}
Obsoletes: procps4 <= 4.0.4
Provides: ps = %{version}-%{release}
Obsoletes: ps < %{version}-%{release}
Requires: %{libname} = %{version}-%{release}
%ifarch ia64 x86_64 ppc64 ppc %{sparc}
BuildRequires: libnuma-devel
%endif
%lang_package
%description
The procps package contains a set of system utilities that provide
@ -107,11 +98,23 @@ logged on and what they are running. The watch program watches a
running program. The vmstat command displays virtual memory statistics
about processes, memory, paging, block I/O, traps, and CPU activity.
%package lang
Summary: Translations for package %{name}
Group: System/Localization
Requires: %{name} = %{version}
Provides: %{name}-lang-all = %{version}
Obsoletes: procps4-lang <= 4.0.4
BuildArch: noarch
%description lang
Provides translations for the "%{name}" package.
%package devel
Summary: Development files for procps
License: GPL-2.0-or-later AND LGPL-2.1-or-later
Group: Development/Libraries/C and C++
Requires: %{libname} = %{version}
Obsoletes: procps4-devel <= 4.0.4
%description devel
The procps library can be used to read informations out from /proc
@ -129,40 +132,35 @@ The procps library can be used to read informations out from /proc
the process information pseudo-file system.
%prep
%setup -q
%patch0
%patch1
%patch3 -b .trcate
%patch7 -b .rof
%patch8 -b .cache
%patch10 -b .acc
%patch11
%patch12
%patch13 -b .column
%patch14 -b .ovrflw
%patch15
%patch16
%patch17 -b .sysctl
%patch18
%patch19
%patch20
%patch21
%patch28
%patch31 -p1
%patch32
%patch33 -b .pmap4us
%patch34
%patch35 -p1
%patch36 -p0
%patch42
%patch43
%patch44 -p1
%patch45 -p1
%setup -q -n procps-ng-%{version}
%patch -P0 -p1
%patch -P1
%patch -P3 -p1 -b .trcate
%patch -P7 -b .rof
%patch -P8 -b .cache
%patch -P11
%patch -P13 -b .column
%patch -P14 -b .ovrflw
%patch -P17 -b .sysctl
%patch -P18
%patch -P20 -b .p20
%patch -P21
%patch -P28
%patch -P31 -p1
%patch -P32 -b .p32
%patch -P33 -b .pmap4us
%patch -P37
%patch -P38
%patch -P39
%build
test -s .tarball-version || echo %{version} > .tarball-version
#./autogen.sh
autoreconf -fiv
if test -f po/Makefile.in.in
then
autoreconf -fiv
else
sh ./autogen.sh
fi
major=$(sed -rn 's/^#define\s+NCURSES_VERSION_MAJOR\s+([0-9]+)/\1/p' %{_includedir}/ncurses.h)
export NCURSESW_CFLAGS="$(ncursesw${major}-config --cflags)"
export NCURSESW_LIBS="$(ncursesw${major}-config --libs)"
@ -194,7 +192,7 @@ export LFS_CFLAGS="$(getconf LFS_CFLAGS)"
%make_build
LD_LIBRARY_PATH=$PWD/proc/.libs \
./pmap $$ || {
./src/pmap $$ || {
uname -a
echo /proc/$$/maps
cat /proc/$$/maps
@ -218,11 +216,11 @@ rm -f %{buildroot}%{_mandir}/*/man1/uptime.1
find %{buildroot} -type f -name "*.la" -delete -print
rm -rf %{buildroot}%{_datadir}/doc/procps-ng
if cmp -s %{buildroot}%{_mandir}/man1/procps.1 %{buildroot}%{_mandir}/man1/ps.1
if cmp -s %{buildroot}%{_mandir}/man1/pidwait.1 %{buildroot}%{_mandir}/man1/pkill.1
then
rm -vf %{buildroot}%{_mandir}/man1/procps.1
(cat > %{buildroot}%{_mandir}/man1/procps.1)<<-'EOF'
.so man1/ps.1
rm -vf %{buildroot}%{_mandir}/man1/pidwait.1
(cat > %{buildroot}%{_mandir}/man1/pidwait.1)<<-'EOF'
.so man1/pkill.1
EOF
fi
@ -284,6 +282,10 @@ ln -s /sbin/sysctl %{buildroot}%{_sbindir}/sysctl
%postun -n %{libname} -p /sbin/ldconfig
%check
set +x
ls -ld /proc/[a-z]*
cat /proc/stat
set -x
#
# Skip w test as there is no valid utmp
#
@ -294,11 +296,13 @@ rm -rvf testsuite/w.test
LANG=POSIX
LC_ALL=$LANG
unset LC_CTYPE
TMPDIR=$(mktemp -d /tmp/bash.XXXXXXXXXX) || exit 1
SCREENDIR=$(mktemp -d ${PWD}/screen.XXXXXX) || exit 1
SCREENRC=${SCREENDIR}/bash
export SCREENRC SCREENDIR
exec 0< /dev/null
SCREENLOG=${SCREENDIR}/log
> $SCREENLOG
cat > $SCREENRC<<-EOF
deflogin off
deflog on
@ -311,17 +315,17 @@ cat > $SCREENRC<<-EOF
silence on
utf8 on
EOF
TMPDIR=$(mktemp -d /tmp/bash.XXXXXXXXXX) || exit 1
> $SCREENLOG
tail -q -s 0.5 -f $SCREENLOG & pid=$!
env HOME=$PWD TERM=$TERM TMPDIR=$TMPDIR SCREENRC=$SCREENRC SCREENDIR=$SCREENDIR \
screen -D -m make check
sleep 1
kill -TERM $pid
error=no
for log in test-suite.log testsuite/*.log
for log in testsuite/*.log test-suite.log
do
if grep -E '^(XFAIL|FAIL|ERROR):' $log
then
echo Check $log
cat $log
error=yes
fi
@ -338,7 +342,7 @@ test $error = no || exit 1
%files
%defattr (-,root,root,755)
%license COPYING COPYING.LIB
%doc NEWS Documentation/bugs.md Documentation/FAQ
%doc NEWS doc/bugs.md doc/FAQ
%if %{with bin2usr}
%if 0%{?suse_version} < 1550
%verify(link) /bin/ps
@ -365,7 +369,7 @@ test $error = no || exit 1
%{_bindir}/pidof
%endif
%{_bindir}/pmap
%{_bindir}/pwait
%{_bindir}/pidwait
%{_bindir}/pwdx
%{_bindir}/skill
%{_bindir}/slabtop
@ -382,9 +386,8 @@ test $error = no || exit 1
%endif
%{_mandir}/man1/pkill.1%{?ext_man}
%{_mandir}/man1/pmap.1%{?ext_man}
%{_mandir}/man1/procps.1%{?ext_man}
%{_mandir}/man1/ps.1%{?ext_man}
%{_mandir}/man1/pwait.1%{?ext_man}
%{_mandir}/man1/pidwait.1%{?ext_man}
%{_mandir}/man1/pwdx.1%{?ext_man}
%{_mandir}/man1/skill.1%{?ext_man}
%{_mandir}/man1/slabtop.1%{?ext_man}
@ -399,33 +402,18 @@ test $error = no || exit 1
%files devel
%defattr (-,root,root,755)
%dir %{_includedir}/proc
%{_includedir}/proc/alloc.h
%{_includedir}/proc/devname.h
%{_includedir}/proc/escape.h
%{_includedir}/proc/numa.h
%{_includedir}/proc/procps.h
%{_includedir}/proc/pwcache.h
%{_includedir}/proc/readproc.h
%{_includedir}/proc/sig.h
%{_includedir}/proc/slab.h
%{_includedir}/proc/sysinfo.h
%{_includedir}/proc/version.h
%{_includedir}/proc/wchan.h
%{_includedir}/proc/whattime.h
%{_libdir}/libprocps.so
%{_libdir}/pkgconfig/libprocps.pc
%{_mandir}/man3/openproc.3%{?ext_man}
%{_mandir}/man3/readproc.3%{?ext_man}
%{_mandir}/man3/readproctab.3%{?ext_man}
%dir %{_includedir}/libproc2/
%{_includedir}/libproc2/*.h
%{_libdir}/libproc2.so
%{_libdir}/pkgconfig/libproc2.pc
%{_mandir}/man3/procps.3%{?ext_man}
%{_mandir}/man3/procps_misc.3%{?ext_man}
%{_mandir}/man3/procps_pids.3%{?ext_man}
%files -n %{libname}
%defattr (-,root,root,755)
%{_libdir}/libprocps.so.%{somajor}*
%{_libdir}/libproc2.so.%{somajor}*
%files lang -f procps-ng.lang
%if 0%{?suse_version} < 1550
%dir %{_mandir}/uk/
%endif
%changelog