From: John Hodge Date: Fri, 25 Sep 2009 13:45:37 +0000 (+0800) Subject: Added debug to VFS_GetACL X-Git-Tag: rel0.06~502 X-Git-Url: https://git.ucc.asn.au/?a=commitdiff_plain;h=df7ea67ff0aa02ec50cee1f9635f989bad1bf90d;p=tpg%2Facess2.git Added debug to VFS_GetACL --- diff --git a/Kernel/vfs/acls.c b/Kernel/vfs/acls.c index 9ef4676d..c0225caa 100644 --- a/Kernel/vfs/acls.c +++ b/Kernel/vfs/acls.c @@ -64,13 +64,21 @@ int VFS_GetACL(int FD, tVFS_ACL *Dest) int i; tVFS_Handle *h = VFS_GetHandle(FD); + ENTER("ph pDest", h, Dest); + // Error check - if(!h) return -1; + if(!h) { + LEAVE('i', -1); + return -1; + } + + LOG("h->Node = %p", h->Node); // Root can do anything if(Dest->Group == 0 && Dest->ID == 0) { Dest->Inv = 0; Dest->Perms = -1; + LEAVE('i', 1); return 1; } @@ -78,6 +86,7 @@ int VFS_GetACL(int FD, tVFS_ACL *Dest) if( h->Node->NumACLs == 0 ) { Dest->Inv = 0; Dest->Perms = 0; + LEAVE('i', 0); return 0; } @@ -89,11 +98,13 @@ int VFS_GetACL(int FD, tVFS_ACL *Dest) Dest->Inv = h->Node->ACLs[i].Inv; Dest->Perms = h->Node->ACLs[i].Perms; + LEAVE('i', 1); return 1; } Dest->Inv = 0; Dest->Perms = 0; + LEAVE('i', 0); return 0; } diff --git a/Usermode/Applications/CLIShell_src/main.c b/Usermode/Applications/CLIShell_src/main.c index 87862622..04acc141 100644 --- a/Usermode/Applications/CLIShell_src/main.c +++ b/Usermode/Applications/CLIShell_src/main.c @@ -332,7 +332,7 @@ void Command_Cd(int argc, char **argv) void Command_Dir(int argc, char **argv) { int dp, fp, dirLen; - //char modeStr[11] = "RWXrwxRWX "; + char modeStr[11] = "RWXrwxRWX "; char tmpPath[1024]; char *fileName; t_sysFInfo info; diff --git a/Usermode/include/acess/sys.h b/Usermode/include/acess/sys.h index 62e145e7..f9334866 100644 --- a/Usermode/include/acess/sys.h +++ b/Usermode/include/acess/sys.h @@ -26,14 +26,14 @@ struct s_sysACL { unsigned id: 31; }; uint32_t object; - } + }; union { struct { unsigned invert: 1; unsigned perms: 31; }; uint32_t rawperms; - } + }; }; struct s_sysFInfo { uint uid, gid;