/daten/src/linux-2.4.27-rsbac-v1.2.3/include/rsbac/fs.h

Go to the documentation of this file.
00001 /************************************* */ 00002 /* Rule Set Based Access Control */ 00003 /* Author and (c) 1999-2004: Amon Ott */ 00004 /* File system */ 00005 /* helper functions for all parts */ 00006 /* Last modified: 30/Apr/2004 */ 00007 /************************************* */ 00008 00009 #ifndef __RSBAC_FS_H 00010 #define __RSBAC_FS_H 00011 00012 #include <linux/fs.h> 00013 #if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,0) 00014 #include <linux/major.h> 00015 #include <linux/root_dev.h> 00016 #include <linux/sched.h> 00017 #endif 00018 00019 /* original lookup_dentry function without rsbac patch for adf call */ 00020 00021 struct dentry * rsbac_lookup_hash(struct qstr *name, struct dentry * base); 00022 struct dentry * rsbac_lookup_one_len(const char * name, struct dentry * base, int len); 00023 00024 #ifndef SOCKFS_MAGIC 00025 #define SOCKFS_MAGIC 0x534F434B 00026 #endif 00027 00028 #if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,0) 00029 #ifndef SYSFS_MAGIC 00030 #define SYSFS_MAGIC 0x62656572 00031 #endif 00032 #endif 00033 00034 struct super_block * rsbac_get_super_block(kdev_t kdev); 00035 00036 extern void __fput(struct file *); 00037 00038 #ifndef SHM_FS_MAGIC 00039 #define SHM_FS_MAGIC 0x02011994 00040 #endif 00041 00042 #if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,0) 00043 static inline int init_private_file(struct file *filp, struct dentry *dentry, int mode) 00044 { 00045 memset(filp, 0, sizeof(*filp)); 00046 filp->f_mode = mode; 00047 atomic_set(&filp->f_count, 1); 00048 filp->f_dentry = dentry; 00049 filp->f_uid = current->fsuid; 00050 filp->f_gid = current->fsgid; 00051 filp->f_op = dentry->d_inode->i_fop; 00052 #if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,2) 00053 filp->f_mapping = dentry->d_inode->i_mapping; 00054 file_ra_state_init(&filp->f_ra, filp->f_mapping); 00055 #endif 00056 if (filp->f_op->open) 00057 return filp->f_op->open(dentry->d_inode, filp); 00058 else 00059 return 0; 00060 } 00061 #endif 00062 00063 #endif

Generated on Tue Aug 31 10:05:22 2004 for RSBAC by doxygen 1.3.8