diff options
author | root <root@rshg054.dnsready.net> | 2012-02-07 23:15:14 +0000 |
---|---|---|
committer | root <root@rshg054.dnsready.net> | 2012-02-07 23:15:14 +0000 |
commit | 0dee03071a0643c3ee5820afa3c694dcef71d385 (patch) | |
tree | 2aa6cbee930040086600726e496a2bd87ec41ba8 /core/psmisc | |
parent | 1fa6edfba8d1e31ca1c0d59e8202cd3c62ccf393 (diff) |
Tue Feb 7 23:15:14 UTC 2012
Diffstat (limited to 'core/psmisc')
-rw-r--r-- | core/psmisc/COMM_LEN-to-18.patch | 85 | ||||
-rw-r--r-- | core/psmisc/PKGBUILD | 13 |
2 files changed, 92 insertions, 6 deletions
diff --git a/core/psmisc/COMM_LEN-to-18.patch b/core/psmisc/COMM_LEN-to-18.patch new file mode 100644 index 000000000..5cec62507 --- /dev/null +++ b/core/psmisc/COMM_LEN-to-18.patch @@ -0,0 +1,85 @@ +From: Craig Small <csmall@users.sourceforge.net> +Date: Fri, 27 Jan 2012 01:02:48 +0000 (+1100) +Subject: Set COMM_LEN to 18 to include brackets in name +X-Git-Url: http://psmisc.git.sourceforge.net/git/gitweb.cgi?p=psmisc%2Fpsmisc;a=commitdiff_plain;h=340f81524cb097d814fcf344a3743de17f988e3d + +Set COMM_LEN to 18 to include brackets in name + +Also use strncpy in case the command names grow. +--- + +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@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) diff --git a/core/psmisc/PKGBUILD b/core/psmisc/PKGBUILD index 1783c528a..2c49aec49 100644 --- a/core/psmisc/PKGBUILD +++ b/core/psmisc/PKGBUILD @@ -1,21 +1,22 @@ -# $Id: PKGBUILD 128514 2011-06-24 07:34:22Z eric $ +# $Id: PKGBUILD 149213 2012-02-06 11:42:36Z eric $ # Maintainer: Eric BĂ©langer <eric@archlinux.org> pkgname=psmisc -pkgver=22.14 +pkgver=22.15 pkgrel=1 pkgdesc="Miscellaneous procfs tools" arch=('i686' 'x86_64') url="http://psmisc.sourceforge.net/index.html" license=('GPL') groups=('base') -depends=('glibc' 'ncurses') -source=(http://downloads.sourceforge.net/psmisc/${pkgname}-${pkgver}.tar.gz) -md5sums=('ba3f4e971895c92bba7770d81c981503') -sha1sums=('dc6fc0ec131c11796d01512bbd80089719b04a66') +depends=('ncurses') +source=(http://downloads.sourceforge.net/psmisc/${pkgname}-${pkgver}.tar.gz COMM_LEN-to-18.patch) +sha1sums=('06f507d889afab70ac7ff20fbd419ca2ffcf90c0' + '6f45338fc34e453bea5273691a0cf81ed3e20fb8') build() { cd "${srcdir}/${pkgname}-${pkgver}" + patch -p1 -i ../COMM_LEN-to-18.patch ./configure --prefix=/usr make } |