Kernel - Implementing infrastructure for GetNodeFromINode
[tpg/acess2.git] / Kernel / vfs / open.c
1 /*
2  * Acess2 VFS
3  * - Open, Close and ChDir
4  */
5 #define DEBUG   0
6 #include <acess.h>
7 #include "vfs.h"
8 #include "vfs_int.h"
9 #include "vfs_ext.h"
10
11 // === CONSTANTS ===
12 #define OPEN_MOUNT_ROOT 1
13 #define MAX_PATH_SLASHES        256
14 #define MAX_NESTED_LINKS        4
15 #define MAX_PATH_LEN    255
16
17 // === IMPORTS ===
18 extern tVFS_Node        gVFS_MemRoot;
19 extern tVFS_Mount       *gVFS_RootMount;
20 extern int      VFS_AllocHandle(int bIsUser, tVFS_Node *Node, int Mode);
21
22 // === PROTOTYPES ===
23  int    VFS_int_CreateHandle( tVFS_Node *Node, int Mode );
24
25 // === CODE ===
26 /**
27  * \fn char *VFS_GetAbsPath(const char *Path)
28  * \brief Create an absolute path from a relative one
29  */
30 char *VFS_GetAbsPath(const char *Path)
31 {
32         char    *ret;
33          int    pathLen = strlen(Path);
34         char    *pathComps[MAX_PATH_SLASHES];
35         char    *tmpStr;
36         int             iPos = 0;
37         int             iPos2 = 0;
38         const char      *chroot = CFGPTR(CFG_VFS_CHROOT);
39          int    chrootLen;
40         const char      *cwd = CFGPTR(CFG_VFS_CWD);
41          int    cwdLen;
42         
43         ENTER("sPath", Path);
44         
45         // Memory File
46         if(Path[0] == '$') {
47                 ret = malloc(strlen(Path)+1);
48                 if(!ret) {
49                         Log_Warning("VFS", "VFS_GetAbsPath: malloc() returned NULL");
50                         return NULL;
51                 }
52                 strcpy(ret, Path);
53                 LEAVE('p', ret);
54                 return ret;
55         }
56         
57         // - Fetch ChRoot
58         if( chroot == NULL ) {
59                 chroot = "";
60                 chrootLen = 0;
61         } else {
62                 chrootLen = strlen(chroot);
63         }
64         
65         // Check if the path is already absolute
66         if(Path[0] == '/') {
67                 ret = malloc(chrootLen + pathLen + 1);
68                 if(!ret) {
69                         Log_Warning("VFS", "VFS_GetAbsPath: malloc() returned NULL");
70                         return NULL;
71                 }
72                 strcpy(ret + chrootLen, Path);
73         }
74         else {
75                 if(cwd == NULL) {
76                         cwd = "/";
77                         cwdLen = 1;
78                 }
79                 else {
80                         cwdLen = strlen(cwd);
81                 }
82                 // Prepend the current directory
83                 ret = malloc(chrootLen + cwdLen + 1 + pathLen + 1 );
84                 strcpy(ret+chrootLen, cwd);
85                 ret[cwdLen] = '/';
86                 strcpy(ret+chrootLen+cwdLen+1, Path);
87                 //Log("ret = '%s'", ret);
88         }
89         
90         // Parse Path
91         pathComps[iPos++] = tmpStr = ret+chrootLen+1;
92         while(*tmpStr)
93         {
94                 if(*tmpStr++ == '/')
95                 {
96                         pathComps[iPos++] = tmpStr;
97                         if(iPos == MAX_PATH_SLASHES) {
98                                 LOG("Path '%s' has too many elements", Path);
99                                 free(ret);
100                                 LEAVE('n');
101                                 return NULL;
102                         }
103                 }
104         }
105         pathComps[iPos] = NULL;
106         
107         // Cleanup
108         iPos2 = iPos = 0;
109         while(pathComps[iPos])
110         {
111                 tmpStr = pathComps[iPos];
112                 // Always Increment iPos
113                 iPos++;
114                 // ..
115                 if(tmpStr[0] == '.' && tmpStr[1] == '.' && (tmpStr[2] == '/' || tmpStr[2] == '\0') )
116                 {
117                         if(iPos2 != 0)
118                                 iPos2 --;
119                         continue;
120                 }
121                 // .
122                 if(tmpStr[0] == '.' && (tmpStr[1] == '/' || tmpStr[1] == '\0') )
123                 {
124                         continue;
125                 }
126                 // Empty
127                 if(tmpStr[0] == '/' || tmpStr[0] == '\0')
128                 {
129                         continue;
130                 }
131                 
132                 // Set New Position
133                 pathComps[iPos2] = tmpStr;
134                 iPos2++;
135         }
136         pathComps[iPos2] = NULL;
137         
138         // Build New Path
139         iPos2 = chrootLen + 1;  iPos = 0;
140         ret[0] = '/';
141         while(pathComps[iPos])
142         {
143                 tmpStr = pathComps[iPos];
144                 while(*tmpStr && *tmpStr != '/')
145                 {
146                         ret[iPos2++] = *tmpStr;
147                         tmpStr++;
148                 }
149                 ret[iPos2++] = '/';
150                 iPos++;
151         }
152         if(iPos2 > 1)
153                 ret[iPos2-1] = 0;
154         else
155                 ret[iPos2] = 0;
156
157         // Prepend the chroot
158         memcpy( ret, chroot, chrootLen );
159         
160         LEAVE('s', ret);
161 //      Log_Debug("VFS", "VFS_GetAbsPath: RETURN '%s'", ret);
162         return ret;
163 }
164
165 /**
166  * \fn char *VFS_ParsePath(const char *Path, char **TruePath)
167  * \brief Parses a path, resolving sysmlinks and applying permissions
168  */
169 tVFS_Node *VFS_ParsePath(const char *Path, char **TruePath)
170 {
171         tVFS_Mount      *mnt, *longestMount;
172          int    cmp, retLength = 0;
173          int    ofs, nextSlash;
174          int    iNestedLinks = 0;
175         tVFS_Node       *curNode, *tmpNode;
176         char    *tmp;
177         char    path_buffer[MAX_PATH_LEN+1];
178         
179         ENTER("sPath pTruePath", Path, TruePath);
180         
181         // Memory File
182         if(Path[0] == '$') {
183                 if(TruePath) {
184                         *TruePath = malloc(strlen(Path)+1);
185                         strcpy(*TruePath, Path);
186                 }
187                 curNode = gVFS_MemRoot.FindDir(&gVFS_MemRoot, Path);
188                 LEAVE('p', curNode);
189                 return curNode;
190         }
191
192 restart_parse:  
193         // For root we always fast return
194         if(Path[0] == '/' && Path[1] == '\0') {
195                 if(TruePath) {
196                         *TruePath = malloc( gVFS_RootMount->MountPointLen+1 );
197                         strcpy(*TruePath, gVFS_RootMount->MountPoint);
198                 }
199                 LEAVE('p', gVFS_RootMount->RootNode);
200                 return gVFS_RootMount->RootNode;
201         }
202         
203         // Check if there is anything mounted
204         if(!gVFS_Mounts) {
205                 Log_Error("VFS", "VFS_ParsePath - No filesystems mounted");
206                 return NULL;
207         }
208         
209         // Find Mountpoint
210         longestMount = gVFS_RootMount;
211         for(mnt = gVFS_Mounts; mnt; mnt = mnt->Next)
212         {
213                 // Quick Check
214                 if( Path[mnt->MountPointLen] != '/' && Path[mnt->MountPointLen] != '\0')
215                         continue;
216                 // Length Check - If the length is smaller than the longest match sofar
217                 if(mnt->MountPointLen < longestMount->MountPointLen)    continue;
218                 // String Compare
219                 cmp = strcmp(Path, mnt->MountPoint);
220                 
221                 #if OPEN_MOUNT_ROOT
222                 // Fast Break - Request Mount Root
223                 if(cmp == 0) {
224                         if(TruePath) {
225                                 *TruePath = malloc( mnt->MountPointLen+1 );
226                                 strcpy(*TruePath, mnt->MountPoint);
227                         }
228                         LEAVE('p', mnt->RootNode);
229                         return mnt->RootNode;
230                 }
231                 #endif
232                 // Not a match, continue
233                 if(cmp != '/')  continue;
234                 longestMount = mnt;
235         }
236         
237         // Save to shorter variable
238         mnt = longestMount;
239         
240         LOG("mnt = {MountPoint:\"%s\"}", mnt->MountPoint);
241         
242         // Initialise String
243         if(TruePath)
244         {
245                 // Assumes that the resultant path (here) will not be > strlen(Path) + 1
246                 *TruePath = malloc( strlen(Path) + 1 );
247                 strcpy(*TruePath, mnt->MountPoint);
248                 retLength = mnt->MountPointLen;
249         }
250         
251         curNode = mnt->RootNode;
252         curNode->ReferenceCount ++;     
253         // Parse Path
254         ofs = mnt->MountPointLen+1;
255         for(; (nextSlash = strpos(&Path[ofs], '/')) != -1; ofs += nextSlash + 1)
256         {
257                 char    pathEle[nextSlash+1];
258                 
259                 // Empty String
260                 if(nextSlash == 0)      continue;
261                 
262                 memcpy(pathEle, &Path[ofs], nextSlash);
263                 pathEle[nextSlash] = 0;
264         
265                 // Check permissions on root of filesystem
266                 if( !VFS_CheckACL(curNode, VFS_PERM_EXECUTE) ) {
267                         if(curNode->Close)      curNode->Close( curNode );
268                         if(TruePath) {
269                                 free(*TruePath);
270                                 *TruePath = NULL;
271                         }
272                         //Log("Permissions fail on '%s'", Path);
273                         LEAVE('n');
274                         return NULL;
275                 }
276                 
277                 // Check if the node has a FindDir method
278                 if( !curNode->FindDir )
279                 {
280                         if(curNode->Close)      curNode->Close(curNode);
281                         if(TruePath) {
282                                 free(*TruePath);
283                                 *TruePath = NULL;
284                         }
285                         //Log("FindDir fail on '%s'", Path);
286                         LEAVE('n');
287                         return NULL;
288                 }
289                 LOG("FindDir{=%p}(%p, '%s')", curNode->FindDir, curNode, pathEle);
290                 // Get Child Node
291                 tmpNode = curNode->FindDir(curNode, pathEle);
292                 LOG("tmpNode = %p", tmpNode);
293                 if(curNode->Close) {
294                         //LOG2("curNode->Close = %p", curNode->Close);
295                         curNode->Close(curNode);
296                 }
297                 curNode = tmpNode;
298                 
299                 // Error Check
300                 if(!curNode) {
301                         LOG("Node '%s' not found in dir '%s'", pathEle, Path);
302                         if(TruePath) {
303                                 free(*TruePath);
304                                 *TruePath = NULL;
305                         }
306                         //Log("Child fail on '%s' ('%s)", Path, pathEle);
307                         LEAVE('n');
308                         return NULL;
309                 }
310                 
311                 // Handle Symbolic Links
312                 if(curNode->Flags & VFS_FFLAG_SYMLINK) {
313                         if(TruePath) {
314                                 free(*TruePath);
315                                 *TruePath = NULL;
316                         }
317                         if(!curNode->Read) {
318                                 Log_Warning("VFS", "VFS_ParsePath - Read of symlink node %p'%s' is NULL",
319                                         curNode, Path);
320                                 if(curNode->Close)      curNode->Close(curNode);
321                                 // No need to free *TruePath, it should already be NULL
322                                 LEAVE('n');
323                                 return NULL;
324                         }
325                         
326                         if(iNestedLinks > MAX_NESTED_LINKS) {
327                                 if(curNode->Close)      curNode->Close(curNode);
328                                 LEAVE('n');
329                                 return NULL;
330                         }
331                         
332                         // Parse Symlink Path
333                         // - Just update the path variable and restart the function
334                         // > Count nested symlinks and limit to some value (counteracts loops)
335                         {
336                                  int    remlen = strlen(Path) - (ofs + nextSlash);
337                                 if( curNode->Size + remlen > MAX_PATH_LEN ) {
338                                         if(curNode->Close)      curNode->Close(curNode);
339                                         Log_Warning("VFS", "VFS_ParsePath - Symlinked path too long");
340                                         LEAVE('n');
341                                         return NULL;
342                                 }
343                                 curNode->Read( curNode, 0, curNode->Size, path_buffer );
344                                 path_buffer[ curNode->Size ] = '\0';
345                                 strcat(path_buffer, Path + ofs+nextSlash);
346                                 
347                                 Path = path_buffer;
348 //                              Log_Debug("VFS", "VFS_ParsePath: Symlink translated to '%s'", Path);
349                                 iNestedLinks ++;
350                         }
351
352                         // EVIL: Goto :)
353                         goto restart_parse;
354                 }
355                 
356                 // Handle Non-Directories
357                 if( !(curNode->Flags & VFS_FFLAG_DIRECTORY) )
358                 {
359                         Log_Warning("VFS", "VFS_ParsePath - Path segment is not a directory");
360                         if(TruePath)    free(*TruePath);
361                         LEAVE('n');
362                         return NULL;
363                 }
364                 
365                 // Check if path needs extending
366                 if(!TruePath)   continue;
367                 
368                 // Increase buffer space
369                 tmp = realloc( *TruePath, retLength + strlen(pathEle) + 1 + 1 );
370                 // Check if allocation succeeded
371                 if(!tmp) {
372                         Log_Warning("VFS", "VFS_ParsePath - Unable to reallocate true path buffer");
373                         free(*TruePath);
374                         *TruePath = NULL;
375                         if(curNode->Close)      curNode->Close(curNode);
376                         LEAVE('n');
377                         return NULL;
378                 }
379                 *TruePath = tmp;
380                 // Append to path
381                 (*TruePath)[retLength] = '/';
382                 strcpy(*TruePath+retLength+1, pathEle);
383                 
384                 LOG("*TruePath = '%s'", *TruePath);
385                 
386                 // - Extend Path
387                 retLength += nextSlash + 1;
388         }
389         
390         if( !curNode->FindDir ) {
391                 if(curNode->Close)      curNode->Close(curNode);
392                 if(TruePath) {
393                         free(*TruePath);
394                         *TruePath = NULL;
395                 }
396                 Log_Warning("VFS", "VFS_ParsePath - FindDir doesn't exist for element of '%s'", Path);
397                 LEAVE('n');
398                 return NULL;
399         }
400         
401         // Get last node
402         LOG("VFS_ParsePath: FindDir(%p, '%s')", curNode, &Path[ofs]);
403         tmpNode = curNode->FindDir(curNode, &Path[ofs]);
404         LOG("tmpNode = %p", tmpNode);
405         if(curNode->Close)      curNode->Close(curNode);
406         // Check if file was found
407         if(!tmpNode) {
408                 LOG("Node '%s' not found in dir '%s'", &Path[ofs], Path);
409                 //Log("Child fail '%s' ('%s')", Path, &Path[ofs]);
410                 if(TruePath)    free(*TruePath);
411                 if(curNode->Close)      curNode->Close(curNode);
412                 LEAVE('n');
413                 return NULL;
414         }
415         
416         if(TruePath)
417         {
418                 // Increase buffer space
419                 tmp = realloc(*TruePath, retLength + strlen(&Path[ofs]) + 1 + 1);
420                 // Check if allocation succeeded
421                 if(!tmp) {
422                         Log_Warning("VFS", "VFS_ParsePath -  Unable to reallocate true path buffer");
423                         free(*TruePath);
424                         if(tmpNode->Close)      tmpNode->Close(curNode);
425                         LEAVE('n');
426                         return NULL;
427                 }
428                 *TruePath = tmp;
429                 // Append to path
430                 (*TruePath)[retLength] = '/';
431                 strcpy(*TruePath + retLength + 1, &Path[ofs]);
432                 // - Extend Path
433                 //retLength += strlen(tmpNode->Name) + 1;
434         }
435         
436         LEAVE('p', tmpNode);
437         return tmpNode;
438 }
439
440 /**
441  * \brief Create and return a handle number for the given node and mode
442  */
443 int VFS_int_CreateHandle( tVFS_Node *Node, int Mode )
444 {
445          int    i;
446         i = 0;
447         i |= (Mode & VFS_OPENFLAG_EXEC) ? VFS_PERM_EXECUTE : 0;
448         i |= (Mode & VFS_OPENFLAG_READ) ? VFS_PERM_READ : 0;
449         i |= (Mode & VFS_OPENFLAG_WRITE) ? VFS_PERM_WRITE : 0;
450         
451         LOG("i = 0b%b", i);
452         
453         // Permissions Check
454         if( !VFS_CheckACL(Node, i) ) {
455                 if(Node->Close) Node->Close( Node );
456                 Log_Log("VFS", "VFS_int_CreateHandle: Permissions Failed");
457                 errno = EACCES;
458                 LEAVE_RET('i', -1);
459         }
460         
461         i = VFS_AllocHandle( !!(Mode & VFS_OPENFLAG_USER), Node, Mode );
462         if( i < 0 ) {
463                 Log_Notice("VFS", "VFS_int_CreateHandle: Out of handles");
464                 errno = ENFILE;
465                 LEAVE_RET('i', -1);
466         }
467
468         LEAVE_RET('x', i);
469 }
470
471 /**
472  * \fn int VFS_Open(const char *Path, Uint Mode)
473  * \brief Open a file
474  */
475 int VFS_Open(const char *Path, Uint Mode)
476 {
477         tVFS_Node       *node;
478         char    *absPath;
479         
480         ENTER("sPath xMode", Path, Mode);
481         
482         // Get absolute path
483         absPath = VFS_GetAbsPath(Path);
484         if(absPath == NULL) {
485                 Log_Warning("VFS", "VFS_Open: Path expansion failed '%s'", Path);
486                 LEAVE_RET('i', -1);
487         }
488         LOG("absPath = \"%s\"", absPath);
489         // Parse path and get mount point
490         node = VFS_ParsePath(absPath, NULL);
491         // Free generated path
492         free(absPath);
493         
494         if(!node) {
495                 LOG("Cannot find node");
496                 errno = ENOENT;
497                 LEAVE_RET('i', -1);
498         }
499         
500         // Check for symlinks
501         if( !(Mode & VFS_OPENFLAG_NOLINK) && (node->Flags & VFS_FFLAG_SYMLINK) )
502         {
503                 char    tmppath[node->Size+1];
504                 if( node->Size > MAX_PATH_LEN ) {
505                         Log_Warning("VFS", "VFS_Open - Symlink is too long (%i)", node->Size);
506                         LEAVE_RET('i', -1);
507                 }
508                 if( !node->Read ) {
509                         Log_Warning("VFS", "VFS_Open - No read method on symlink");
510                         LEAVE_RET('i', -1);
511                 }
512                 // Read symlink's path
513                 node->Read( node, 0, node->Size, tmppath );
514                 tmppath[ node->Size ] = '\0';
515                 if(node->Close) node->Close( node );
516                 // Open the target
517                 node = VFS_ParsePath(tmppath, NULL);
518                 if(!node) {
519                         LOG("Cannot find symlink target node (%s)", tmppath);
520                         errno = ENOENT;
521                         LEAVE_RET('i', -1);
522                 }
523         }
524         
525         LEAVE_RET('x', VFS_int_CreateHandle(node, Mode));       
526 }
527
528
529 /**
530  * \brief Open a file from an open directory
531  */
532 int VFS_OpenChild(int FD, const char *Name, Uint Mode)
533 {
534         tVFS_Handle     *h;
535         tVFS_Node       *node;
536         
537         ENTER("xFD sName xMode", FD, Name, Mode);
538
539         // Get handle
540         h = VFS_GetHandle(FD);
541         if(h == NULL) {
542                 Log_Warning("VFS", "VFS_OpenChild - Invalid file handle 0x%x", FD);
543                 errno = EINVAL;
544                 LEAVE_RET('i', -1);
545         }
546         
547         // Check for directory
548         if( !(h->Node->Flags & VFS_FFLAG_DIRECTORY) ) {
549                 Log_Warning("VFS", "VFS_OpenChild - Passed handle is not a directory", FD);
550                 errno = ENOTDIR;
551                 LEAVE_RET('i', -1);
552         }
553         
554         // Find Child
555         node = h->Node->FindDir(h->Node, Name);
556         if(!node) {
557                 errno = ENOENT;
558                 LEAVE_RET('i', -1);
559         }
560
561         LEAVE_RET('x', VFS_int_CreateHandle(node, Mode));       
562 }
563
564 int VFS_OpenInode(Uint32 Mount, Uint64 Inode, int Mode)
565 {
566         tVFS_Mount      *mnt;
567         tVFS_Node       *node;
568
569         ENTER("iMount iInode xMode", Mount, Inode, Mode);
570         
571         // Get mount point
572         mnt = VFS_GetMountByIdent(Mount);
573         if( !mnt ) {
574                 LOG("Mount point ident invalid");
575                 errno = ENOENT;
576                 LEAVE_RET('i', -1);
577         }
578         
579         // Does the filesystem support this?
580         if( !mnt->Filesystem->GetNodeFromINode ) {
581                 errno = ENOENT;
582                 LEAVE_RET('i', -1);
583         }
584
585         // Get node
586         node = mnt->Filesystem->GetNodeFromINode(mnt->RootNode, Inode);
587         if( !node ) {
588                 errno = ENOENT;
589                 LEAVE_RET('i', -1);
590         }
591         
592         LEAVE_RET('x', VFS_int_CreateHandle(node, Mode));
593 }
594
595 /**
596  * \fn void VFS_Close(int FD)
597  * \brief Closes an open file handle
598  */
599 void VFS_Close(int FD)
600 {
601         tVFS_Handle     *h;
602         
603         // Get handle
604         h = VFS_GetHandle(FD);
605         if(h == NULL) {
606                 Log_Warning("VFS", "Invalid file handle passed to VFS_Close, 0x%x", FD);
607                 return;
608         }
609         
610         #if VALIDATE_VFS_FUNCTIPONS
611         if(h->Node->Close && !MM_GetPhysAddr(h->Node->Close)) {
612                 Log_Warning("VFS", "Node %p's ->Close method is invalid (%p)",
613                         h->Node, h->Node->Close);
614                 return ;
615         }
616         #endif
617         
618         if(h->Node->Close)
619                 h->Node->Close( h->Node );
620         
621         h->Node = NULL;
622 }
623
624 /**
625  * \brief Change current working directory
626  */
627 int VFS_ChDir(const char *Dest)
628 {
629         char    *buf;
630          int    fd;
631         tVFS_Handle     *h;
632         
633         // Create Absolute
634         buf = VFS_GetAbsPath(Dest);
635         if(buf == NULL) {
636                 Log("VFS_ChDir: Path expansion failed");
637                 return -1;
638         }
639         
640         // Check if path exists
641         fd = VFS_Open(buf, VFS_OPENFLAG_EXEC);
642         if(fd == -1) {
643                 Log("VFS_ChDir: Path is invalid");
644                 return -1;
645         }
646         
647         // Get node so we can check for directory
648         h = VFS_GetHandle(fd);
649         if( !(h->Node->Flags & VFS_FFLAG_DIRECTORY) ) {
650                 Log("VFS_ChDir: Path is not a directory");
651                 VFS_Close(fd);
652                 return -1;
653         }
654         
655         // Close file
656         VFS_Close(fd);
657         
658         // Free old working directory
659         if( CFGPTR(CFG_VFS_CWD) )
660                 free( CFGPTR(CFG_VFS_CWD) );
661         // Set new
662         CFGPTR(CFG_VFS_CWD) = buf;
663         
664         Log("Updated CWD to '%s'", buf);
665         
666         return 1;
667 }
668
669 /**
670  * \fn int VFS_ChRoot(char *New)
671  * \brief Change current root directory
672  */
673 int VFS_ChRoot(const char *New)
674 {
675         char    *buf;
676          int    fd;
677         tVFS_Handle     *h;
678         
679         if(New[0] == '/' && New[1] == '\0')
680                 return 1;       // What a useless thing to ask!
681         
682         // Create Absolute
683         buf = VFS_GetAbsPath(New);
684         if(buf == NULL) {
685                 LOG("Path expansion failed");
686                 return -1;
687         }
688         
689         // Check if path exists
690         fd = VFS_Open(buf, VFS_OPENFLAG_EXEC);
691         if(fd == -1) {
692                 LOG("Path is invalid");
693                 return -1;
694         }
695         
696         // Get node so we can check for directory
697         h = VFS_GetHandle(fd);
698         if( !(h->Node->Flags & VFS_FFLAG_DIRECTORY) ) {
699                 LOG("Path is not a directory");
700                 VFS_Close(fd);
701                 return -1;
702         }
703         
704         // Close file
705         VFS_Close(fd);
706         
707         // Free old working directory
708         if( CFGPTR(CFG_VFS_CHROOT) )
709                 free( CFGPTR(CFG_VFS_CHROOT) );
710         // Set new
711         CFGPTR(CFG_VFS_CHROOT) = buf;
712         
713         LOG("Updated Root to '%s'", buf);
714         
715         return 1;
716 }
717
718 // === EXPORTS ===
719 EXPORT(VFS_Open);
720 EXPORT(VFS_Close);

UCC git Repository :: git.ucc.asn.au