Messages in this thread |  | | | Date | Fri, 4 Mar 2011 07:05:46 +0100 | | From | Richard Cochran <> | | Subject | Re: [patch 28/28] posix clocks: Introduce dynamic clocks |
| |
On Thu, Mar 03, 2011 at 06:07:59PM +0100, torbenh wrote: > On Thu, Mar 03, 2011 at 05:01:14PM +0100, Richard Cochran wrote: > > > > You are right, but I think the check should be for the capability > > instead. Checking the file mode for RDWR seems a bit pedantic to me. > > i dont see, why an fd based clock, which already has associated permissions, > should check against the capability. > why should the ptpd be running as root ? > changing the permissions of /dev/ptp0 to allow ptpd to set the > clock should be enough.
Thinking a bit more about this, I can see three options:
1. Enfore CAP_SYS_TIME in the posix dynamic clock layer.
2. Defer the CAP_SYS_TIME check to the underlying dynamic clock. That puts the decision of whether a clock counts as a "system clock" to the author of the driver.
3. As you suggest, just use file read/write as get/set permissions.
The admin can still restrict device node ownership and read access in any case. You could event combine these methods (1 and 3, or 1 and 2) but I think that would only lead to user confusion.
I am not opinionated about this, but I would like to gather some feedback before going forward. The implementation is easy in any case.
Thanks,
Richard
|  |