| Summary: | fuser port/proto does not work due to wrong return check for access() | ||
|---|---|---|---|
| Product: | Busybox | Reporter: | henry |
| Component: | Networking | Assignee: | unassigned |
| Status: | RESOLVED FIXED | ||
| Severity: | critical | CC: | busybox-cvs, henry |
| Priority: | P5 | ||
| Version: | 1.17.x | ||
| Target Milestone: | --- | ||
| Hardware: | Other | ||
| OS: | Linux | ||
| Host: | Target: | ||
| Build: | |||
Thanks! Fixed in git by commit 217a7f4bf95339a93a217c5806c5b9a48c0027d5 |
When invoked with port/proto instead of a file, fuser.c calls access() to check for the file /proc/net/<proto>. It checks for a non-zero return from access(). But if the file is accessible, the return is zero, not non-zero! int fuser_main(int argc UNUSED_PARAM, char **argv) { ..... if (access(path, R_OK) != 0) { /* PORT/PROTO */ scan_proc_net(path, port); } else { /* FILE */ file: xstat(*pp, &st); add_inode(&st); } ..... }