Menu

How Hard Is It To Open a File?

Hacker News·7 months ago
#tGpMSEbe
#path#file#process#directory#flatpak
Reading 0:00
15s threshold

It’s a question I had to ask myself multiple times over the last few months. Depending on the context the answer can be:

very simple, just call the standard library function

extremely hard, don’t trust anything

If you are an app developer, you’re lucky and it’s almost always the first answer. If you develop something with a security boundary which involves files in any way, the correct answer is very likely the second one.

Opening a File, the Hard Way

Like so often, the details depend on the specifics, but in the worst-case scenario, there is a process on either side of the security boundary, which operate on a filesystem tree which is shared by both processes.

Let’s say that the process with more privileges operates on a file on behalf of the process with less privileges.…

Continue reading — create a free account

Join HashtagPLUS to read full articles, follow hashtags, vote, and join the conversation.