* define rpmatch for libraries that dont have it
* Fixed small typos in help, thanks to Benno Schulenberg
fixes SF# 1150042
- * fusernew - this will be the new fuser once it gets tested on
- those strange setups folks out there have
* Completed change from Flask to SELinux, thanks to Benno Schulenberg
* pstree works better with uClibc, thanks Mike Frysinger
+ * fuser rewritten: possibly fixes Debian #312560
+ * fuser prints F instead of f is access is write, thanks to Tet.
Changes in 21.6
===============
fflush(stdout);
if (opts & OPT_VERBOSE) {
fprintf(stderr, " %c%c%c%c%c ",
- pptr->access & ACCESS_FILE ? 'f' : '.',
+ pptr->access & ACCESS_FILE ? (pptr->access & ACCESS_FILEWR ? 'F' : 'f' ) : '.',
pptr->access & ACCESS_ROOT ? 'r' : '.',
pptr->access & ACCESS_CWD ? 'c' : '.',
pptr->access & ACCESS_EXE ? 'e' : '.',
struct dirent *direntry;
struct inode_list *ino_tmp;
struct device_list *dev_tmp;
- struct stat st;
+ struct stat st, lst;
if ( (dirpath = malloc(MAX_PATHNAME)) == NULL)
return;
fprintf(stderr, _("Cannot stat file %s: %s\n"),filepath, strerror(errno));
} else {
for (dev_tmp = dev_head ; dev_tmp != NULL ; dev_tmp = dev_tmp->next) {
- if (st.st_dev == dev_tmp->device)
- add_matched_proc(dev_tmp->name, pid,uid, access);
+ 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);
+ } else {
+ add_matched_proc(dev_tmp->name, pid,uid, access);
+ }
+ }
}
for (ino_tmp = ino_head ; ino_tmp != NULL ; ino_tmp = ino_tmp->next) {
- if (st.st_dev == ino_tmp->device && st.st_ino == ino_tmp->inode)
- add_matched_proc(ino_tmp->name, pid,uid, access);
+ 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);
+ } else {
+ add_matched_proc(ino_tmp->name, pid,uid, access);
+ }
+ }
}
}
} /* while fd_dent */