lnav icon indicating copy to clipboard operation
lnav copied to clipboard

Snap lnav fails with permission error, when opening file in a ".directory"

Open mchlnix opened this issue 4 years ago • 0 comments

I recently discovered lnav and installed the snap version, since it was more up to date, than the one from my distributions repositories.

I even wrote a log format file, for the logs at work. But then I noticed, that sometimes the log files refused to open with open(path/to/logs) failed with: Permission denied.

It took me a couple of days to figure out, that it works with logs people send me, but not with ones, I generate on my local machine. And just now it clicked, that the logs in my machine are under the .company_name directory in my HOME dir.

I tried this theory by mkdir -p-ing the same directory structure the log files are in, without the dot in one of the directory names and it opened normally.

I can imagine this has something to do with the sandboxing of the snap package and might not be something you can fix (easily), but since I haven't found any mention of this in the existing issues, here you go.

Btw: It doesn't seem to matter, if you access the files via a symlink, circumventing the dot directory, since lnav grabs the absolute path to the file.

I guess I will just compile the newest version.

mchlnix avatar Dec 06 '21 18:12 mchlnix