[lkml]   [2010]   [Feb]   [9]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
Messages in this thread
SubjectRe: [PWM PATCH 1/7] API to consolidate PWM devices behind a common user and kernel interface
Bill Gatliff wrote:
>>> +
>>> + p->requester = requester;
>>> + if (!strcmp(requester, REQUEST_SYSFS))
>>> + p->pid = current->pid;
>> This is new.. What's the reason for saving the pid?
> I've gotten complaints from those who say, "Ok, so it reported 'sysfs'
> back to me, but how can I be sure that it's because *I* own it now, and
> not another user process?" Seemed easy enough to add the PID so they
> can check. Of course, you could argue that I could report just the PID,
> and skip the "sysfs" string altogether. I'd be inclined to agree with you.
> Of course, if you are like me and do the request with cat(1), then the
> PID is pretty meaningless. :)

For the record, this request activity is mostly advisory. I can't
actually implement something where only the requester is subsequently
allowed to manipulate the state of the channel. You really wouldn't
want to even if it was possible, because then you'd probably lose the
ability to control the output using cat(1) and echo(1).

I'm just trying to provide a tool that allows users to Play Nice if they
choose to. In fact, it's currently possible to manipulate the state of
the channel from userspace without requesting ownership first. Not sure
I'm happy with that, but since I can't enforce any sort of access
restrictions it seems pointless to even go so far as to require ownership...


Bill Gatliff
Embedded systems training and consulting

 \ /
  Last update: 2010-02-10 05:21    [W:0.039 / U:0.028 seconds]
©2003-2018 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site