Bug 3799

Summary: fuser port/proto does not work due to wrong return check for access()
Product: Busybox Reporter: henry
Component: NetworkingAssignee: 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:

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