diff --git a/procps-ng-4.0.4-idletime-no-tty.patch b/procps-ng-4.0.4-idletime-no-tty.patch new file mode 100644 index 0000000..1ce49f6 --- /dev/null +++ b/procps-ng-4.0.4-idletime-no-tty.patch @@ -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) { diff --git a/procps-ng-4.0.4-w-array-bounds.patch b/procps-ng-4.0.4-w-array-bounds.patch new file mode 100644 index 0000000..0462d77 --- /dev/null +++ b/procps-ng-4.0.4-w-array-bounds.patch @@ -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 { diff --git a/procps.changes b/procps.changes index 87fd05e..f4f4dc8 100644 --- a/procps.changes +++ b/procps.changes @@ -1,3 +1,9 @@ +------------------------------------------------------------------- +Wed Sep 4 08:18:44 UTC 2024 - Andreas Schwab + +- 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 diff --git a/procps.spec b/procps.spec index eac3417..71cff3d 100644 --- a/procps.spec +++ b/procps.spec @@ -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