[Bug 3799] New: fuser port/proto does not work due to wrong return check for access()

bugzilla at busybox.net bugzilla at busybox.net
Thu May 26 03:27:09 UTC 2011


https://bugs.busybox.net/show_bug.cgi?id=3799

           Summary: fuser port/proto does not work due to wrong return
                    check for access()
           Product: Busybox
           Version: 1.17.x
          Platform: Other
        OS/Version: Linux
            Status: NEW
          Severity: critical
          Priority: P5
         Component: Networking
        AssignedTo: unassigned at busybox.net
        ReportedBy: henry at echelon.com
                CC: busybox-cvs at busybox.net
   Estimated Hours: 0.0


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);
    }
    .....
}

-- 
Configure bugmail: https://bugs.busybox.net/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are on the CC list for the bug.


More information about the busybox-cvs mailing list