OBS User unknown 2008-10-06 16:08:43 +00:00 committed by Git OBS Bridge
parent 7f87cd8a33
commit 9b8b555811
4 changed files with 51 additions and 5 deletions

View File

@ -33,7 +33,7 @@
cannot report on any processes that it doesn't have permission to look at 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 the file descriptor table for. The most common time this problem occurs
--- src/fuser.c --- src/fuser.c
+++ src/fuser.c 2008-09-23 16:00:18.038188677 +0200 +++ src/fuser.c 2008-10-01 16:37:41.410576528 +0200
@@ -32,9 +32,11 @@ @@ -32,9 +32,11 @@
#include <stdlib.h> #include <stdlib.h>
#include <string.h> #include <string.h>
@ -484,7 +484,24 @@
} }
} }
fclose(fp); fclose(fp);
@@ -1144,17 +1314,53 @@ void scan_mount_devices(const opt_type o @@ -1135,6 +1305,16 @@ void fill_unix_cache(struct unixsocket_l
}
+static inline int isnetfs(const char * type)
+{
+ static const char* netfs[] = {"nfs", "nfs4", "smbfs", "cifs", "afs", "ncpfs", (char*)0};
+ int n;
+ for (n = 0; netfs[n]; n++)
+ if (!strcasecmp(netfs[n], type))
+ return 1;
+ return 0;
+}
+
/*
* scan_mount_devices : Create a list of mount points and devices
* This list is used later for matching purposes
@@ -1144,17 +1324,53 @@ void scan_mount_devices(const opt_type o
FILE *mntfp; FILE *mntfp;
struct mntent *mnt_ptr; struct mntent *mnt_ptr;
struct stat st; struct stat st;
@ -502,7 +519,7 @@
return; return;
} }
while ( (mnt_ptr = getmntent(mntfp)) != NULL) { while ( (mnt_ptr = getmntent(mntfp)) != NULL) {
+ if (!strcasecmp(MNTTYPE_NFS, mnt_ptr->mnt_type)) { + if (isnetfs(mnt_ptr->mnt_type)) {
+ /* + /*
+ * Remember all NFS typed partitions, required to make check4nfs() work. + * Remember all NFS typed partitions, required to make check4nfs() work.
+ */ + */
@ -542,7 +559,7 @@
} }
#ifdef DEBUG #ifdef DEBUG
@@ -1280,3 +1486,56 @@ static void scan_knfsd(struct names *nam @@ -1280,3 +1496,56 @@ static void scan_knfsd(struct names *nam
} }
} }
#endif /* NFSCHECKS */ #endif /* NFSCHECKS */

View File

@ -32,3 +32,25 @@
dnl Checks for library functions. dnl Checks for library functions.
AC_FUNC_CLOSEDIR_VOID AC_FUNC_CLOSEDIR_VOID
--- src/fuser.c
+++ src/fuser.c 2008-10-01 18:02:08.469114183 +0200
@@ -147,7 +147,6 @@ static void scan_procs(const opt_type op
{
DIR *topproc_dir;
struct dirent *topproc_dent;
- char *fd_dirpath, *fd_pathname;
struct inode_list *ino_tmp;
struct device_list *dev_tmp;
pid_t pid, my_pid;
@@ -157,11 +156,6 @@ static void scan_procs(const opt_type op
char cwd_real[PATH_MAX+1];
char exe_real[PATH_MAX+1];
- if ( (fd_dirpath = malloc(MAX_PATHNAME)) == NULL)
- return;
- if ( (fd_pathname = malloc(MAX_PATHNAME)) == NULL)
- return;
-
if ( (topproc_dir = opendir("/proc")) == NULL) {
fprintf(stderr, _("Cannot open /proc directory: %s\n"), strerror(errno));
exit(1);

View File

@ -1,3 +1,8 @@
-------------------------------------------------------------------
Wed Oct 1 16:39:27 CEST 2008 - werner@suse.de
- Avoid stat(2) for all network based file systems (bnc#409011)
------------------------------------------------------------------- -------------------------------------------------------------------
Tue Sep 23 15:30:58 CEST 2008 - werner@suse.de Tue Sep 23 15:30:58 CEST 2008 - werner@suse.de

View File

@ -27,7 +27,7 @@ Group: System/Monitoring
PreReq: %fillup_prereq %insserv_prereq PreReq: %fillup_prereq %insserv_prereq
AutoReqProv: on AutoReqProv: on
Version: 22.6 Version: 22.6
Release: 59 Release: 60
Provides: ps:/usr/bin/killall Provides: ps:/usr/bin/killall
Summary: Utilities for managing processes on your system Summary: Utilities for managing processes on your system
Source: http://switch.dl.sourceforge.net/sourceforge/psmisc/psmisc-%{version}.tar.bz2 Source: http://switch.dl.sourceforge.net/sourceforge/psmisc/psmisc-%{version}.tar.bz2
@ -103,6 +103,8 @@ rm -rf $RPM_BUILD_ROOT
%{_mandir}/man1/pstree.1* %{_mandir}/man1/pstree.1*
%changelog %changelog
* Wed Oct 01 2008 werner@suse.de
- Avoid stat(2) for all network based file systems (bnc#409011)
* Tue Sep 23 2008 werner@suse.de * Tue Sep 23 2008 werner@suse.de
- Enhance NFS patch for fuser (bug #409011) - Enhance NFS patch for fuser (bug #409011)
* Mon Sep 01 2008 werner@suse.de * Mon Sep 01 2008 werner@suse.de