Projects
openEuler:22.03:LTS:LoongArch
psmisc
Sign Up
Log In
Username
Password
Overview
Repositories
Revisions
Requests
Users
Attributes
Meta
Expand all
Collapse all
Changes of Revision 4
View file
_service:tar_scm_kernel_repo:psmisc.spec
Changed
@@ -1,10 +1,13 @@ Name: psmisc Version: 23.4 -Release: 1 +Release: 2 Summary: Utilities for managing processes on your system License: GPLv2+ URL: https://gitlab.com/psmisc/psmisc Source0: https://sourceforge.net/projects/%{name}/files/%{name}/%{name}-%{version}.tar.xz + +Patch6000: backport-patch-fix-checking-truncated-process-names.patch + BuildRequires: libselinux-devel gettext ncurses-devel autoconf automake gcc %description @@ -33,6 +36,9 @@ %doc AUTHORS ChangeLog README %changelog +* Thu Aug 11 2022 liutie <liutie4@huawei.com> - 23.4-2 +- Fix checking truncated process names + * Wed Dec 22 2021 zhouwenpei <zhouwenpei1@huawei.com> - 23.4-1 - upgrade to 23.4
View file
_service:tar_scm_kernel_repo:backport-patch-fix-checking-truncated-process-names.patch
Added
@@ -0,0 +1,85 @@ +From fb2a412e086be7169e42b7169292c35f9e3063ce Mon Sep 17 00:00:00 2001 +From: cielavenir <cielartisan@gmail.com> +Date: Fri, 9 Jul 2021 14:27:30 +0900 +Subject: [PATCH 1/2] killall: call load_proc_cmdline if the length is + OLD_COMM_LEN-1 as well + +--- + src/killall.c | 9 +++++---- + 1 file changed, 5 insertions(+), 4 deletions(-) + +diff --git a/src/killall.c b/src/killall.c +index 9fab8f5..645aaa1 100644 +--- a/src/killall.c ++++ b/src/killall.c +@@ -426,7 +426,7 @@ load_process_name_and_age(char *comm, double *process_age_sec, + } + + static int +-load_proc_cmdline(const pid_t pid, const char *comm, char **command, int *got_long) ++load_proc_cmdline(const pid_t pid, const char *comm, const int check_comm_length, char **command, int *got_long) + { + FILE *file; + char *path, *p, *command_buf; +@@ -482,7 +482,7 @@ load_proc_cmdline(const pid_t pid, const char *comm, char **command, int *got_lo + } + p = strrchr(command_buf,'/'); + p = p ? p+1 : command_buf; +- if (strncmp(p, comm, COMM_LEN-1) == 0) { ++ if (strncmp(p, comm, check_comm_length) == 0) { + okay = 1; + if (!(*command = strdup(p))) { + free(command_buf); +@@ -664,8 +664,9 @@ kill_all(int signal, int name_count, char **namelist, struct passwd *pwent, + free(command); + command = NULL; + } +- if (length == COMM_LEN - 1) +- if (load_proc_cmdline(pid_table[i], comm, &command, &got_long) < 0) ++ ++ if (length == COMM_LEN - 1 || length == OLD_COMM_LEN - 1) ++ if (load_proc_cmdline(pid_table[i], comm, length, &command, &got_long) < 0) + continue; + + /* match by process name */ +-- +GitLab + + +From 43af55f4c4e5972a1354c6cafeca85ecd38dc122 Mon Sep 17 00:00:00 2001 +From: cielavenir <cielartisan@gmail.com> +Date: Fri, 9 Jul 2021 14:30:37 +0900 +Subject: [PATCH 2/2] killall: match_process_name comparision with got_long + should be full-length + +--- + src/killall.c | 6 ++---- + 1 file changed, 2 insertions(+), 4 deletions(-) + +diff --git a/src/killall.c b/src/killall.c +index 645aaa1..7bfb9a9 100644 +--- a/src/killall.c ++++ b/src/killall.c +@@ -564,8 +564,7 @@ static int match_process_name( + { + if (got_long) + { +- return (0 == strncmp2 (match_name, proc_cmdline, OLD_COMM_LEN - 1, +- ignore_case)); ++ return (0 == strcmp2 (match_name, proc_cmdline, ignore_case)); + } else { + return (0 == strncmp2 (match_name, proc_comm, OLD_COMM_LEN - 1, + ignore_case)); +@@ -576,8 +575,7 @@ static int match_process_name( + { + if (got_long) + { +- return (0 == strncmp2 (match_name, proc_cmdline, COMM_LEN - 1, +- ignore_case)); ++ return (0 == strcmp2 (match_name, proc_cmdline, ignore_case)); + } else { + return (0 == strncmp2 (match_name, proc_comm, COMM_LEN - 1, + ignore_case)); +-- +GitLab +
Locations
Projects
Search
Status Monitor
Help
Open Build Service
OBS Manuals
API Documentation
OBS Portal
Reporting a Bug
Contact
Mailing List
Forums
Chat (IRC)
Twitter
Open Build Service (OBS)
is an
openSUSE project
.