feat: Add UDS bind and connect integration

This commit is contained in:
Ibuki Omatsu
2025-07-22 00:32:18 +00:00
committed by Jeremy Soller
parent dc25344b68
commit 63217aa69a
6 changed files with 198 additions and 33 deletions
+5
View File
@@ -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