git.ucc.asn.au
/
tpg
/
acess2.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
DiskTool - Cleanup, copy command
[tpg/acess2.git]
/
KernelLand
/
Kernel
/
vfs
/
open.c
diff --git
a/KernelLand/Kernel/vfs/open.c
b/KernelLand/Kernel/vfs/open.c
index
1536d1a
..
d55b754
100644
(file)
--- a/
KernelLand/Kernel/vfs/open.c
+++ b/
KernelLand/Kernel/vfs/open.c
@@
-59,6
+59,9
@@
char *VFS_GetAbsPath(const char *Path)
if( chroot == NULL )
chroot = "";
chrootLen = strlen(chroot);
if( chroot == NULL )
chroot = "";
chrootLen = strlen(chroot);
+ // Trim trailing slash off chroot
+ if( chrootLen && chroot[chrootLen - 1] == '/' )
+ chrootLen -= 1;
// Check if the path is already absolute
if(Path[0] == '/') {
// Check if the path is already absolute
if(Path[0] == '/') {
@@
-219,11
+222,11
@@
restart_parse:
// Length Check - If the length is smaller than the longest match sofar
if(mnt->MountPointLen < longestMount->MountPointLen) continue;
// String Compare
// Length Check - If the length is smaller than the longest match sofar
if(mnt->MountPointLen < longestMount->MountPointLen) continue;
// String Compare
- cmp = str
cmp(Path, mnt->MountPoint
);
+ cmp = str
ncmp(Path, mnt->MountPoint, mnt->MountPointLen
);
#if OPEN_MOUNT_ROOT
// Fast Break - Request Mount Root
#if OPEN_MOUNT_ROOT
// Fast Break - Request Mount Root
- if(
cmp == 0
) {
+ if(
Path[mnt->MountPointLen] == '\0'
) {
if(TruePath) {
*TruePath = malloc( mnt->MountPointLen+1 );
strcpy(*TruePath, mnt->MountPoint);
if(TruePath) {
*TruePath = malloc( mnt->MountPointLen+1 );
strcpy(*TruePath, mnt->MountPoint);
@@
-235,7
+238,7
@@
restart_parse:
}
#endif
// Not a match, continue
}
#endif
// Not a match, continue
- if(cmp !=
'/')
continue;
+ if(cmp !=
0)
continue;
longestMount = mnt;
}
longestMount = mnt;
}
@@
-269,14
+272,14
@@
restart_parse:
// Check permissions on root of filesystem
if( !VFS_CheckACL(curNode, VFS_PERM_EXECUTE) ) {
// Check permissions on root of filesystem
if( !VFS_CheckACL(curNode, VFS_PERM_EXECUTE) ) {
-
//Log("Permissions fail
on '%s'", Path);
+
LOG("Permissions failure
on '%s'", Path);
goto _error;
}
// Check if the node has a FindDir method
if( !curNode->Type->FindDir )
{
goto _error;
}
// Check if the node has a FindDir method
if( !curNode->Type->FindDir )
{
-
//Log("FindDir fail
on '%s'", Path);
+
LOG("Finddir failure
on '%s'", Path);
goto _error;
}
LOG("FindDir{=%p}(%p, '%s')", curNode->Type->FindDir, curNode, pathEle);
goto _error;
}
LOG("FindDir{=%p}(%p, '%s')", curNode->Type->FindDir, curNode, pathEle);
@@
-482,7
+485,10
@@
int VFS_OpenEx(const char *Path, Uint Flags, Uint Mode)
{
// TODO: Translate `Mode` into ACL and node flags
// Get parent, create node
{
// TODO: Translate `Mode` into ACL and node flags
// Get parent, create node
- VFS_MkNod(absPath, 0);
+ if( VFS_MkNod(absPath, 0) ) {
+ free(absPath);
+ return -1;
+ }
node = VFS_ParsePath(absPath, NULL, &mnt);
}
node = VFS_ParsePath(absPath, NULL, &mnt);
}
UCC
git Repository :: git.ucc.asn.au