Page MenuHomeFreeBSD

linux: implement O_PATH
ClosedPublic

Authored by trasz on Apr 15 2021, 12:49 PM.
Tags
None
Referenced Files
Unknown Object (File)
Fri, May 3, 5:12 AM
Unknown Object (File)
Tue, Apr 23, 2:12 PM
Unknown Object (File)
Mar 15 2024, 9:32 AM
Unknown Object (File)
Feb 10 2024, 5:04 AM
Unknown Object (File)
Dec 20 2023, 9:48 AM
Unknown Object (File)
Dec 20 2023, 12:05 AM
Unknown Object (File)
Dec 17 2023, 12:21 PM
Unknown Object (File)
Dec 14 2023, 10:47 PM
Subscribers

Diff Detail

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

Event Timeline

Is there a Linux test suite for O_PATH? If yes, did you run it over this implementation?

sys/compat/linux/linux_file.h
87

Octal?! This is crazy. Does glibc header use octal for O_ constants?

Also can you commit addition of '0' separately?

This revision is now accepted and ready to land.Apr 15 2021, 12:55 PM
In D29773#667845, @kib wrote:

Is there a Linux test suite for O_PATH? If yes, did you run it over this implementation?

I didn't find any tests; what I did was a quick smoke test with Python:

>>> import os
>>> fd = os.open('/etc/passwd', os.O_RDONLY | os.O_PATH)
>>> os.read(fd, 5)
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
OSError: [Errno 9] Bad file descriptor
>>> os.fstat(fd)
os.stat_result(st_mode=33188, st_ino=13324429, st_dev=112, st_nlink=1, st_uid=0, st_gid=0, st_size=2108, st_atime=1612790821, st_mtime=1612790821, st_ctime=1612790821)
sys/compat/linux/linux_file.h
87

It is sad, and yes, that's what you'll find in glibc headers. Sure I can!

This revision was automatically updated to reflect the committed changes.