40 size_t count, loff_t *ppos)
55 const int idx = tomoyo_read_lock();
79 cred->security = new_domain;
87 tomoyo_read_unlock(idx);
92 return error ? error :
count;
105 static ssize_t tomoyo_read_self(
struct file *file,
char __user *buf,
106 size_t count, loff_t *ppos)
108 const char *
domain = tomoyo_domain()->domainname->name;
111 if (pos >= len || !count)
124 .write = tomoyo_write_self,
125 .read = tomoyo_read_self,
136 static int tomoyo_open(
struct inode *
inode,
struct file *file)
138 const int key = ((
u8 *) file->
f_path.dentry->d_inode->i_private)
151 static int tomoyo_release(
struct inode *
inode,
struct file *file)
165 static unsigned int tomoyo_poll(
struct file *file,
poll_table *
wait)
180 static ssize_t tomoyo_read(
struct file *file,
char __user *buf,
size_t count,
196 static ssize_t tomoyo_write(
struct file *file,
const char __user *buf,
197 size_t count, loff_t *ppos)
211 .release = tomoyo_release,
214 .write = tomoyo_write,
240 static int __init tomoyo_initerface_init(
void)
242 struct dentry *tomoyo_dir;
249 tomoyo_create_entry(
"query", 0600, tomoyo_dir,
251 tomoyo_create_entry(
"domain_policy", 0600, tomoyo_dir,
253 tomoyo_create_entry(
"exception_policy", 0600, tomoyo_dir,
255 tomoyo_create_entry(
"audit", 0400, tomoyo_dir,
257 tomoyo_create_entry(
".process_status", 0600, tomoyo_dir,
259 tomoyo_create_entry(
"stat", 0644, tomoyo_dir,
261 tomoyo_create_entry(
"profile", 0600, tomoyo_dir,
263 tomoyo_create_entry(
"manager", 0600, tomoyo_dir,
265 tomoyo_create_entry(
"version", 0400, tomoyo_dir,
268 &tomoyo_self_operations);