forked from pool/procps
Compare commits
6 Commits
| Author | SHA256 | Date | |
|---|---|---|---|
| 444a6d4cbc | |||
| a85303f981 | |||
| 8fc668fced | |||
| 8b389ddc89 | |||
| 4ae2b40ad1 | |||
| 0fa4a1bb1e |
176
79042e07.patch
176
79042e07.patch
@@ -1,176 +0,0 @@
|
||||
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, <ime);
|
||||
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
|
||||
|
||||
@@ -11,7 +11,7 @@ and this causes a problem later on (bsc#908516)
|
||||
|
||||
--- src/free.c
|
||||
+++ src/free.c 2022-10-20 13:33:28.880818112 +0000
|
||||
@@ -208,6 +208,7 @@ int main(int argc, char **argv)
|
||||
@@ -143,6 +143,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;
|
||||
@@ -19,7 +19,7 @@ and this causes a problem later on (bsc#908516)
|
||||
|
||||
/*
|
||||
* For long options that have no equivalent short option, use a
|
||||
@@ -260,10 +261,12 @@ int main(int argc, char **argv)
|
||||
@@ -195,10 +196,12 @@ int main(int argc, char **argv)
|
||||
#ifdef HAVE_PROGRAM_INVOCATION_NAME
|
||||
program_invocation_name = program_invocation_short_name;
|
||||
#endif
|
||||
@@ -32,7 +32,7 @@ and this causes a problem later on (bsc#908516)
|
||||
|
||||
while ((c = getopt_long(argc, argv, "bkmghlLtvCc:ws:V", longopts, NULL)) != -1)
|
||||
switch (c) {
|
||||
@@ -336,11 +339,13 @@ int main(int argc, char **argv)
|
||||
@@ -271,11 +274,13 @@ int main(int argc, char **argv)
|
||||
break;
|
||||
case 's':
|
||||
flags |= FREE_REPEAT;
|
||||
|
||||
@@ -6,16 +6,16 @@
|
||||
4 files changed, 24 insertions(+), 3 deletions(-)
|
||||
|
||||
--- library/meminfo.c
|
||||
+++ library/meminfo.c 2023-09-12 12:08:41.033738450 +0000
|
||||
+++ library/meminfo.c 2024-09-24 07:35:28.750667635 +0000
|
||||
@@ -3,6 +3,7 @@
|
||||
*
|
||||
* Copyright © 2015-2023 Jim Warner <james.warner@comcast.net>
|
||||
* Copyright © 2015-2024 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 (
|
||||
@@ -666,6 +667,7 @@ static int meminfo_read_failed (
|
||||
int size;
|
||||
unsigned long *valptr;
|
||||
signed long mem_used;
|
||||
@@ -23,7 +23,7 @@
|
||||
|
||||
// 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 (
|
||||
@@ -726,7 +728,10 @@ static int meminfo_read_failed (
|
||||
|
||||
if (0 == mHr(MemAvailable))
|
||||
mHr(MemAvailable) = mHr(MemFree);
|
||||
@@ -36,7 +36,7 @@
|
||||
/* 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
|
||||
+++ man/free.1 2024-09-24 07:34:16.775969885 +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.
|
||||
@@ -51,8 +51,8 @@
|
||||
Display the result
|
||||
.I count
|
||||
--- src/free.c
|
||||
+++ src/free.c 2023-09-12 12:10:26.647842455 +0000
|
||||
@@ -92,6 +92,7 @@ static void __attribute__ ((__noreturn__
|
||||
+++ src/free.c 2024-09-24 07:34:16.775969885 +0000
|
||||
@@ -91,6 +91,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);
|
||||
@@ -60,7 +60,7 @@
|
||||
fputs(_(" -w, --wide wide output\n"), out);
|
||||
fputs(USAGE_SEPARATOR, out);
|
||||
fputs(_(" --help display this help and exit\n"), out);
|
||||
@@ -244,6 +245,7 @@ int main(int argc, char **argv)
|
||||
@@ -179,6 +180,7 @@ int main(int argc, char **argv)
|
||||
{ "committed", no_argument, NULL, 'v' },
|
||||
{ "seconds", required_argument, NULL, 's' },
|
||||
{ "count", required_argument, NULL, 'c' },
|
||||
@@ -68,7 +68,7 @@
|
||||
{ "wide", no_argument, NULL, 'w' },
|
||||
{ "help", no_argument, NULL, HELP_OPTION },
|
||||
{ "version", no_argument, NULL, 'V' },
|
||||
@@ -263,7 +265,7 @@ int main(int argc, char **argv)
|
||||
@@ -198,7 +200,7 @@ int main(int argc, char **argv)
|
||||
textdomain(PACKAGE);
|
||||
atexit(close_stdout);
|
||||
|
||||
@@ -77,7 +77,7 @@
|
||||
switch (c) {
|
||||
case 'b':
|
||||
check_unit_set(&unit_set);
|
||||
@@ -352,6 +354,9 @@ int main(int argc, char **argv)
|
||||
@@ -287,6 +289,9 @@ int main(int argc, char **argv)
|
||||
case 'w':
|
||||
flags |= FREE_WIDE;
|
||||
break;
|
||||
@@ -88,7 +88,7 @@
|
||||
usage(stdout);
|
||||
case 'V':
|
||||
--- src/vmstat.c
|
||||
+++ src/vmstat.c 2023-09-12 12:08:41.033738450 +0000
|
||||
+++ src/vmstat.c 2024-09-24 07:34:16.775969885 +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);
|
||||
@@ -97,7 +97,7 @@
|
||||
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[])
|
||||
@@ -987,6 +988,7 @@ int main(int argc, char *argv[])
|
||||
{"partition", required_argument, NULL, 'p'},
|
||||
{"unit", required_argument, NULL, 'S'},
|
||||
{"wide", no_argument, NULL, 'w'},
|
||||
@@ -105,7 +105,7 @@
|
||||
{"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[])
|
||||
@@ -1003,7 +1005,7 @@ int main(int argc, char *argv[])
|
||||
atexit(close_stdout);
|
||||
|
||||
while ((c =
|
||||
@@ -114,7 +114,7 @@
|
||||
switch (c) {
|
||||
case 'V':
|
||||
printf(PROCPS_NG_VERSION);
|
||||
@@ -1034,6 +1036,9 @@ int main(int argc, char *argv[])
|
||||
@@ -1070,6 +1072,9 @@ int main(int argc, char *argv[])
|
||||
case 't':
|
||||
t_option = 1;
|
||||
break;
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
|
||||
--- src/vmstat.c
|
||||
+++ src/vmstat.c 2022-03-29 09:21:41.156855432 +0000
|
||||
@@ -357,7 +357,7 @@ static void new_format(void)
|
||||
@@ -405,7 +405,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;
|
||||
@@ -13,7 +13,7 @@
|
||||
struct tm *tm_ptr;
|
||||
time_t the_time;
|
||||
char timebuf[32];
|
||||
@@ -484,12 +484,12 @@ static void new_format(void)
|
||||
@@ -528,12 +528,12 @@ static void new_format(void)
|
||||
|
||||
/* idle can run backwards for a moment -- kernel "feature" */
|
||||
if (debt) {
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
2 files changed, 44 insertions(+), 20 deletions(-)
|
||||
|
||||
--- src/pmap.c
|
||||
+++ src/pmap.c 2023-09-12 12:23:39.537610124 +0000
|
||||
+++ src/pmap.c 2024-09-24 07:54:47.345701003 +0000
|
||||
@@ -59,7 +59,9 @@ const char *nls_Address,
|
||||
*nls_Kbytes,
|
||||
*nls_Mode,
|
||||
@@ -39,7 +39,7 @@
|
||||
|
||||
static unsigned shm_minor = ~0u;
|
||||
|
||||
@@ -544,12 +548,17 @@ static int one_proc (struct pids_stack *
|
||||
@@ -548,12 +552,17 @@ static int one_proc (struct pids_stack *
|
||||
char perms[32] = "";
|
||||
const char *cp2 = NULL;
|
||||
unsigned long long rss = 0ull;
|
||||
@@ -55,9 +55,9 @@
|
||||
int maxw1=0, maxw2=0, maxw3=0, maxw4=0, maxw5=0;
|
||||
+ int maxw6=0, maxw7=0;
|
||||
|
||||
printf("%u: %s\n", PIDS_VAL(tgid, s_int, p, Pids_info), PIDS_VAL(cmdline, str, p, Pids_info));
|
||||
printf("%u: %s\n", PIDS_VAL(tgid, s_int, p), PIDS_VAL(cmdline, str, p));
|
||||
|
||||
@@ -572,13 +581,15 @@ static int one_proc (struct pids_stack *
|
||||
@@ -576,13 +585,15 @@ static int one_proc (struct pids_stack *
|
||||
if (x_option) {
|
||||
maxw1 = 16;
|
||||
if (sizeof(long) == 4) maxw1 = 8;
|
||||
@@ -74,7 +74,7 @@
|
||||
maxw5 = justify_print(nls_Mode, maxw5, 0);
|
||||
justify_print(nls_Mapping, 0, 0);
|
||||
}
|
||||
@@ -618,6 +629,11 @@ static int one_proc (struct pids_stack *
|
||||
@@ -622,6 +633,11 @@ static int one_proc (struct pids_stack *
|
||||
total_rss += smap_value;
|
||||
continue;
|
||||
}
|
||||
@@ -86,7 +86,7 @@
|
||||
if (strcmp("Shared_Dirty", smap_key) == 0) {
|
||||
shared_dirty = smap_value;
|
||||
total_shared_dirty += smap_value;
|
||||
@@ -630,16 +646,20 @@ static int one_proc (struct pids_stack *
|
||||
@@ -634,16 +650,20 @@ static int one_proc (struct pids_stack *
|
||||
}
|
||||
if (strcmp("Swap", smap_key) == 0) {
|
||||
/* doesn't matter as long as last */
|
||||
@@ -109,7 +109,7 @@
|
||||
diff = end = 0;
|
||||
perms[0] = '\0';
|
||||
cp2 = NULL;
|
||||
@@ -673,7 +693,6 @@ static int one_proc (struct pids_stack *
|
||||
@@ -681,7 +701,6 @@ static int one_proc (struct pids_stack *
|
||||
if (perms[3] == 's')
|
||||
total_shared += diff;
|
||||
if (perms[3] == 'p') {
|
||||
@@ -117,7 +117,7 @@
|
||||
if (perms[1] == 'w')
|
||||
total_private_writeable += diff;
|
||||
else
|
||||
@@ -725,17 +744,21 @@ static int one_proc (struct pids_stack *
|
||||
@@ -733,17 +752,21 @@ static int one_proc (struct pids_stack *
|
||||
justify_print("----------------", maxw1, 0);
|
||||
justify_print("-------", maxw2, 1);
|
||||
justify_print("-------", maxw3, 1);
|
||||
@@ -141,7 +141,7 @@
|
||||
}
|
||||
if (d_option) {
|
||||
printf
|
||||
@@ -1052,16 +1075,18 @@ int main(int argc, char **argv)
|
||||
@@ -1060,16 +1083,18 @@ int main(int argc, char **argv)
|
||||
while ((c = getopt_long(argc, argv, "xXrdqA:hVcC:nN:p", longopts, NULL)) != -1)
|
||||
switch (c) {
|
||||
case 'x':
|
||||
@@ -163,7 +163,7 @@
|
||||
case 'q':
|
||||
q_option = 1;
|
||||
--- testsuite/pmap.test/pmap.exp
|
||||
+++ testsuite/pmap.test/pmap.exp 2023-09-12 12:25:22.375764402 +0000
|
||||
+++ testsuite/pmap.test/pmap.exp 2024-09-24 07:52:40.843990587 +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
|
||||
|
||||
@@ -13,11 +13,11 @@ Signed-off-by: Takashi Iwai <tiwai@suse.de>
|
||||
|
||||
--- a/src/sysctl.c
|
||||
+++ b/src/sysctl.c
|
||||
@@ -63,6 +58,7 @@ static const char DEFAULT_PRELOAD[] = "/
|
||||
@@ -64,6 +64,7 @@ static const char DEFAULT_PRELOAD[] = "/
|
||||
static const char *DEPRECATED[] = {
|
||||
"base_reachable_time",
|
||||
"retrans_time",
|
||||
+ "scan_unevictable_pages",
|
||||
""
|
||||
};
|
||||
static bool IgnoreDeprecated;
|
||||
/* Verboten parameters must never be read as they cause side-effects */
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
|
||||
--- 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
|
||||
@@ -1705,9 +1705,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
|
||||
@@ -16,7 +16,7 @@
|
||||
#endif
|
||||
static char buf[SMLBUFSIZ];
|
||||
char *psfx;
|
||||
@@ -1696,7 +1696,7 @@ static const char *scale_mem (int target
|
||||
@@ -1717,7 +1717,7 @@ static const char *scale_mem (int target
|
||||
if (Rc.zero_suppress && 0 >= num)
|
||||
goto end_justifies;
|
||||
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
|
||||
--- library/readproc.c
|
||||
+++ library/readproc.c 2022-03-28 11:51:04.751862744 +0000
|
||||
@@ -735,7 +735,7 @@ static int file2str(const char *director
|
||||
@@ -738,7 +738,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;
|
||||
@@ -13,7 +13,7 @@
|
||||
while (0 < (num = read(fd, ub->buf + tot_read, ub->siz - tot_read))) {
|
||||
tot_read += num;
|
||||
if (tot_read < ub->siz) break;
|
||||
@@ -759,25 +759,25 @@ static int file2str(const char *director
|
||||
@@ -762,25 +762,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;
|
||||
@@ -46,7 +46,7 @@
|
||||
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
|
||||
@@ -814,7 +814,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') {
|
||||
@@ -55,7 +55,7 @@
|
||||
c += sizeof(char*);
|
||||
}
|
||||
if (*p == '\n')
|
||||
@@ -824,7 +824,7 @@ static char **file2strvec(const char *di
|
||||
@@ -827,7 +827,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 */
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
|
||||
--- Makefile.am
|
||||
+++ Makefile.am 2022-10-20 13:21:37.505517043 +0000
|
||||
@@ -191,7 +191,7 @@ src_top_top_SOURCES += local/strverscmp.
|
||||
@@ -204,7 +204,7 @@ src_top_top_SOURCES += local/strverscmp.
|
||||
endif
|
||||
|
||||
src_top_top_CFLAGS = @NCURSES_CFLAGS@
|
||||
@@ -16,7 +16,7 @@
|
||||
if BUILD_SKILL
|
||||
--- configure.ac
|
||||
+++ configure.ac 2022-10-20 13:23:50.707138810 +0000
|
||||
@@ -281,6 +281,14 @@ fi
|
||||
@@ -264,6 +264,14 @@ fi
|
||||
# else
|
||||
# WATCH_NCURSES_LIBS="$NCURSES_LIBS"
|
||||
# fi
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
|
||||
--- src/vmstat.c
|
||||
+++ src/vmstat.c 2023-02-08 08:59:05.175343180 +0000
|
||||
@@ -333,8 +333,8 @@ static void new_header(void)
|
||||
@@ -341,8 +341,8 @@ static void new_header(void)
|
||||
|
||||
static unsigned long unitConvert(unsigned long size)
|
||||
{
|
||||
|
||||
@@ -1,11 +1,11 @@
|
||||
---
|
||||
procps-ng-4.0.4/man/w.1 | 3 +++
|
||||
procps-ng-4.0.4/src/w.c | 27 +++++++++++++++++++++++----
|
||||
procps-ng-4.0.5/man/w.1 | 3 +++
|
||||
procps-ng-4.0.5/src/w.c | 27 +++++++++++++++++++++++----
|
||||
2 files changed, 26 insertions(+), 4 deletions(-)
|
||||
|
||||
--- 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
|
||||
--- procps-ng-4.0.5/man/w.1
|
||||
+++ procps-ng-4.0.5/man/w.1 2024-09-24 07:22:43.880495759 +0000
|
||||
@@ -55,6 +55,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,8 +15,8 @@
|
||||
\fB\-f\fR, \fB\-\-from\fR
|
||||
Toggle printing the
|
||||
.B from
|
||||
--- procps-ng-4.0.4/src/w.c
|
||||
+++ procps-ng-4.0.4/src/w.c 2023-11-13 12:47:16.843483082 +0000
|
||||
--- procps-ng-4.0.5/src/w.c
|
||||
+++ procps-ng-4.0.5/src/w.c 2024-09-24 07:26:56.775930141 +0000
|
||||
@@ -218,7 +218,8 @@ static void print_from(
|
||||
if (r < 0 || host == NULL)
|
||||
print_host("", 0, fromlen);
|
||||
@@ -27,16 +27,16 @@
|
||||
free(host);
|
||||
}
|
||||
} else {
|
||||
@@ -510,7 +511,7 @@ static int find_best_proc(
|
||||
@@ -543,7 +544,7 @@ static void show_uptime(
|
||||
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)
|
||||
const int pids,
|
||||
struct pids_fetch *reap)
|
||||
{
|
||||
unsigned long long jcpu, pcpu;
|
||||
@@ -520,6 +521,7 @@ static void showinfo(
|
||||
@@ -554,6 +555,7 @@ static void showinfo(
|
||||
char cmdline[MAX_CMD_WIDTH + 1];
|
||||
pid_t best_pid = -1;
|
||||
int pids_length = 0;
|
||||
@@ -44,7 +44,7 @@
|
||||
|
||||
strcpy(cmdline, "-");
|
||||
|
||||
@@ -572,7 +574,18 @@ static void showinfo(
|
||||
@@ -604,7 +606,18 @@ static void showinfo(
|
||||
/* force NUL term for printf */
|
||||
uname[UT_NAMESIZE] = '\0';
|
||||
|
||||
@@ -62,9 +62,9 @@
|
||||
+ }
|
||||
+ printf("%-*.*s%-*.*s", userlen + 1, userlen, uname, utlnlen + 1, utlnlen, tty+5);
|
||||
if (from)
|
||||
print_from(session, NULL, ip_addresses, fromlen);
|
||||
print_from(session, u, ip_addresses, fromlen);
|
||||
|
||||
@@ -643,6 +656,7 @@ static void __attribute__ ((__noreturn__
|
||||
@@ -678,6 +691,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);
|
||||
@@ -72,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);
|
||||
@@ -681,6 +695,7 @@ int main(int argc, char **argv)
|
||||
@@ -720,6 +734,7 @@ int main(int argc, char **argv)
|
||||
{"no-header", no_argument, NULL, 'h'},
|
||||
{"no-current", no_argument, NULL, 'u'},
|
||||
{"short", no_argument, NULL, 's'},
|
||||
@@ -80,16 +80,16 @@
|
||||
{"from", no_argument, NULL, 'f'},
|
||||
{"old-style", no_argument, NULL, 'o'},
|
||||
{"ip-addr", no_argument, NULL, 'i'},
|
||||
@@ -703,7 +718,7 @@ int main(int argc, char **argv)
|
||||
@@ -742,7 +757,7 @@ int main(int argc, char **argv)
|
||||
#endif
|
||||
|
||||
while ((ch =
|
||||
- getopt_long(argc, argv, "husfoVip", longopts, NULL)) != -1)
|
||||
+ getopt_long(argc, argv, "husnfoVip", longopts, NULL)) != -1)
|
||||
- getopt_long(argc, argv, "chusfoVip", longopts, NULL)) != -1)
|
||||
+ getopt_long(argc, argv, "chusnfoVip", longopts, NULL)) != -1)
|
||||
switch (ch) {
|
||||
case 'h':
|
||||
header = 0;
|
||||
@@ -711,6 +726,10 @@ int main(int argc, char **argv)
|
||||
case 'c':
|
||||
container = 1;
|
||||
@@ -753,6 +768,10 @@ int main(int argc, char **argv)
|
||||
case 's':
|
||||
longform = 0;
|
||||
break;
|
||||
|
||||
@@ -11,55 +11,57 @@
|
||||
+#include <float.h>
|
||||
+#include <math.h>
|
||||
#include <stdlib.h>
|
||||
#include <ctype.h>
|
||||
|
||||
@@ -71,9 +73,9 @@ double strtod_or_err(const char *str, co
|
||||
#include <stdbool.h>
|
||||
#include <assert.h>
|
||||
@@ -76,9 +78,9 @@ double strtod_or_err(const char *str, co
|
||||
*/
|
||||
double strtod_nol_or_err(char *str, const char *errmesg)
|
||||
double strtod_nol_or_err(const char *str, const char *errmesg)
|
||||
{
|
||||
- double num;
|
||||
+ long double num;
|
||||
const char *cp, *radix;
|
||||
- double mult;
|
||||
+ long double mult;
|
||||
int negative = 0;
|
||||
- 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);
|
||||
if (str != NULL && *str != '\0') {
|
||||
@@ -100,31 +102,31 @@ double strtod_nol_or_err(const char *str
|
||||
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;
|
||||
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;
|
||||
}
|
||||
|
||||
// column width of a multi-byte string
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
|
||||
--- library/meminfo.c
|
||||
+++ library/meminfo.c 2022-03-29 09:50:45.076823155 +0000
|
||||
@@ -710,7 +710,9 @@ static int meminfo_read_failed (
|
||||
@@ -744,7 +744,9 @@ static int meminfo_read_failed (
|
||||
mHr(derived_mem_used) = (unsigned long)mem_used;
|
||||
|
||||
if (mHr(HighFree) < mHr(HighTotal))
|
||||
@@ -15,7 +15,7 @@
|
||||
|
||||
if (0 == mHr(LowTotal)) {
|
||||
mHr(LowTotal) = mHr(MemTotal);
|
||||
@@ -718,6 +720,8 @@ static int meminfo_read_failed (
|
||||
@@ -752,6 +754,8 @@ static int meminfo_read_failed (
|
||||
}
|
||||
if (mHr(LowFree) < mHr(LowTotal))
|
||||
mHr(derived_mem_lo_used) = mHr(LowTotal) - mHr(LowFree);
|
||||
|
||||
@@ -1,16 +0,0 @@
|
||||
Index: procps-ng-4.0.4/src/w.c
|
||||
===================================================================
|
||||
--- procps-ng-4.0.4.orig/src/w.c
|
||||
+++ procps-ng-4.0.4/src/w.c
|
||||
@@ -613,8 +613,10 @@ static void showinfo(
|
||||
if (u && *u->ut_line == ':')
|
||||
/* idle unknown for xdm logins */
|
||||
printf(" ?xdm? ");
|
||||
- else
|
||||
+ else if (tty[5])
|
||||
print_time_ival7(idletime(tty), 0, stdout);
|
||||
+ else
|
||||
+ printf(" ");
|
||||
|
||||
/* jpcpu/pcpu */
|
||||
if (longform) {
|
||||
@@ -4,7 +4,7 @@
|
||||
|
||||
--- src/sysctl.c
|
||||
+++ src/sysctl.c 2023-12-14 13:46:09.181625220 +0000
|
||||
@@ -772,6 +772,8 @@ static int Preload(SettingList *setlist,
|
||||
@@ -795,6 +795,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) {
|
||||
|
||||
@@ -3,25 +3,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\$"
|
||||
+++ testsuite/pmap.test/pmap.exp 2024-12-19 15:07:47.150871855 +0000
|
||||
@@ -74,31 +74,6 @@ if { [ file readable "/proc/self/smaps"
|
||||
}
|
||||
}
|
||||
|
||||
-
|
||||
-proc expect_twice_total { test } {
|
||||
- set totkb 0
|
||||
- expect {
|
||||
- -re "\r\n\\s+(\\d+)\[0-9 \]*KB" {
|
||||
- -re "\r\n\\s+(\\d+)\\s+.*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: first match" }
|
||||
- timeout { fail "$test: first match" }
|
||||
- }
|
||||
- }
|
||||
- eof { fail "$test" }
|
||||
- timeout { fail "$test" }
|
||||
- eof { fail "$test: second match" }
|
||||
- timeout { fail "$test: second match" }
|
||||
- }
|
||||
-}
|
||||
-
|
||||
|
||||
@@ -1,20 +0,0 @@
|
||||
Index: procps-ng-4.0.4/src/w.c
|
||||
===================================================================
|
||||
--- procps-ng-4.0.4.orig/src/w.c
|
||||
+++ procps-ng-4.0.4/src/w.c
|
||||
@@ -532,12 +532,14 @@ static void showinfo(
|
||||
char *sd_tty;
|
||||
|
||||
if (sd_session_get_tty(session, &sd_tty) >= 0) {
|
||||
- for (i = 0; i < strlen (sd_tty); i++)
|
||||
+ for (i = 0; i < UT_LINESIZE; i++) {
|
||||
+ if (sd_tty[i] == '\0') break;
|
||||
/* 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 {
|
||||
BIN
procps-ng-4.0.4.tar.xz
LFS
BIN
procps-ng-4.0.4.tar.xz
LFS
Binary file not shown.
@@ -1,16 +0,0 @@
|
||||
-----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-----
|
||||
36
procps-ng-4.0.5-bsc1246330.patch
Normal file
36
procps-ng-4.0.5-bsc1246330.patch
Normal file
@@ -0,0 +1,36 @@
|
||||
From edb4a8769c1edd99b7cf618fa1970325b7ecc55a Mon Sep 17 00:00:00 2001
|
||||
From: Jim Warner <james.warner@comcast.net>
|
||||
Date: Mon, 30 Dec 2024 00:00:00 -0600
|
||||
Subject: [PATCH] uptime: address the 'raw' option 32-bit overflow issue
|
||||
|
||||
Linux ensures that time_t is at least 64 bits, even on
|
||||
32 bit platforms, to prevent an overflow in year 2038.
|
||||
|
||||
This patch guarantees uptime won't negate that effort.
|
||||
|
||||
Reference(s):
|
||||
https://gitlab.com/procps-ng/procps/-/issues/362
|
||||
|
||||
Signed-off-by: Jim Warner <james.warner@comcast.net>
|
||||
---
|
||||
src/uptime.c | 4 ++--
|
||||
1 file changed, 2 insertions(+), 2 deletions(-)
|
||||
|
||||
diff --git a/src/uptime.c b/src/uptime.c
|
||||
index a38486b0..b35ebdae 100644
|
||||
--- src/uptime.c
|
||||
+++ src/uptime.c
|
||||
@@ -97,8 +97,8 @@ static void print_uptime_raw()
|
||||
if (procps_loadavg(&av1, &av5, &av15) < 0)
|
||||
xerrx(EXIT_FAILURE, "procps_loadavg");
|
||||
|
||||
- printf("%d %f %d %.2f %.2f %.2f\n",
|
||||
- (int)realseconds, uptime_secs, users, av1, av5, av15);
|
||||
+ printf("%lld %f %d %.2f %.2f %.2f\n",
|
||||
+ (long long)realseconds, uptime_secs, users, av1, av5, av15);
|
||||
}
|
||||
static void __attribute__ ((__noreturn__)) usage(FILE * out)
|
||||
{
|
||||
--
|
||||
GitLab
|
||||
|
||||
BIN
procps-ng-4.0.5.tar.xz
LFS
Normal file
BIN
procps-ng-4.0.5.tar.xz
LFS
Normal file
Binary file not shown.
16
procps-ng-4.0.5.tar.xz.asc
Normal file
16
procps-ng-4.0.5.tar.xz.asc
Normal file
@@ -0,0 +1,16 @@
|
||||
-----BEGIN PGP SIGNATURE-----
|
||||
|
||||
iQIzBAABCgAdFiEEXT3w9TizJ8CqeneiAiFmwP88hOMFAmdjdYkACgkQAiFmwP88
|
||||
hOPxWQ//R6nMJqzAAnN+dBycN0da5dvJVuYGi5lDk6iq34tur0iSaoF3MtOmAJNd
|
||||
Bn847Izg2U7tPyjKk3i4GlKEcW1QPP4j2Let8Jz+woHVfs0XwBpxKlwUYQC/psr+
|
||||
YbT6niNOlb0GZNI7SeaCtsFNNdj7F/rZmZJw/TGlpJdh69XQZxGW/WloxcIUI819
|
||||
pek7Nd0lwEQEY7TsvoXz47EdglVQ1+EIbS3dZoHTaRNQ8c2RZPhrRy8VLlDetmQH
|
||||
8OX1seCqtAYGUfScJxuAGjxwaV3grATHomyyPbMzTM5M5nxikRY6ZN7WBbk9iksK
|
||||
Se9KvP0HunwBMq65qIz3W//+qSkE4ceZMKhdyZAZs2dIRG52xT7WTnuqFzbzZ28t
|
||||
WeOzilk5CkPhgC4jVBJVbejh8bMqba+ok8LFZ3FJOUJgoc0AXZKN+gz1p5vv7MhK
|
||||
fLybX7h+kw5IAFVssL/I60BxyjL9Ow/td9eCh5XqdtmsQgxVspr4QAzcRw/KtX8U
|
||||
w2Qp2uMFh8X7q2az0m32inuNb7t6FvLpZlnEsKrAsoYSf3Z7ebTvpgTfbKrP5fQx
|
||||
Iskl2BTAPgH97nMPXciS+ApE7W2iUBSqzRIJXOJkbo/3E674bBmsV5EJevOu/9UX
|
||||
GdvZS5Uzs9UOcykiPsuycKfLzBin8+ig58bt1h9w4Qv4RWLydJ8=
|
||||
=6Y1I
|
||||
-----END PGP SIGNATURE-----
|
||||
@@ -4,7 +4,7 @@
|
||||
|
||||
--- 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){
|
||||
@@ -270,8 +270,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){
|
||||
@@ -407,6 +410,7 @@ static const char *set_personality(void)
|
||||
@@ -413,6 +416,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 */
|
||||
@@ -434,6 +438,7 @@ static const char *set_personality(void)
|
||||
@@ -440,6 +444,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";
|
||||
@@ -459,12 +464,14 @@ static const char *set_personality(void)
|
||||
@@ -465,12 +470,14 @@ static const char *set_personality(void)
|
||||
case_hp:
|
||||
case_hpux:
|
||||
personality = PER_HPUX_x;
|
||||
@@ -49,7 +49,7 @@
|
||||
return NULL;
|
||||
|
||||
case_posix:
|
||||
@@ -505,8 +512,8 @@ void reset_global(void){
|
||||
@@ -511,8 +518,8 @@ void reset_global(void){
|
||||
}
|
||||
// --- <pids> interface --------------------------------------------------
|
||||
|
||||
|
||||
@@ -4,19 +4,26 @@
|
||||
2 files changed, 14 insertions(+)
|
||||
|
||||
--- 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
|
||||
+++ man/sysctl.8 2024-09-24 07:44:00.717403660 +0000
|
||||
@@ -123,6 +123,7 @@ Display version information and exit.
|
||||
.TS
|
||||
Li.
|
||||
/proc/sys
|
||||
+/boot/sysctl.conf\-\fR<kernelversion>\fP
|
||||
/etc/sysctl.d/\fR*\fP.conf
|
||||
/run/sysctl.d/\fR*\fP.conf
|
||||
/usr/local/lib/sysctl.d/\fR*\fP.conf
|
||||
@@ -140,6 +141,7 @@ file of the same name in subsequent dire
|
||||
.P
|
||||
.TS
|
||||
Li.
|
||||
+/boot/sysctl.conf\-\fR<kernelversion>\fP
|
||||
/etc/sysctl.d/\fR*\fP.conf
|
||||
/run/sysctl.d/\fR*\fP.conf
|
||||
/usr/local/lib/sysctl.d/\fR*\fP.conf
|
||||
--- src/sysctl.c
|
||||
+++ src/sysctl.c 2022-03-29 10:20:51.795708321 +0000
|
||||
@@ -45,6 +45,7 @@
|
||||
+++ src/sysctl.c 2024-09-24 07:41:02.012637471 +0000
|
||||
@@ -46,6 +46,7 @@
|
||||
#include <string.h>
|
||||
#include <sys/stat.h>
|
||||
#include <sys/types.h>
|
||||
@@ -24,7 +31,7 @@
|
||||
#include <unistd.h>
|
||||
#include <ctype.h>
|
||||
|
||||
@@ -808,6 +809,7 @@ static int sortpairs(const void *A, cons
|
||||
@@ -831,6 +832,7 @@ static int sortpairs(const void *A, cons
|
||||
static int PreloadSystem(SettingList *setlist)
|
||||
{
|
||||
unsigned di, i;
|
||||
@@ -32,7 +39,7 @@
|
||||
const char *dirs[] = {
|
||||
"/etc/sysctl.d",
|
||||
"/run/sysctl.d",
|
||||
@@ -872,6 +874,16 @@ static int PreloadSystem(SettingList *se
|
||||
@@ -895,6 +897,16 @@ static int PreloadSystem(SettingList *se
|
||||
}
|
||||
qsort(cfgs, ncfgs, sizeof(struct cfg *), sortpairs);
|
||||
|
||||
|
||||
@@ -1,3 +1,92 @@
|
||||
-------------------------------------------------------------------
|
||||
Fri Jul 11 12:30:21 UTC 2025 - Dr. Werner Fink <werner@suse.de>
|
||||
|
||||
- Add patch procps-ng-4.0.5-bsc1246330.patch
|
||||
* Do not Fail in year 2038 (bsc#1246330)
|
||||
|
||||
-------------------------------------------------------------------
|
||||
Thu Dec 19 14:34:39 UTC 2024 - Dr. Werner Fink <werner@suse.de>
|
||||
|
||||
- Update to procps-ng-4.0.5
|
||||
* library
|
||||
increment current, revision and age to 0: 1:0:0
|
||||
internal: days/users when value is 0 issue #303
|
||||
internal: dont print 60s but increment minute issue #302
|
||||
internal: stat api fixed remaining cpu distortions issue #321
|
||||
internal: only count user sessions
|
||||
internal: Recover from meminfo seek using LXC Debian #1072831
|
||||
internal: stat api no longer counts guest tics twice issue #339
|
||||
external: zswap & zswapped added to meminfo api
|
||||
external: schedule class added to pids api
|
||||
external: disk sleep added to pids api, sleep revised issue #265
|
||||
external: docker containers added to pids api
|
||||
external: procps_users new exported function
|
||||
external: procps_uptime_snprint uses given upseconds
|
||||
external: procps_container_uptime
|
||||
external: meminfo api adds SecPageTables, Unaccepted
|
||||
external: pids api now provides open file descriptors
|
||||
external: 'info' parm removed from all 'VAL' macros issue #332
|
||||
external: Add procps_sigmask_names
|
||||
external: Add procps_capability_names
|
||||
external: Add PIDS_CAP__PRM Permitted Capabilities
|
||||
* build-sys: Added --disable-pidwait and fixed logic issue #352
|
||||
* kill: Correctly parse negative pids issue #354
|
||||
* pgrep: select process by environment variable issue #167
|
||||
* pgrep: Rework pidfile reading to include stdin issue #318
|
||||
* pmap: Don't escape correct UTF-8 characters
|
||||
* ps: Add environ field
|
||||
* ps: Add htprv and htshr fields for HugeTables
|
||||
* ps: restore lost tasks for options --sort with -H issue #304
|
||||
* ps: add 'docker' containers field, similar to 'lxc'
|
||||
* ps: Restore AIX free-format issue #323
|
||||
* ps: can display open file descriptors for each task
|
||||
* ps: Fix signames scanning issue #341
|
||||
* ps: Add -o pcap,pcaps to show permitted capabilities
|
||||
* ps: Zombies show <defunct> in the commandname issue #355
|
||||
* ps: Use quick mode if possible merge #239
|
||||
* slabtop: Add --human option for slab size
|
||||
* snice: Minor fix for help screen Debian #1086441
|
||||
* sysctl: Add glob excludes merge #206
|
||||
* sysctl: --all skips stat_refresh Debian #978688
|
||||
* top: added a 'CLS' scheduling class field, like ps
|
||||
* top: exploit library addition of 'disk sleep' issue #265
|
||||
* top: add 'docker' containers field, similar to 'lxc'
|
||||
* top: provides additional control over colors
|
||||
* top: can display open file descriptors for each task
|
||||
* top: corrected cpu % for hosts with qemu processes issue #339
|
||||
* top: remains functional if /proc mounted subset=pid
|
||||
* top: can display a task's permitted capabilities (^A)
|
||||
* uptime: Add container uptime option issue #300
|
||||
* vmstat: Add page allocation to --stats
|
||||
* vmstat.8: si/so are changed by --unit Debian #1061944
|
||||
* w: Don't segfault with -s option issue #301
|
||||
* w: Cache pids list issue #305
|
||||
* w: Add container uptime option
|
||||
* w.1: Note utmp is for non-systemd Debian #1080333
|
||||
* watch: use clock_gettime issue #295
|
||||
* watch.1: --chgexit only works for visible changes Debian #729569
|
||||
* hugetop: a new utility to show huge page information merge #214
|
||||
- Remove patches now upstream or fixed
|
||||
* 79042e07.patch
|
||||
* procps-ng-4.0.4-idletime-no-tty.patch
|
||||
* procps-ng-4.0.4-w-array-bounds.patch
|
||||
- Port patches
|
||||
* procps-ng-3.3.10-errno.patch
|
||||
* procps-ng-3.3.10-slab.patch
|
||||
* procps-ng-3.3.10-xen.dif
|
||||
* procps-ng-3.3.11-pmap4suse.patch
|
||||
* procps-ng-3.3.8-ignore-scan_unevictable_pages.patch
|
||||
* procps-ng-3.3.8-petabytes.patch
|
||||
* procps-ng-3.3.8-readeof.patch
|
||||
* procps-ng-3.3.8-tinfo.dif
|
||||
* procps-ng-3.3.8-vmstat-terabyte.dif
|
||||
* procps-ng-3.3.9-w-notruncate.diff
|
||||
* procps-ng-4.0.0-floats.dif
|
||||
* procps-ng-4.0.0-integer-overflow.patch
|
||||
* procps-ng-4.0.4-ignore-sysctl_conf.patch
|
||||
* procps-v3.3.3-columns.dif
|
||||
* procps-v3.3.3-read-sysctls-also-from-boot-sysctl.conf-kernelversion.diff
|
||||
|
||||
-------------------------------------------------------------------
|
||||
Wed Sep 4 08:18:44 UTC 2024 - Andreas Schwab <schwab@suse.de>
|
||||
|
||||
|
||||
20
procps.spec
20
procps.spec
@@ -1,7 +1,7 @@
|
||||
#
|
||||
# spec file for package procps
|
||||
#
|
||||
# Copyright (c) 2024 SUSE LLC
|
||||
# Copyright (c) 2025 SUSE LLC
|
||||
#
|
||||
# All modifications and additions to the file contributed by third parties
|
||||
# remain the property of their copyright owners, unless otherwise agreed
|
||||
@@ -16,7 +16,7 @@
|
||||
#
|
||||
|
||||
|
||||
%define somajor 0
|
||||
%define somajor 1
|
||||
%define libname libproc2-%{somajor}
|
||||
%if 0%{?suse_version} < 1550
|
||||
%bcond_with bin2usr
|
||||
@@ -26,7 +26,7 @@
|
||||
%bcond_without pidof
|
||||
%bcond_without nls
|
||||
Name: procps
|
||||
Version: 4.0.4
|
||||
Version: 4.0.5
|
||||
Release: 0
|
||||
Summary: The ps utilities for /proc
|
||||
License: GPL-2.0-or-later AND LGPL-2.1-or-later
|
||||
@@ -38,8 +38,8 @@ Source1: https://downloads.sourceforge.net/project/procps-ng/Production/p
|
||||
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
|
||||
Patch2: procps-ng-4.0.5-bsc1246330.patch
|
||||
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
|
||||
@@ -64,8 +64,6 @@ Patch37: procps-ng-4.0.0-floats.dif
|
||||
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
|
||||
Patch40: procps-ng-4.0.4-idletime-no-tty.patch
|
||||
Patch41: procps-ng-4.0.4-w-array-bounds.patch
|
||||
BuildRequires: automake
|
||||
BuildRequires: dejagnu
|
||||
BuildRequires: diffutils
|
||||
@@ -135,8 +133,8 @@ the process information pseudo-file system.
|
||||
|
||||
%prep
|
||||
%setup -q -n procps-ng-%{version}
|
||||
%patch -P0 -p1
|
||||
%patch -P1
|
||||
%patch -P2
|
||||
%patch -P3 -p1 -b .trcate
|
||||
%patch -P7 -b .rof
|
||||
%patch -P8 -b .cache
|
||||
@@ -152,10 +150,8 @@ the process information pseudo-file system.
|
||||
%patch -P32 -b .p32
|
||||
%patch -P33 -b .pmap4us
|
||||
%patch -P37
|
||||
%patch -P38
|
||||
%patch -P38 -b .p38
|
||||
%patch -P39
|
||||
%patch -P40 -p1
|
||||
%patch -P41 -p1
|
||||
|
||||
%build
|
||||
test -s .tarball-version || echo %{version} > .tarball-version
|
||||
@@ -379,7 +375,7 @@ test $error = no || exit 1
|
||||
%{_bindir}/slabtop
|
||||
%{_bindir}/snice
|
||||
%{_bindir}/tload
|
||||
%{_bindir}/top
|
||||
%{_bindir}/*top
|
||||
%{_bindir}/vmstat
|
||||
%{_bindir}/w
|
||||
%{_bindir}/watch
|
||||
@@ -397,7 +393,7 @@ test $error = no || exit 1
|
||||
%{_mandir}/man1/slabtop.1%{?ext_man}
|
||||
%{_mandir}/man1/snice.1%{?ext_man}
|
||||
%{_mandir}/man1/tload.1%{?ext_man}
|
||||
%{_mandir}/man1/top.1%{?ext_man}
|
||||
%{_mandir}/man1/*top.1%{?ext_man}
|
||||
%{_mandir}/man1/w.1%{?ext_man}
|
||||
%{_mandir}/man1/watch.1%{?ext_man}
|
||||
%{_mandir}/man5/sysctl.conf.5%{?ext_man}
|
||||
|
||||
Reference in New Issue
Block a user