[cpia] A couple of CPiA patches
Nick Holloway
Nick.Holloway@pyrites.org.uk
4 Dec 2002 07:58:29 -0000
f.duncan.m.haldane@worldnet.att.net (Duncan Haldane) writes:
> The /proc/cpia/video0 belongs to me when I run gqcam to view the QX3 and
> reverts to root when I close it. I dont know how this "magic"
> occurs. (This is RedHat 7.3) But I think it is (usually) standard
The magic is in "cpia.c".
cpia_open():
/* Set ownership of /proc/cpia/videoX to current user */
if(cam->proc_entry)
cam->proc_entry->uid = current->uid;
cpia_close():
/* Return ownership of /proc/cpia/videoX to root */
if(cam->proc_entry)
cam->proc_entry->uid = 0;
--
`O O' | Nick.Holloway@pyrites.org.uk
// ^ \\ | http://www.pyrites.org.uk/