lkml.org 
[lkml]   [2011]   [Mar]   [4]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [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


\
 
 \ /
  Last update: 2011-03-04 07:07    [W:0.173 / U:82.476 seconds]
©2003-2018 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site