Sync from SUSE:SLFO:Main procps revision c166606ef52a86cd40058afc2b62fca3

This commit is contained in:
Adrian Schröter 2024-10-03 17:50:19 +02:00
parent fb2f19b539
commit 1e028cfdb0
4 changed files with 46 additions and 0 deletions

View File

@ -0,0 +1,16 @@
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) {

View File

@ -0,0 +1,20 @@
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 {

View File

@ -1,3 +1,9 @@
-------------------------------------------------------------------
Wed Sep 4 08:18:44 UTC 2024 - Andreas Schwab <schwab@suse.de>
- procps-ng-4.0.4-idletime-no-tty.patch: don't print idle time without tty
- procps-ng-4.0.4-w-array-bounds.patch: fix array bounds violation
-------------------------------------------------------------------
Tue Jul 30 07:14:45 UTC 2024 - Dominique Leuenberger <dimstar@opensuse.org>

View File

@ -64,6 +64,8 @@ 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
@ -152,6 +154,8 @@ the process information pseudo-file system.
%patch -P37
%patch -P38
%patch -P39
%patch -P40 -p1
%patch -P41 -p1
%build
test -s .tarball-version || echo %{version} > .tarball-version