feat: Add UDS bind and connect integration
This commit is contained in:
committed by
Jeremy Soller
parent
dc25344b68
commit
63217aa69a
@@ -190,6 +190,7 @@ impl Node {
|
||||
pub const MODE_FILE: u16 = 0x8000;
|
||||
pub const MODE_DIR: u16 = 0x4000;
|
||||
pub const MODE_SYMLINK: u16 = 0xA000;
|
||||
pub const MODE_SOCK: u16 = 0xC000;
|
||||
|
||||
/// Mask for node permission bits
|
||||
pub const MODE_PERM: u16 = 0x0FFF;
|
||||
@@ -310,6 +311,10 @@ impl Node {
|
||||
self.mode() & Self::MODE_TYPE == Self::MODE_SYMLINK
|
||||
}
|
||||
|
||||
pub fn is_sock(&self) -> bool {
|
||||
self.mode() & Self::MODE_SOCK == Self::MODE_SOCK
|
||||
}
|
||||
|
||||
/// Tests if UID is the owner of that file, only true when uid=0 or when the UID stored in metadata is equal to the UID you supply
|
||||
pub fn owner(&self, uid: u32) -> bool {
|
||||
uid == 0 || self.uid() == uid
|
||||
|
||||
Reference in New Issue
Block a user