ReactOS  0.4.14-dev-49-gfb4591c
access.c File Reference
#include "ext2fs.h"
Include dependency graph for access.c:

Go to the source code of this file.

Functions

int Ext2CheckInodeAccess (PEXT2_VCB Vcb, struct inode *in, int attempt)
 
int Ext2CheckFileAccess (PEXT2_VCB Vcb, PEXT2_MCB Mcb, int attempt)
 

Variables

PEXT2_GLOBAL Ext2Global
 

Function Documentation

◆ Ext2CheckFileAccess()

int Ext2CheckFileAccess ( PEXT2_VCB  Vcb,
PEXT2_MCB  Mcb,
int  attempt 
)

Definition at line 51 of file access.c.

52 {
53  return Ext2CheckInodeAccess(Vcb, &Mcb->Inode, attempt);
54 }
int Ext2CheckInodeAccess(PEXT2_VCB Vcb, struct inode *in, int attempt)
Definition: access.c:20
#define Vcb
Definition: cdprocs.h:1425
IN PVCB IN ULONG IN OUT PULONG IN BOOLEAN OUT PLARGE_MCB Mcb
Definition: fatprocs.h:334

Referenced by Ext2CreateFile(), Ext2LookupFile(), Ext2SetFileInformation(), and Ext2WriteFile().

◆ Ext2CheckInodeAccess()

int Ext2CheckInodeAccess ( PEXT2_VCB  Vcb,
struct inode in,
int  attempt 
)

Definition at line 20 of file access.c.

21 {
22  int granted = 0;
23 
24  uid_t uid = Vcb->uid;
25  gid_t gid = Vcb->gid;
26 
27  if (IsFlagOn(Vcb->Flags, VCB_USER_EIDS)) {
28  uid = Vcb->euid;
29  gid = Vcb->egid;
30  }
31 
32  if (!uid || uid == in->i_uid) {
33  /* grant all access for inode owner or root */
35  } else if (gid == in->i_gid) {
36  if (Ext2IsGroupReadOnly(in->i_mode))
38  else if (Ext2IsGroupWritable(in->i_mode))
40  } else {
41  if (Ext2IsOtherReadOnly(in->i_mode))
43  else if (Ext2IsOtherWritable(in->i_mode))
45 
46  }
47 
48  return IsFlagOn(granted, attempt);
49 }
#define Ext2IsOtherReadOnly(m)
Definition: ext2fs.h:421
#define Ext2FileCanRead
Definition: ext2fs.h:426
#define Ext2FileCanExecute
Definition: ext2fs.h:428
#define Ext2IsGroupReadOnly(m)
Definition: ext2fs.h:417
long uid_t
Definition: various.h:8
UINT gid_t
Definition: types.h:89
#define IsFlagOn(a, b)
Definition: ext2fs.h:177
#define Ext2IsOtherWritable(m)
Definition: ext2fs.h:419
#define Vcb
Definition: cdprocs.h:1425
#define VCB_USER_EIDS
Definition: ext2fs.h:786
GLuint in
Definition: glext.h:9616
#define Ext2IsGroupWritable(m)
Definition: ext2fs.h:415
#define Ext2FileCanWrite
Definition: ext2fs.h:427

Referenced by Ext2CheckFileAccess(), and Ext2ProcessEntry().

Variable Documentation

◆ Ext2Global

PEXT2_GLOBAL Ext2Global

Definition at line 16 of file init.c.