Document the behavior of some rights-related functions.

cf. #770
This commit is contained in:
Marcin Mielniczuk
2020-01-09 21:14:20 +01:00
parent 448faed5ca
commit 919190e062
4 changed files with 17 additions and 6 deletions

View File

@@ -61,6 +61,9 @@ pub(crate) struct FdEntry {
}
impl FdEntry {
/// Create an FdEntry with *maximal* possible rights from a given `File`.
/// If this is not desired, the rights of the resulting `FdEntry` should
/// be manually restricted.
pub(crate) fn from(file: fs::File) -> Result<Self> {
unsafe { determine_type_and_access_rights(&file) }.map(
|(file_type, rights_base, rights_inheriting)| Self {