Thread (32 messages) 32 messages, 6 authors, 2013-02-19

Re: SYSFS "errors"

From: Borislav Petkov <bp@alien8.de>
Date: 2013-02-19 12:35:10
Also in: linux-scsi, lkml, netdev

On Tue, Feb 19, 2013 at 09:16:10AM -0300, Mauro Carvalho Chehab wrote:
I'm not sure if is there a way to pass fs permissions to something similar
to device_create_file().
struct device_attribute.attr.mode? I.e., second arg.
On both cases, an error will happen at open:
	- if file doesn't exist (this approach), it will return -ENOENT;
	- if file is opened with wrong permissions, open will return -EPERM.

However, if the file is not created, readdir() won't show the file.
Right, and in that case userspace which *assumes* it is always created -
like it is now - will fail when accessing it.

If simply you adjust the attributes accordingly but *always* create the
file and it has the correct permissions, everyone is happy. Right?

-- 
Regards/Gruss,
    Boris.

Sent from a fat crate under my desk. Formatting is fine.
--
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help