whitequark / rust-xdg

A library that makes it easy to follow the X Desktop Group specifications
https://wiki.freedesktop.org/www/Specifications/
Apache License 2.0
154 stars 30 forks source link

Fix runtime dir ownership checking. #10

Closed SimonSapin closed 8 years ago

SimonSapin commented 8 years ago

You don’t need to own a directory to see its metadata:

<SimonSapin>    ::std::fs::metadata("/root").is_ok()
<-->    playbot: true
<SimonSapin>    ::std::fs::read_dir("/root").is_ok()
<-->    playbot: false

This is unfortunately hard to test: root access would be needed to change ownership of a directory under test_files/, and there is no guarantee any other directory would be present.