File tree Expand file tree Collapse file tree 1 file changed +13
-4
lines changed Expand file tree Collapse file tree 1 file changed +13
-4
lines changed Original file line number Diff line number Diff line change @@ -40,11 +40,20 @@ mod tests {
4040 #[ cfg( unix) ]
4141 {
4242 use platform_lib:: { S_IRWXU , S_IRWXG , S_IRWXO } ;
43- let mask = ( S_IRWXU | S_IRWXG | S_IRWXO ) as u32 ;
43+
44+ let owner_perm = u32:: from ( S_IRWXU ) ; // 用户权限 (rwx------ = 700)
45+ let group_perm = u32:: from ( S_IRWXG ) ; // 组权限 (---rwx--- = 070)
46+ let other_perm = u32:: from ( S_IRWXO ) ; // 其他权限 (------rwx = 007)
47+ let full_mask = owner_perm | group_perm | other_perm; // 完整权限掩码 (rwxrwxrwx = 777)
48+
49+ let actual_perms = permissions. mode ( ) & full_mask;
50+
51+ debug ! ( "IPC file permissions: {:o}" , permissions. mode( ) ) ;
4452 assert_eq ! (
45- permissions. mode( ) & mask,
46- mask,
47- "IPC file permissions should be 777"
53+ actual_perms,
54+ full_mask,
55+ "IPC file permissions should be 777 (actual: {:o})" ,
56+ actual_perms
4857 ) ;
4958 }
5059 #[ cfg( windows) ]
You can’t perform that action at this time.
0 commit comments