update to new upstream version

This commit is contained in:
Jan Görig 2010-05-25 12:47:24 +00:00
parent aca91c4a41
commit 35761a63a1
7 changed files with 12 additions and 190 deletions

View File

@ -1 +1 @@
psmisc-22.6.tar.gz psmisc-22.10.tar.gz

View File

@ -1,131 +0,0 @@
diff -ru psmisc-22.6.org/src/fuser.c psmisc-22.6/src/fuser.c
--- psmisc-22.6.org/src/fuser.c 2009-01-23 19:24:11.000000000 +0200
+++ psmisc-22.6/src/fuser.c 2009-01-23 19:28:43.000000000 +0200
@@ -69,7 +69,6 @@
int parse_mount(struct names *this_name, struct device_list **dev_list);
static void add_device(struct device_list **dev_list, struct names *this_name, dev_t device);
-void scan_mount_devices(const opt_type opts, struct mountdev_list **mount_devices);
void fill_unix_cache(struct unixsocket_list **unixsocket_head);
static dev_t find_net_dev(void);
static void scan_procs(struct names *names_head, struct inode_list *ino_head, struct device_list *dev_head);
@@ -365,10 +364,9 @@
return 0;
}
-int parse_mounts(struct names *this_name, struct mountdev_list *mounts, struct device_list **dev_list, const char opts)
+int parse_mounts(struct names *this_name, struct device_list **dev_list, const char opts)
{
struct stat st;
- struct mountdev_list *mountptr;
dev_t match_device;
if (stat(this_name->filename, &st) != 0) {
@@ -380,13 +378,7 @@
match_device = st.st_rdev;
else
match_device = st.st_dev;
- for (mountptr = mounts ; mountptr != NULL ; mountptr = mountptr->next) {
- if (mountptr->device == match_device) {
- /*printf("Debug: adding parse_mounts() adding %s\n",
- this_name->filename);*/
- add_device(dev_list, this_name, match_device);
- }
- }
+ add_device(dev_list, this_name, match_device);
return 0;
}
@@ -660,7 +652,6 @@
int ipv4_only, ipv6_only;
#endif
unsigned char default_namespace = NAMESPACE_FILE;
- struct mountdev_list *mount_devices = NULL;
struct device_list *match_devices = NULL;
struct unixsocket_list *unixsockets = NULL;
@@ -692,7 +683,6 @@
#endif
netdev = find_net_dev();
- scan_mount_devices(opts, &mount_devices);
fill_unix_cache(&unixsockets);
/* getopt doesnt like things like -SIGBLAH */
@@ -831,7 +821,7 @@
parse_file(this_name, &match_inodes);
parse_unixsockets(this_name, &match_inodes, unixsockets);
if (opts & OPT_MOUNTPOINT || opts & OPT_MOUNTS)
- parse_mounts(this_name, mount_devices, &match_devices, opts);
+ parse_mounts(this_name, &match_devices, opts);
break;
}
@@ -1082,20 +1072,6 @@
return st.st_uid;
}
-void add_mount_device(struct mountdev_list **mount_head,const char *fsname, const char *dir, dev_t device)
-{
- struct mountdev_list *newmount;
- /*printf("Adding mount Path: %s Dir:%s dev:%0x\n",dir, fsname, device);*/
-
- if ( (newmount = malloc(sizeof(struct mountdev_list))) == NULL)
- return;
- newmount->fsname = strdup(fsname);
- newmount->dir = strdup(dir);
- newmount->device = device;
- newmount->next = *mount_head;
- *mount_head = newmount;
-}
-
/*
* fill_unix_cache : Create a list of Unix sockets
* This list is used later for matching purposes
@@ -1135,28 +1111,6 @@
}
-/*
- * scan_mount_devices : Create a list of mount points and devices
- * This list is used later for matching purposes
- */
-void scan_mount_devices(const opt_type opts, struct mountdev_list **mount_devices)
-{
- FILE *mntfp;
- struct mntent *mnt_ptr;
- struct stat st;
-
- if ( (mntfp = setmntent("/etc/mtab","r")) == NULL) {
- fprintf(stderr, _("Cannot open /etc/mtab: %s\n"),
- strerror(errno));
- return;
- }
- while ( (mnt_ptr = getmntent(mntfp)) != NULL) {
- if (stat(mnt_ptr->mnt_dir, &st) == 0) {
- add_mount_device(mount_devices, mnt_ptr->mnt_fsname, mnt_ptr->mnt_dir, st.st_dev);
- }
- }
-}
-
#ifdef DEBUG
/* often not used, doesnt need translation */
static void debug_match_lists(struct names *names_head, struct inode_list *ino_head, struct device_list *dev_head)
diff -ru psmisc-22.6.org/src/fuser.h psmisc-22.6/src/fuser.h
--- psmisc-22.6.org/src/fuser.h 2009-01-23 19:24:11.000000000 +0200
+++ psmisc-22.6/src/fuser.h 2009-01-23 19:29:48.000000000 +0200
@@ -58,14 +58,6 @@
struct inode_list *next;
};
-struct mountdev_list {
- char *fsname;
- char *dir;
- dev_t device;
- struct mountdev_list *next;
-};
-
-
struct device_list {
struct names *name;
dev_t device;

View File

@ -1,20 +0,0 @@
Fix an off-by overflow one that would trigger a FORTIFY_SOURCE abort.
Lubomir Rintel <lkundrak@v3.sk>
diff -up psmisc-22.6/src/pstree.c.overflow2 psmisc-22.6/src/pstree.c
--- psmisc-22.6/src/pstree.c.overflow2 2009-08-05 01:38:32.000000000 +0200
+++ psmisc-22.6/src/pstree.c 2009-08-05 01:45:09.000000000 +0200
@@ -641,10 +641,10 @@ read_proc (void)
if ((taskdir=opendir(taskpath))!=0) {
/* if we have this dir, we're on 2.6 */
- if (!(threadname = malloc(strlen(comm) + 3))) {
+ if (!(threadname = malloc(COMM_LEN + 1))) {
exit (2);
}
- sprintf(threadname,"{%s}",comm);
+ sprintf(threadname,"{%.*s}", COMM_LEN - 2, comm);
while ((dt = readdir(taskdir)) != NULL) {
if ((thread=atoi(dt->d_name)) !=0) {
if (thread != pid) {

View File

@ -1,11 +0,0 @@
diff -up psmisc-22.6/src/pstree.c.overflow psmisc-22.6/src/pstree.c
--- psmisc-22.6/src/pstree.c.overflow 2008-04-14 12:53:07.000000000 +0200
+++ psmisc-22.6/src/pstree.c 2008-04-14 13:05:51.000000000 +0200
@@ -608,6 +608,7 @@ read_proc (void)
perror (path);
exit (1);
}
+ memset(readbuf, '\0', BUFSIZ + 1);
fread(readbuf, BUFSIZ, 1, file) ;
if (ferror(file) == 0)
{

View File

@ -1,14 +0,0 @@
diff -up psmisc-22.6/src/fuser.c.twoerr psmisc-22.6/src/fuser.c
--- psmisc-22.6/src/fuser.c.twoerr 2010-05-05 13:41:01.000000000 +0200
+++ psmisc-22.6/src/fuser.c 2010-05-05 13:43:01.000000000 +0200
@@ -818,8 +818,8 @@ int main(int argc, char *argv[])
break;
default: /* FILE */
this_name->filename = strdup(argv[optc]);
- parse_file(this_name, &match_inodes);
- parse_unixsockets(this_name, &match_inodes, unixsockets);
+ if( parse_file(this_name, &match_inodes) == 0 )
+ parse_unixsockets(this_name, &match_inodes, unixsockets);
if (opts & OPT_MOUNTPOINT || opts & OPT_MOUNTS)
parse_mounts(this_name, &match_devices, opts);
break;

View File

@ -1,7 +1,7 @@
Summary: Utilities for managing processes on your system Summary: Utilities for managing processes on your system
Name: psmisc Name: psmisc
Version: 22.6 Version: 22.10
Release: 14%{?dist} Release: 1%{?dist}
License: GPLv2+ License: GPLv2+
Group: Applications/System Group: Applications/System
Source: http://downloads.sourceforge.net/%{name}/%{name}-%{version}.tar.gz Source: http://downloads.sourceforge.net/%{name}/%{name}-%{version}.tar.gz
@ -10,12 +10,6 @@ Buildroot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
#fix configure.ac to include all the required headers for peekfd #fix configure.ac to include all the required headers for peekfd
Patch0: psmisc-22.6-types.patch Patch0: psmisc-22.6-types.patch
#fix #441871
Patch1: psmisc-22.6-pstree-overflow.patch
#fix #497303
Patch2: psmisc-22.6-fuser-remove-mountlist.patch
Patch3: psmisc-22.6-overflow2.patch
Patch4: psmisc-22.6-twoerr.patch
BuildRequires: libselinux-devel BuildRequires: libselinux-devel
BuildRequires: gettext BuildRequires: gettext
@ -33,10 +27,6 @@ of processes that are using specified files or filesystems.
%prep %prep
%setup -q %setup -q
%patch0 -p1 -b .types %patch0 -p1 -b .types
%patch1 -p1 -b .overflow
%patch2 -p1 -b .mount
%patch3 -p1 -b .overflow2
%patch4 -p1 -b .twoerr
%build %build
export CFLAGS="$RPM_OPT_FLAGS -D_GNU_SOURCE" export CFLAGS="$RPM_OPT_FLAGS -D_GNU_SOURCE"
@ -68,15 +58,23 @@ rm -rf $RPM_BUILD_ROOT
%{_bindir}/killall %{_bindir}/killall
%{_bindir}/pstree %{_bindir}/pstree
%{_bindir}/pstree.x11 %{_bindir}/pstree.x11
%{_bindir}/prtstat
%{_mandir}/man1/fuser.1* %{_mandir}/man1/fuser.1*
%{_mandir}/man1/killall.1* %{_mandir}/man1/killall.1*
%{_mandir}/man1/pstree.1* %{_mandir}/man1/pstree.1*
%{_mandir}/man1/prtstat.1*
%ifarch %ix86 x86_64 ppc ppc64 %ifarch %ix86 x86_64 ppc ppc64
%{_bindir}/peekfd %{_bindir}/peekfd
%{_mandir}/man1/peekfd.1* %{_mandir}/man1/peekfd.1*
%endif %endif
%doc AUTHORS ChangeLog COPYING README
%changelog %changelog
* Mon May 25 2010 Jan Görig <jgorig@redhat.com> 22.10-1
- update to new upstream version
- remove unused patches
- docs are now in package
* Tue May 18 2010 Daniel Novotny <dnovotny@redhat.com> 22.6-14 * Tue May 18 2010 Daniel Novotny <dnovotny@redhat.com> 22.6-14
- fix #588322 - fuser'ing a non-existent file yields two error messages - fix #588322 - fuser'ing a non-existent file yields two error messages

View File

@ -1 +1 @@
2e81938855cf5cc38856bd4a31d79a4c psmisc-22.6.tar.gz e881383e7f399121cd0ce744f97d91a5 psmisc-22.10.tar.gz