Bug 3799 - fuser port/proto does not work due to wrong return check for access()
Summary: fuser port/proto does not work due to wrong return check for access()
Status: RESOLVED FIXED
Alias: None
Product: Busybox
Classification: Unclassified
Component: Networking (show other bugs)
Version: 1.17.x
Hardware: Other Linux
: P5 critical
Target Milestone: ---
Assignee: unassigned
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-05-26 03:27 UTC by henry
Modified: 2011-05-29 00:04 UTC (History)
2 users (show)

See Also:
Host:
Target:
Build:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description henry 2011-05-26 03:27:08 UTC
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);
    }
    .....
}
Comment 1 Denys Vlasenko 2011-05-29 00:04:44 UTC
Thanks!

Fixed in git by commit 217a7f4bf95339a93a217c5806c5b9a48c0027d5