Ticket #5578 (new bug)

Opened 19 months ago

Last modified 8 months ago

write access permission of binary result different on OpenBSD

Reported by: ivdsangen Owned by: igloo
Priority: low Milestone: 7.6.2
Component: Test Suite Version: 7.2.1
Keywords: Cc:
Operating System: OpenBSD Architecture: x86
Type of failure: Runtime crash Difficulty:
Test Case: getPermissions001 Blocked By:
Blocking: Related Tickets:

Description

Checking the write access of the binary itself gives a different result on OpenBSD. Therefore excluding the test case on OpenBSD host.

For reference comare the results of this program on OpenBSD: #include<unistd.h> int main() {

printf("%i\n", access("test",W_OK) == 0);

}

Attachments

0001-Fix-test-case-for-OpenBSD-host.patch Download (1.4 KB) - added by ivdsangen 19 months ago.
Disable test case on OpenBSD host
0001-Handle-EROFS-and-ETXTBSY-for-write-permission-check-.patch Download (0.7 KB) - added by iquiw 8 months ago.
Handle EROFS and ETXTBSY for write permission check
0001-Add-expected-outputs-of-getPermissions001-for-NetBSD.patch Download (1.5 KB) - added by iquiw 8 months ago.
Expected outputs of getPermissions001 for NetBSD

Change History

Changed 19 months ago by ivdsangen

Disable test case on OpenBSD host

Changed 19 months ago by ivdsangen

call to getPermissions on binary itself results in getPermissions001: getPermissions001: fileAccess: resource busy (Text file busy)

Changed 18 months ago by igloo

  • owner set to igloo
  • milestone set to 7.4.1

Thanks for the report.

I think we should catch the exception and have OpenBSD-specific output.

Changed 16 months ago by igloo

  • priority changed from normal to low
  • milestone changed from 7.4.1 to 7.6.1

Changed 9 months ago by igloo

  • milestone changed from 7.6.1 to 7.6.2

Changed 8 months ago by iquiw

The behavior is same on NetBSD. I suppose it is same on FreeBSD too (not checked).

To handle ETXTBSY (and EROFS) in unix package will fix it.

This fix seems proper on Linux according to the man page.

 http://man7.org/linux/man-pages/man2/access.2.html

access() shall fail if:

EROFS  Write permission was requested for a file on a read-only file
             system.

access() may fail if:

ETXTBSY
              Write access was requested to an executable which is being executed.

Changed 8 months ago by iquiw

Handle EROFS and ETXTBSY for write permission check

Changed 8 months ago by iquiw

Expected outputs of getPermissions001 for NetBSD

Note: See TracTickets for help on using tickets.