Re: /proc file

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Tue, Jan 29, 2002 at 12:08:01PM -0500, Israel Fernandez wrote:
> Hi, I'm registering a /proc file like this:
> 
> create_proc_entry(PROC_FILE_NAME, S_IRUGO | S_IWUGO)
> 
> I expect I could write this file, I also register the file 
> inode_operations with a permission pointer containing this:
> 
> my_proc_permission (struct inode * inodep, int op){
>    if (op == 4 || (op == 2 && current->euid == 00))
>        return 0;
>    return -EACCES;
> }

Ehm *why*? This is not needed for procfs, the generic procfs code will
handle this for you. See my procfs HOWTO in Documentation/DocBook/ and
www.kernelnewbies.org.


Erik

-- 
J.A.K. (Erik) Mouw, Information and Communication Theory Group, Faculty
of Information Technology and Systems, Delft University of Technology,
PO BOX 5031, 2600 GA Delft, The Netherlands  Phone: +31-15-2783635
Fax: +31-15-2781843  Email: J.A.K.Mouw@its.tudelft.nl
WWW: http://www-ict.its.tudelft.nl/~erik/
--
Kernelnewbies: Help each other learn about the Linux kernel.
Archive:       http://mail.nl.linux.org/kernelnewbies/
IRC Channel:   irc.openprojects.net / #kernelnewbies
Web Page:      http://www.kernelnewbies.org/


[Index of Archives]     [Newbies FAQ]     [Linux Kernel Mentors]     [Linux Kernel Development]     [IETF Annouce]     [Git]     [Networking]     [Security]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux RAID]     [Linux SCSI]     [Linux ACPI]
  Powered by Linux