Originally Posted by
vbgf3
Hi,
I don't understand why you said "Figuring out which directory a program is being run from with 90% accuracy iis really easy. But the last 10% of possible cases is really ugly. "
I was a developer for 20+ yrs. You and I are coming at this from completely different perspectives. The OS/shell can report on where a program is run from, but it isn't always correct using the most common tools, like whence or parsing $0 aka arg[0]. That's the 90% solution that is usually good enough, but not always. For example, if a program comes with these directories:
Code:
ProgramA
├── bin
├── doc
├── etc
├── lib
└── man
and the program and/or startup script is in the bin/ directory, it makes sense to assume that configuration files would be in etc/, help pages would be in doc/ and libraries would be in lib/, right? So we'd look at $0 to get the location of the program and strip off the bin/programa part hoping to be left with the location of ProgramA directories. But depending on how programA was started, that value may be less useful and end with libraries, documentation and config files inaccessible. This is why a program start script will often have an environment variable, say JAVA_HOME, to answer the question definitively.
Anyway, probably not what you assumed I meant.
<snip>
Originally Posted by
vbgf3
I agree that profiles built without explicit paths are better. But then, I intend the profile to be used only with a particular distro. Not universally re-usable code, but it suffices. The technique is fast.
Are you a contributing developer for firejail ?
No, I'm just a happy user of firejail. There are some other, similar, tools that could be better for different situations. As you know, security is hard. There are often edge conditions that few people understand that someone just happy to have a working program, much less one that is secure too, would be hard to know and understand. It is significantly more difficult when doing cross-platform coding. In my prime, my team supported 13 platforms. We counted MS-Windows as 1, though there were 4 very different releases at the time. I suppose we could have claimed 17 platforms then.
Bookmarks