OBS User unknown 2009-03-11 15:44:05 +00:00 committed by Git OBS Bridge
parent 86d80c352e
commit e7165bc8c3
3 changed files with 34 additions and 20 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-10-01 16:37:41.410576528 +0200 +++ src/fuser.c 2009-03-11 14:09:40.832002165 +0100
@@ -32,9 +32,11 @@ @@ -32,9 +32,11 @@
#include <stdlib.h> #include <stdlib.h>
#include <string.h> #include <string.h>
@ -255,7 +255,7 @@
} }
#ifdef WITH_IPV6 #ifdef WITH_IPV6
@@ -652,6 +725,80 @@ void find_net6_sockets(struct inode_list @@ -652,6 +725,85 @@ void find_net6_sockets(struct inode_list
} }
#endif #endif
@ -319,12 +319,17 @@
+ if (real) strcpy(real, curr); + if (real) strcpy(real, curr);
+ +
+ if (errno == EINVAL) { + if (errno == EINVAL) {
+ const size_t nlen = strlen(curr);
+ struct nfs_points *p, *n, *l; + struct nfs_points *p, *n, *l;
+ n = mnts; + n = mnts;
+ l = (struct nfs_points*)0; + l = (struct nfs_points*)0;
+ for (p = mnts; n; p = n) { + for (p = mnts; n; p = n) {
+ l = p->prev; + l = p->prev;
+ n = p->next; + n = p->next;
+ if (nlen < p->nlen)
+ continue;
+ if (curr[p->nlen] != '\0' && curr[p->nlen] != '/')
+ continue;
+ if (!strncmp(curr, p->name, p->nlen)) + if (!strncmp(curr, p->name, p->nlen))
+ return 1; + return 1;
+ } + }
@ -336,7 +341,7 @@
int main(int argc, char *argv[]) int main(int argc, char *argv[])
{ {
opt_type opts; opt_type opts;
@@ -676,6 +823,7 @@ int main(int argc, char *argv[]) @@ -676,6 +828,7 @@ int main(int argc, char *argv[])
int optc; int optc;
char *option; char *option;
char *nsptr; char *nsptr;
@ -344,7 +349,7 @@
#ifdef WITH_IPV6 #ifdef WITH_IPV6
ipv4_only = ipv6_only = 0; ipv4_only = ipv6_only = 0;
@@ -692,7 +840,6 @@ int main(int argc, char *argv[]) @@ -692,7 +845,6 @@ int main(int argc, char *argv[])
#endif #endif
netdev = find_net_dev(); netdev = find_net_dev();
@ -352,7 +357,7 @@
fill_unix_cache(&unixsockets); fill_unix_cache(&unixsockets);
/* getopt doesnt like things like -SIGBLAH */ /* getopt doesnt like things like -SIGBLAH */
@@ -782,6 +929,10 @@ int main(int argc, char *argv[]) @@ -782,6 +934,10 @@ int main(int argc, char *argv[])
} }
continue; continue;
} }
@ -363,7 +368,7 @@
/* File specifications */ /* File specifications */
if ( (this_name = malloc(sizeof(struct names))) == NULL) if ( (this_name = malloc(sizeof(struct names))) == NULL)
continue; continue;
@@ -828,10 +979,14 @@ int main(int argc, char *argv[]) @@ -828,10 +984,14 @@ int main(int argc, char *argv[])
break; break;
default: /* FILE */ default: /* FILE */
this_name->filename = strdup(argv[optc]); this_name->filename = strdup(argv[optc]);
@ -381,7 +386,7 @@
break; break;
} }
@@ -857,22 +1012,22 @@ int main(int argc, char *argv[]) @@ -857,22 +1017,22 @@ int main(int argc, char *argv[])
if (!ipv4_only) { if (!ipv4_only) {
#endif #endif
if (tcp_connection_list != NULL) if (tcp_connection_list != NULL)
@ -409,7 +414,7 @@
#ifdef NFS_CHECKS #ifdef NFS_CHECKS
scan_knfsd(names_head, match_devices); scan_knfsd(names_head, match_devices);
#endif /* NFS_CHECKS */ #endif /* NFS_CHECKS */
@@ -978,7 +1133,7 @@ static int print_matches(struct names *n @@ -978,7 +1138,7 @@ static int print_matches(struct names *n
} }
@ -418,7 +423,7 @@
{ {
char pathname[256]; char pathname[256];
struct stat *st; struct stat *st;
@@ -986,6 +1141,10 @@ static struct stat *get_pidstat(const pi @@ -986,6 +1146,10 @@ static struct stat *get_pidstat(const pi
if ( (st = malloc(sizeof(struct stat))) == NULL) if ( (st = malloc(sizeof(struct stat))) == NULL)
return NULL; return NULL;
snprintf(pathname, 256, "/proc/%d/%s", pid, filename); snprintf(pathname, 256, "/proc/%d/%s", pid, filename);
@ -429,7 +434,7 @@
if (stat(pathname, st) != 0) if (stat(pathname, st) != 0)
return NULL; return NULL;
else else
@@ -1012,13 +1171,14 @@ static void check_dir(const pid_t pid, c @@ -1012,13 +1176,14 @@ static void check_dir(const pid_t pid, c
while ( (direntry = readdir(dirp)) != NULL) { while ( (direntry = readdir(dirp)) != NULL) {
if (direntry->d_name[0] < '0' || direntry->d_name[0] > '9') if (direntry->d_name[0] < '0' || direntry->d_name[0] > '9')
continue; continue;
@ -445,7 +450,7 @@
if (st.st_dev == dev_tmp->device) { if (st.st_dev == dev_tmp->device) {
if (access == ACCESS_FILE && (lstat(filepath, &lst)==0) && (lst.st_mode & S_IWUSR)) { if (access == ACCESS_FILE && (lstat(filepath, &lst)==0) && (lst.st_mode & S_IWUSR)) {
add_matched_proc(dev_tmp->name, pid,uid, ACCESS_FILEWR|access); add_matched_proc(dev_tmp->name, pid,uid, ACCESS_FILEWR|access);
@@ -1028,6 +1188,8 @@ static void check_dir(const pid_t pid, c @@ -1028,6 +1193,8 @@ static void check_dir(const pid_t pid, c
} }
} }
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) {
@ -454,7 +459,7 @@
if (st.st_dev == ino_tmp->device && st.st_ino == ino_tmp->inode) { 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)) { if (access == ACCESS_FILE && (lstat(filepath, &lst)==0) && (lst.st_mode & S_IWUSR)) {
add_matched_proc(ino_tmp->name, pid,uid, ACCESS_FILEWR|access); add_matched_proc(ino_tmp->name, pid,uid, ACCESS_FILEWR|access);
@@ -1039,6 +1201,8 @@ static void check_dir(const pid_t pid, c @@ -1039,6 +1206,8 @@ static void check_dir(const pid_t pid, c
} }
} /* while fd_dent */ } /* while fd_dent */
closedir(dirp); closedir(dirp);
@ -463,7 +468,7 @@
} }
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) 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)
@@ -1059,12 +1223,18 @@ static void check_map(const pid_t pid, c @@ -1059,12 +1228,18 @@ static void check_map(const pid_t pid, c
if (sscanf(line, "%*s %*s %*s %x:%x %lld", if (sscanf(line, "%*s %*s %*s %x:%x %lld",
&tmp_maj, &tmp_min, &tmp_inode) == 3) { &tmp_maj, &tmp_min, &tmp_inode) == 3) {
tmp_device = tmp_maj * 256 + tmp_min; tmp_device = tmp_maj * 256 + tmp_min;
@ -484,7 +489,7 @@
} }
} }
fclose(fp); fclose(fp);
@@ -1135,6 +1305,16 @@ void fill_unix_cache(struct unixsocket_l @@ -1135,6 +1310,16 @@ void fill_unix_cache(struct unixsocket_l
} }
@ -501,7 +506,7 @@
/* /*
* scan_mount_devices : Create a list of mount points and devices * scan_mount_devices : Create a list of mount points and devices
* This list is used later for matching purposes * This list is used later for matching purposes
@@ -1144,17 +1324,53 @@ void scan_mount_devices(const opt_type o @@ -1144,17 +1329,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;
@ -559,7 +564,7 @@
} }
#ifdef DEBUG #ifdef DEBUG
@@ -1280,3 +1496,56 @@ static void scan_knfsd(struct names *nam @@ -1280,3 +1501,56 @@ static void scan_knfsd(struct names *nam
} }
} }
#endif /* NFSCHECKS */ #endif /* NFSCHECKS */

View File

@ -1,3 +1,9 @@
-------------------------------------------------------------------
Wed Mar 11 14:24:06 CET 2009 - werner@suse.de
- nfs4fuser: make sure not to stumble on short named mount points
to avoid to terminate processes on wrong mount points
------------------------------------------------------------------- -------------------------------------------------------------------
Thu Oct 9 16:35:51 CEST 2008 - werner@suse.de Thu Oct 9 16:35:51 CEST 2008 - werner@suse.de

View File

@ -1,7 +1,7 @@
# #
# spec file for package psmisc (Version 22.6) # spec file for package psmisc (Version 22.6)
# #
# Copyright (c) 2008 SUSE LINUX Products GmbH, Nuernberg, Germany. # Copyright (c) 2009 SUSE LINUX Products GmbH, Nuernberg, Germany.
# #
# All modifications and additions to the file contributed by third parties # All modifications and additions to the file contributed by third parties
# remain the property of their copyright owners, unless otherwise agreed # remain the property of their copyright owners, unless otherwise agreed
@ -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: 61 Release: 62
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
@ -105,6 +105,9 @@ rm -rf $RPM_BUILD_ROOT
%{_mandir}/man1/pstree.1* %{_mandir}/man1/pstree.1*
%changelog %changelog
* Wed Mar 11 2009 werner@suse.de
- nfs4fuser: make sure not to stumble on short named mount points
to avoid to terminate processes on wrong mount points
* Thu Oct 09 2008 werner@suse.de * Thu Oct 09 2008 werner@suse.de
- Make compiler happy: Don't compare pointer with zero (bnc#432986) - Make compiler happy: Don't compare pointer with zero (bnc#432986)
* Wed Oct 01 2008 werner@suse.de * Wed Oct 01 2008 werner@suse.de
@ -136,7 +139,7 @@ rm -rf $RPM_BUILD_ROOT
* Patch for peekfd from Benno Schulenberg * Patch for peekfd from Benno Schulenberg
* Fixed up NLS for fuser, patch from Benno Schulenberg * Fixed up NLS for fuser, patch from Benno Schulenberg
* killall asks for Signal (procname) if not SIGTERM * killall asks for Signal (procname) if not SIGTERM
* Fri Oct 05 2007 bg@suse.de * Thu Oct 04 2007 bg@suse.de
- Disable peekfd on hppa - Disable peekfd on hppa
* Thu Apr 26 2007 werner@suse.de * Thu Apr 26 2007 werner@suse.de
- Args, peekfd is ix86 specific, disable on other architectures - Args, peekfd is ix86 specific, disable on other architectures