You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
ucg: error: GetFileDescriptor(): open(/var/log/messages) failed: Operation not permitted
ag and grep are fine with opening the file. After some research I found that grep opens file with openat and flags O_RDONLY|O_NOCTTY, ag opens file with just O_RDONLY (after attempting to open it as a directory with different set of flags) and ucg tries O_RDONLY|O_NOCTTY|O_NOATIME. The last flag looks like what is causing command to fail: according to man open flag may be used either if EUID matches file owner (not true: owner is root, EUID is zyx) or calling process has CAP_FOWNER capability in … (also not true: not using capabilities anywhere in my system).
I would suggest that ucg should retry without O_NOATIME if it got EPERM.
The text was updated successfully, but these errors were encountered:
Tried the following code:
Surprisingly it failed with
ag
andgrep
are fine with opening the file. After some research I found thatgrep
opens file withopenat
and flagsO_RDONLY|O_NOCTTY
,ag
opens file with justO_RDONLY
(after attempting to open it as a directory with different set of flags) anducg
triesO_RDONLY|O_NOCTTY|O_NOATIME
. The last flag looks like what is causing command to fail: according toman open
flag may be used either if EUID matches file owner (not true: owner is root, EUID is zyx) or calling process has CAP_FOWNER capability in … (also not true: not using capabilities anywhere in my system).I would suggest that ucg should retry without O_NOATIME if it got EPERM.
The text was updated successfully, but these errors were encountered: