From 3d414e218cc536c29be6138a3d24cb1fc5fedade Mon Sep 17 00:00:00 2001 From: OBS User autobuild Date: Mon, 12 Oct 2009 14:47:10 +0000 Subject: [PATCH] checked in OBS-URL: https://build.opensuse.org/package/show/Base:System/psmisc?expand=0&rev=10 --- psmisc-22.7-nfs4fuser.patch | 75 +++++++----------------------- psmisc-22.8-to-22.7-backport.patch | 12 ----- psmisc.changes | 11 ----- psmisc.spec | 2 - 4 files changed, 16 insertions(+), 84 deletions(-) delete mode 100644 psmisc-22.8-to-22.7-backport.patch diff --git a/psmisc-22.7-nfs4fuser.patch b/psmisc-22.7-nfs4fuser.patch index b148186..32326a4 100644 --- a/psmisc-22.7-nfs4fuser.patch +++ b/psmisc-22.7-nfs4fuser.patch @@ -33,7 +33,7 @@ cannot report on any processes that it doesn't have permission to look at the file descriptor table for. The most common time this problem occurs --- src/fuser.c -+++ src/fuser.c 2009-10-09 18:43:54.839930561 +0200 ++++ src/fuser.c 2009-05-11 13:45:16.565902120 +0200 @@ -32,9 +32,11 @@ #include #include @@ -85,15 +85,6 @@ static void usage (const char *errormsg) { -@@ -92,7 +102,7 @@ static void usage (const char *errormsg) - " fuser -V\n" - "Show which processes use the named files, sockets, or filesystems.\n\n" - " -a display unused files too\n" -- " -c Same as \-m (for POSIX compatibility)\n" -+ " -c Same as -m (for POSIX compatibility)\n" - " -f silently ignored (for POSIX compatibility)\n" - " -i ask before killing (ignored without -k)\n" - " -k kill processes accessing the named file\n" @@ -127,7 +137,14 @@ void print_version() "For more information about these matters, see the files named COPYING.\n")); } @@ -495,41 +486,25 @@ if (stat(pathname, st) != 0) return NULL; else -@@ -1030,6 +1262,16 @@ static void check_dir(const pid_t pid, c +@@ -1030,6 +1262,8 @@ static void check_dir(const pid_t pid, c } } for (dev_tmp = dev_head ; dev_tmp != NULL ; dev_tmp = dev_tmp->next) { -+ if (dev_tmp->name->name_space & NAMESPACE_NFS) { -+ char buf[PATH_MAX+1]; -+ ssize_t len; -+ if ((len = readlink(filepath, buf, PATH_MAX)) < 0) -+ continue; -+ buf[len] = '\0'; /* Don't be fooled by readlink(2) */ -+ if (islocatedon(buf, dev_tmp->name->filename)) -+ add_matched_proc(dev_tmp->name, pid,uid, access); ++ if (dev_tmp->name->name_space & NAMESPACE_NFS) + continue; -+ } if (st.st_dev == dev_tmp->device) { if (access == ACCESS_FILE && (lstat(filepath, &lst)==0) && (lst.st_mode & S_IWUSR)) { add_matched_proc(dev_tmp->name, pid,uid, ACCESS_FILEWR|access); -@@ -1039,6 +1281,16 @@ static void check_dir(const pid_t pid, c +@@ -1039,6 +1273,8 @@ static void check_dir(const pid_t pid, c } } for (ino_tmp = ino_head ; ino_tmp != NULL ; ino_tmp = ino_tmp->next) { -+ if (ino_tmp->name->name_space & NAMESPACE_NFS) { -+ char buf[PATH_MAX+1]; -+ ssize_t len; -+ if ((len = readlink(filepath, buf, PATH_MAX)) < 0) -+ continue; -+ buf[len] = '\0'; /* Don't be fooled by readlink(2) */ -+ if (islocatedon(buf, ino_tmp->name->filename)) -+ add_matched_proc(ino_tmp->name, pid,uid, access); ++ if (ino_tmp->name->name_space & NAMESPACE_NFS) + continue; -+ } if (st.st_dev == ino_tmp->device && st.st_ino == ino_tmp->inode) { if (access == ACCESS_FILE && (lstat(filepath, &lst)==0) && (lst.st_mode & S_IWUSR)) { add_matched_proc(ino_tmp->name, pid,uid, ACCESS_FILEWR|access); -@@ -1050,6 +1302,8 @@ static void check_dir(const pid_t pid, c +@@ -1050,6 +1286,8 @@ static void check_dir(const pid_t pid, c } } /* while fd_dent */ closedir(dirp); @@ -538,46 +513,28 @@ } static void check_map(const pid_t pid, const char *filename, struct device_list *dev_head, struct inode_list *ino_head, const uid_t uid, const char access) -@@ -1069,13 +1323,36 @@ static void check_map(const pid_t pid, c - while (fgets(line,BUFSIZ, fp)) { +@@ -1070,12 +1308,18 @@ static void check_map(const pid_t pid, c if (sscanf(line, "%*s %*s %*s %x:%x %lld", &tmp_maj, &tmp_min, &tmp_inode) == 3) { -+ const char * filepath = strchr(line, '/'); tmp_device = tmp_maj * 256 + tmp_min; - for(dev_tmp = dev_head ; dev_tmp != NULL ; dev_tmp = dev_tmp->next) + for(dev_tmp = dev_head ; dev_tmp != NULL ; dev_tmp = dev_tmp->next) { -+ if (dev_tmp->name->name_space & NAMESPACE_NFS) { -+ char *nl; -+ if (!filepath) -+ continue; -+ if ((nl = strchr(filepath, '\n'))) -+ nl = '\0'; -+ if (islocatedon(filepath, dev_tmp->name->filename)) -+ add_matched_proc(dev_tmp->name, pid,uid, access); ++ if (dev_tmp->name->name_space & NAMESPACE_NFS) + continue; -+ } if (dev_tmp->device == tmp_device) add_matched_proc(dev_tmp->name, pid, uid, access); - for(ino_tmp = ino_head ; ino_tmp != NULL ; ino_tmp = ino_tmp->next) + } + for(ino_tmp = ino_head ; ino_tmp != NULL ; ino_tmp = ino_tmp->next) { -+ if (ino_tmp->name->name_space & NAMESPACE_NFS) { -+ char *nl; -+ if (!filepath) -+ continue; -+ if ((nl = strchr(filepath, '\n'))) -+ nl = '\0'; -+ if (islocatedon(filepath, ino_tmp->name->filename)) -+ add_matched_proc(ino_tmp->name, pid,uid, access); ++ if (ino_tmp->name->name_space & NAMESPACE_NFS) + continue; -+ } if (ino_tmp->device == tmp_device && ino_tmp->inode == tmp_inode) add_matched_proc(ino_tmp->name, pid, uid, access); + } } } fclose(fp); -@@ -1146,6 +1423,16 @@ void fill_unix_cache(struct unixsocket_l +@@ -1146,6 +1390,16 @@ void fill_unix_cache(struct unixsocket_l } @@ -594,7 +551,7 @@ /* * scan_mount_devices : Create a list of mount points and devices * This list is used later for matching purposes -@@ -1155,17 +1442,94 @@ void scan_mount_devices(const opt_type o +@@ -1155,17 +1409,94 @@ void scan_mount_devices(const opt_type o FILE *mntfp; struct mntent *mnt_ptr; struct stat st; @@ -648,8 +605,8 @@ add_mount_device(mount_devices, mnt_ptr->mnt_fsname, mnt_ptr->mnt_dir, st.st_dev); + } else { + fprintf(stderr, _("Cannot stat file %s: %s\n"), mnt_ptr->mnt_dir, strerror(errno)); - } - } ++ } ++ } + endmntent(mntfp); + + if (!mnts) @@ -684,14 +641,14 @@ + s->next = p->shadow; + s->prev = (struct shadow_list*)0; + p->shadow = s; -+ } -+ } + } + } +out: + endmntent(mntfp); } #ifdef DEBUG -@@ -1291,3 +1655,56 @@ static void scan_knfsd(struct names *nam +@@ -1291,3 +1622,56 @@ static void scan_knfsd(struct names *nam } } #endif /* NFSCHECKS */ diff --git a/psmisc-22.8-to-22.7-backport.patch b/psmisc-22.8-to-22.7-backport.patch deleted file mode 100644 index b5a4a1e..0000000 --- a/psmisc-22.8-to-22.7-backport.patch +++ /dev/null @@ -1,12 +0,0 @@ ---- src/pstree.c.orig 2008-12-16 11:13:35.000000000 +0100 -+++ src/pstree.c 2009-10-08 19:37:59.000000000 +0200 -@@ -749,6 +749,9 @@ - exit (1); - } - (void) close (fd); -+ /* If we have read the maximum screen length of args, bring it back by one to stop overflow */ -+ if (size >= buffer_size) -+ size--; - if (size) - buffer[size++] = 0; - #ifdef WITH_SELINUX diff --git a/psmisc.changes b/psmisc.changes index f37199b..96c4ac0 100644 --- a/psmisc.changes +++ b/psmisc.changes @@ -1,14 +1,3 @@ -------------------------------------------------------------------- -Fri Oct 9 18:58:25 CEST 2009 - werner@suse.de - -- Yet an other fix for NFS based file detection in fuser - -------------------------------------------------------------------- -Fri Oct 9 08:20:29 UTC 2009 - aj@suse.de - -- fix pstree -a crash (bnc#545265) with patch backported from 22.8 - by Björn Voigt . - ------------------------------------------------------------------- Thu Sep 10 10:21:09 CEST 2009 - werner@suse.de diff --git a/psmisc.spec b/psmisc.spec index d4cfa24..2412209 100644 --- a/psmisc.spec +++ b/psmisc.spec @@ -39,7 +39,6 @@ Patch4: %name-22.7-writeonly.patch Patch5: %name-22.6-fdleak.patch Patch6: %name-22.6-tigetstr.patch Patch7: %name-22.7-memleaks.patch -Patch8: %name-22.8-to-22.7-backport.patch BuildRoot: %{_tmppath}/%{name}-%{version}-build %define nopeek s390 s390x ia64 %arm @@ -67,7 +66,6 @@ Authors: %patch6 -p0 -b .tigetstr %patch7 -p0 -b .memleaks %patch0 -p0 -%patch8 -p0 %build autoreconf -fi