From mboxrd@z Thu Jan 1 00:00:00 1970 From: Vladimir Dergachev Date: Tue, 05 Feb 2002 04:49:12 +0000 Subject: Re: [Xpert]Re: User-level Tasks in Hotplug Scripts? Message-Id: List-Id: References: In-Reply-To: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: linux-hotplug@vger.kernel.org On Tue, 5 Feb 2002, Oliver Neukum wrote: > > > > > Jim, if the user is logged in so is the rest of the user interface. Why > > not have a monitoring program (like console) that watches the hotplug > > events and invokes corresponding configuration program ? This would also > > allow for various user environments to customize configuration tools to > > match their look. > > That solution is not in itself sufficient. You might not want everybody > to see all hotplug events. I think it is. It is not very hard to to setup permission policy.. For example you can only allow this to users who are able to login at the console and not remotely. (By using GiveConsole/TakeConsole for xdm/kdm/gdm for example). I am sure you can get by with usual permissions based fifo in most if not all situations. However it is not difficult to devise a way more generic scheme than would ever be useful.. Say: have /var/hotplug/fifo/classX be fifos for different classes of events. Have /sbin/hotplug filter incoming events and echo them into these fifos. Have these fifos only accessible by root (or whatever /sbin/hotplug runs under). Write a simple daemon that monitors classX fifos and also /var/hotplug/fifo/command and passes the events onto a Unix socket on localhost.. make it named if like :) /var/hotplug/events for example. So, GiveConsole determines whether the user deserves access to classX events and if yes echo something like this: give_access classX 'xserver full displayname' A45GF_md5_random into command fifo and sets "CLASSX_ACCESS_CODE" property on the root window to A45GF_md5_random (with X being replaced by the class number). The monitor app reads off these codes and passes them the daemon which then uses them to actually enable passthru of messages. When the server closes the root window gets destroyed and TakeConsole echos the following: revoke_access 'xserver full displayname' to allow the daemon to discard codes that will no longer be used. So, here, it was long and overcomplicated but I don't see how you may want something more flexible than this. Vladimir Dergachev > > Regards > Oliver > _______________________________________________ Linux-hotplug-devel mailing list http://linux-hotplug.sourceforge.net Linux-hotplug-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/linux-hotplug-devel