Page MenuHomeFreeBSD

linux: implement O_PATH
ClosedPublic

Authored by trasz on Apr 15 2021, 12:49 PM.
Tags
None
Referenced Files
Unknown Object (File)
Sun, Nov 10, 9:00 AM
Unknown Object (File)
Thu, Oct 24, 12:58 AM
Unknown Object (File)
Oct 4 2024, 10:05 PM
Unknown Object (File)
Oct 2 2024, 12:09 PM
Unknown Object (File)
Oct 2 2024, 9:24 AM
Unknown Object (File)
Oct 2 2024, 8:23 AM
Unknown Object (File)
Oct 1 2024, 7:42 AM
Unknown Object (File)
Oct 1 2024, 12:18 AM
Subscribers

Diff Detail

Repository
rG FreeBSD src repository
Lint
Lint Not Applicable
Unit
Tests Not Applicable

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.