packages: psmisc/psmisc.spec, psmisc/psmisc-commlen.patch (NEW)=?UTF-8?Q?=20?=- rel 2; fi...

arekm arekm at pld-linux.org
Sat Feb 11 09:05:09 CET 2012


Author: arekm                        Date: Sat Feb 11 08:05:09 2012 GMT
Module: packages                      Tag: HEAD
---- Log message:
- rel 2; fix pstree abort

---- Files affected:
packages/psmisc:
   psmisc.spec (1.104 -> 1.105) , psmisc-commlen.patch (NONE -> 1.1)  (NEW)

---- Diffs:

================================================================
Index: packages/psmisc/psmisc.spec
diff -u packages/psmisc/psmisc.spec:1.104 packages/psmisc/psmisc.spec:1.105
--- packages/psmisc/psmisc.spec:1.104	Sun Jan 29 14:45:12 2012
+++ packages/psmisc/psmisc.spec	Sat Feb 11 09:05:04 2012
@@ -15,7 +15,7 @@
 Summary(uk.UTF-8):	Утиліти роботи з процесами
 Name:		psmisc
 Version:	22.15
-Release:	1
+Release:	2
 License:	GPL v2+
 Group:		Applications/System
 Source0:	http://downloads.sourceforge.net/psmisc/%{name}-%{version}.tar.gz
@@ -23,6 +23,7 @@
 Source1:	http://www.mif.pg.gda.pl/homepages/ankry/man-PLD/%{name}-non-english-man-pages.tar.bz2
 # Source1-md5:	9add7665e440bbd6b0b4f9293ba8b86d
 Patch0:		%{name}-pl.po-update.patch
+Patch1:		psmisc-commlen.patch
 URL:		http://psmisc.sourceforge.net/
 BuildRequires:	autoconf >= 2.61
 BuildRequires:	automake >= 1:1.10
@@ -89,6 +90,7 @@
 %prep
 %setup -q
 %patch0 -p1
+%patch1 -p1
 
 %build
 %{__gettextize}
@@ -144,6 +146,9 @@
 All persons listed below can be reached at <cvs_login>@pld-linux.org
 
 $Log$
+Revision 1.105  2012/02/11 08:05:04  arekm
+- rel 2; fix pstree abort
+
 Revision 1.104  2012/01/29 13:45:12  adamg
 - updated to 22.15
 

================================================================
Index: packages/psmisc/psmisc-commlen.patch
diff -u /dev/null packages/psmisc/psmisc-commlen.patch:1.1
--- /dev/null	Sat Feb 11 09:05:09 2012
+++ packages/psmisc/psmisc-commlen.patch	Sat Feb 11 09:05:04 2012
@@ -0,0 +1,89 @@
+From 340f81524cb097d814fcf344a3743de17f988e3d Mon Sep 17 00:00:00 2001
+From: Craig Small <csmall at users.sourceforge.net>
+Date: Fri, 27 Jan 2012 12:02:48 +1100
+Subject: [PATCH] Set COMM_LEN to 18 to include brackets in name
+
+Also use strncpy in case the command names grow.
+---
+ src/comm.h   |   41 ++++++++++++++++++++++++++++++-----------
+ src/pstree.c |    4 ++--
+ 2 files changed, 32 insertions(+), 13 deletions(-)
+
+diff --git a/src/comm.h b/src/comm.h
+index 956383d..2b780b0 100644
+--- a/src/comm.h
++++ b/src/comm.h
+@@ -1,18 +1,37 @@
+-/* comm.h - command name length definition */
+-
+-/* Copyright 1995 Werner Almesberger. See file COPYING for details. */
+-
++/*
++ * comm.h - command name length definition 
++ *
++ * Copyright 1995 Werner Almesberger
++ * Copyright 2012 Craig Small <csmall at enc.com.au>
++ *
++ *
++ * This program is free software; you can redistribute it and/or modify
++ * it under the terms of the GNU General Public License as published by
++ * the Free Software Foundation; either version 2 of the License, or
++ * (at your option) any later version.
++ *
++ * This program is distributed in the hope that it will be useful,
++ * but WITHOUT ANY WARRANTY; without even the implied warranty of
++ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
++ * GNU General Public License for more details.
++ *
++ * You should have received a copy of the GNU General Public License
++ * along with this program; if not, write to the Free Software
++ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
++ */
+ 
+ #ifndef COMM_H
+ #define COMM_H
+ 
+-#if 0				/* broken in 1.3.xx */
+-#include <linux/sched.h>
+-#define COMM_LEN sizeof(dummy.comm)
+-extern struct task_struct dummy;
+-#else
+-#define COMM_LEN 16		/* synchronize with size of comm in struct task_struct in
+-				   /usr/include/linux/sched.h */
++#ifdef HAVE_CONFIG_H
++#include <config.h>
+ #endif
+ 
++/*
++ * COMM_LEN should be the same size as TASK_COMM_LEN in the Linux source
++ * at include/linux/sched.h
++ * However, that doesn't include the brackets that may be in the field.
++ */
++#define COMM_LEN 18
++
+ #endif
+diff --git a/src/pstree.c b/src/pstree.c
+index 452f823..3129f76 100644
+--- a/src/pstree.c
++++ b/src/pstree.c
+@@ -264,7 +264,7 @@ static PROC *new_proc(const char *comm, pid_t pid, uid_t uid)
+         perror("malloc");
+         exit(1);
+     }
+-    strcpy(new->comm, comm);
++    strncpy(new->comm, comm, COMM_LEN);
+     new->pid = pid;
+     new->uid = uid;
+     new->flags = 0;
+@@ -352,7 +352,7 @@ add_proc(const char *comm, pid_t pid, pid_t ppid, uid_t uid,
+         this = new_proc(comm, pid, uid);
+ #endif                                /*WITH_SELINUX */
+     else {
+-        strcpy(this->comm, comm);
++        strncpy(this->comm, comm, COMM_LEN);
+         this->uid = uid;
+     }
+     if (args)
+-- 
+1.7.4.1
+
================================================================

---- CVS-web:
    http://cvs.pld-linux.org/cgi-bin/cvsweb.cgi/packages/psmisc/psmisc.spec?r1=1.104&r2=1.105&f=u



More information about the pld-cvs-commit mailing list