Skip to contentSkip to conversation

sysfs permissions

PATCH New Maneesh Soni 1 participant 1 message May 31, 2005

lore
Share & tools
lore
#0 lore raw

cover sysfs permissions

Hi

Following this post, are the three patches implementing setattr functionality for sysfs objects. This allows sysfs objects to get their default attributes like owner, group, permission modes modified. The changed attributes are saved in a struct iattr linked with struct sysfs_dirent for the corresponding object. This keeps the inode attributes saved even if inode/dentry is evacuated due to memory pressure or umount. The struct iattr is allocated only for those sysfs objects for which inode attributes are getting changed.

I did the following test for verifying the patchset

[root@llm01 ~]# ls -l /sys/class/net/dummy0/address
-r--r--r-- 1 root root 4096 May 31 10:32 /sys/class/net/dummy0/address [root@llm01 ~]# chmod +w /sys/class/net/dummy0/address [root@llm01 ~]# ls -l /sys/class/net/dummy0/address
-rw-r--r-- 1 root root 4096 May 31 10:32 /sys/class/net/dummy0/address [root@llm01 ~]#
[root@llm01 ~]# chown maneesh /sys/class/net/dummy0/address [root@llm01 ~]# ls -l /sys/class/net/dummy0/address
-rw-r--r-- 1 maneesh root 4096 May 31 10:32 /sys/class/net/dummy0/address [root@llm01 ~]#
[root@llm01 ~]# chgrp maneesh /sys/class/net/dummy0/address [root@llm01 ~]# ls -l /sys/class/net/dummy0/address
-rw-r--r-- 1 maneesh maneesh 4096 May 31 10:32 /sys/class/net/dummy0/address [root@llm01 ~]#
[root@llm01 ~]# umount /sys
[root@llm01 ~]# ls -l /sys/class/net/dummy0/address
ls: /sys/class/net/dummy0/address: No such file or directory [root@llm01 ~]#
[root@llm01 ~]# mount -t sysfs none /sys
[root@llm01 ~]# ls -l /sys/class/net/dummy0/address
-rw-r--r-- 1 maneesh maneesh 4096 May 31 10:32 /sys/class/net/dummy0/address

Please review/test.

Thanks
Maneesh

Signature · 17 lines
Maneesh Soni
Linux Technology Center, 
IBM India Software Labs,
Bangalore, India
email: [email protected]
Phone: 91-80-25044990


-------------------------------------------------------
This SF.Net email is sponsored by Yahoo.
Introducing Yahoo! Search Developer Network - Create apps using Yahoo!
Search APIs Find out how you can build Yahoo! directly into your own
Applications - visit http://developer.yahoo.net/?fr=offad-ysdn-ostg-q22005
_______________________________________________
Linux-hotplug-devel mailing list  http://linux-hotplug.sourceforge.net
[email protected]
https://lists.sourceforge.net/lists/listinfo/linux-hotplug-devel