Is it possible to set ACLs on a sysfs mount point?

1

I'd like to add the write access on /sys/power/state to my UID via ACLs, this way I'd don't need to use sudo or any setuid program to make my workstation go on sleepmode, is that possible ? I tried, following the man, and add this error :

➜  ~  sudo setfacl -m u:nelson:w /sys/power/state
setfacl: /sys/power/state: Invalid argument

It looks like what happened is not exactly what I meant,

Could someone enlighten me a little ? I don't understand why the setfacl command acted like it was writing something to the FIFO

user319425

Posted 2014-04-30T11:56:47.177

Reputation: 13

Answers

2

Setting an ACL on anything in /sys might not be possible. The sysfs filesystem was originally based on ramfs, which doesn't have support for extended ACL's.

I did an strace of the setfacl command, and just before the setxattr call which returns EINVAL, there is a getxattr call which gives the error that the operation is not supported:

getxattr("/sys/power/state", "system.posix_acl_access", 0x7fff4ab593c0, 132) = -1 EOPNOTSUPP (Operation not supported)

mtak

Posted 2014-04-30T11:56:47.177

Reputation: 11 805