Page MenuHomeFreeBSD

Remove useless call to access(2)
ClosedPublic

Authored by trasz on Oct 25 2018, 4:03 PM.
Tags
None
Referenced Files
F103537783: D17701.diff
Tue, Nov 26, 6:08 AM
Unknown Object (File)
Mon, Nov 18, 9:10 PM
Unknown Object (File)
Oct 23 2024, 5:52 PM
Unknown Object (File)
Oct 4 2024, 12:47 PM
Unknown Object (File)
Oct 4 2024, 4:05 AM
Unknown Object (File)
Oct 1 2024, 10:29 AM
Unknown Object (File)
Sep 28 2024, 6:35 AM
Unknown Object (File)
Sep 24 2024, 3:54 AM
Subscribers

Details

Summary

Remove useless call to access(2) from tzcode. Quoting OpenBSD:

Remove doaccess variable and access(2) call since this interfers with
applications like zdump(8) because pledge(2) doesn't allow access(2) to
/usr/share/zoneinfo.

millert@ better described why this call can go away:

"This looks like an attempt to do access checks based on the real uid instead
of the effective uid.  Basically for setuid programs we don't want to allow a
user to set TZ to a path they should not be able to otherwise access.

However, we already have a check for issetugid() above so I think the doaccess
bits can just be removed and we can rely on open()."

After discussion with tb@, deraadt@ and millert@, this was also OK'ed by them

Diff Detail

Repository
rS FreeBSD src repository - subversion
Lint
No Lint Coverage
Unit
No Test Coverage
Build Status
Buildable 20421
Build 19860: arc lint + arc unit

Event Timeline

This looks good to my naive eye.

contrib/tzcode/stdtime/localtime.c
393

I think I added this comment years ago. I think it is correct now and the comment can be removed.

This revision is now accepted and ready to land.Oct 25 2018, 4:11 PM
This revision was automatically updated to reflect the committed changes.