diff options
| author | Patrick Mochel <mochel@osdl.org> | 2002-11-19 01:33:36 -0600 |
|---|---|---|
| committer | Patrick Mochel <mochel@osdl.org> | 2002-11-19 01:33:36 -0600 |
| commit | 0de8c962cef577f348c28438918ee91bf1187bbc (patch) | |
| tree | a00464c49ff5a5360cea4a300d37ea42b450e163 /include | |
| parent | bb4be78ad606eb5d9dce29ab089b4dc0253886be (diff) | |
sysfs: do permission checking on open.
sysfs has always had a bug that would allow a read-only file to be opened
for writing. It has also returned 0 on write when there was no store method
defined for the file.
This addresses both via sysfs_open_file(). It checks the flags the file was
opened with and compares them with the mode of the inode. If the mode does
not support the flags passed, -EPERM is returned.
If the sysfs_ops for the object does not have the correct method for the
flags, -EACCESS is returned.
Since all checks happen on open(), the corresponding checks in the read()
and write() methods have been removed.
Diffstat (limited to 'include')
0 files changed, 0 insertions, 0 deletions
