958b25be50
- Revise VFS-FS protocol and update VFS/MFS/ISOFS accordingly. - Clean up MFS by removing old, dead code (backwards compatibility is broken by the new VFS-FS protocol, anyway) and rewrite other parts. Also, make sure all functions have proper banners and prototypes. - VFS should always provide a (syntactically) valid path to the FS; no need for the FS to do sanity checks when leaving/entering mount points. - Fix several bugs in MFS: - Several path lookup bugs in MFS. - A link can be too big for the path buffer. - A mountpoint can become inaccessible when the creation of a new inode fails, because the inode already exists and is a mountpoint. - Introduce support for supplemental groups. - Add test 46 to test supplemental group functionality (and removed obsolete suppl. tests from test 2). - Clean up VFS (not everything is done yet). - ISOFS now opens device read-only. This makes the -r flag in the mount command unnecessary (but will still report to be mounted read-write). - Introduce PipeFS. PipeFS is a new FS that handles all anonymous and named pipes. However, named pipes still reside on the (M)FS, as they are part of the file system on disk. To make this work VFS now has a concept of 'mapped' inodes, which causes read, write, truncate and stat requests to be redirected to the mapped FS, and all other requests to the original FS.
32 lines
959 B
C
32 lines
959 B
C
#include "inc.h"
|
|
#include <unistd.h>
|
|
#include <minix/callnr.h>
|
|
#include "buf.h"
|
|
|
|
#include <minix/vfsif.h>
|
|
|
|
/* This calling is used to access a particular file. */
|
|
/*===========================================================================*
|
|
* fs_access *
|
|
*===========================================================================*/
|
|
PUBLIC int fs_access()
|
|
{
|
|
struct dir_record *rip;
|
|
int r = OK;
|
|
|
|
/* Temporarily open the file whose access is to be checked. */
|
|
caller_uid = fs_m_in.REQ_UID;
|
|
caller_gid = fs_m_in.REQ_GID;
|
|
|
|
/* Temporarily open the file. */
|
|
if ( (rip = get_dir_record(fs_m_in.REQ_INODE_NR)) == NULL) {
|
|
printf("ISOFS(%d) get_dir_record by fs_access() failed\n", SELF_E);
|
|
return(EINVAL);
|
|
}
|
|
|
|
/* For now ISO9660 doesn't have permission control (read and execution to
|
|
* everybody by default. So the access is always granted. */
|
|
|
|
release_dir_record(rip); /* Release the dir record used */
|
|
return(r);
|
|
}
|