shell's test gives false positive on readability of files
Bug #1748510 reported by
Marco Trevisan (Treviño)
This bug affects 1 person
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
Snappy |
Won't Fix
|
Undecided
|
Unassigned |
Bug Description
If inside any snap run --shell I do:
test -r /home/$USER/.bashrc && echo true
The output is true, although I'm not able to read that file... Of course I can't get its content and thus sandbox works, but it would be nice to be able to check this properly using standard sh tools (I'm using something like `head -c0 /home/$USER/out.ogv &> /dev/null && echo true`).
To post a comment you must log in.
My guess would be that `test` does a stat() and checks st_mode against provided flags, so it's like only reading the metadata. The actual blocking/sandboxing happens on calls that have side effects on the real data, eg. open().