task_struct
i have written module which reads and write on /proc file and is working fine but want to use permissions with it when i make the function for permissions shown below its gives me error (basically i want every one could read the file but only root could write in it).
int my_permission(struct inode *inode, int op)
{
if(op == 4||(op == 2 && current->euid = 0)) //euid is not a member of task_struct
return 0;
return -EACCES;
}
const struct inode_operations my_iops = {
.permission = my_permission,
};
but its giving me error as follow:
/home/karan/practice/procf/testproc1.c: In function ‘my_permission’:
/home/karan/practice/procf/testproc1.c:50:32: error: ‘struct task_struct’ has no member named ‘euid'
I think there is other member in task_struct which points to user id . I am interested in solution as well as description of task_struct members field used for.
regards
karan
Last edited by karan2386; 02-02-2012 at 12:56 PM.
|