linux-hotplug.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Scott Cuyle Fritzinger <scottf@med.unr.edu>
To: linux-hotplug@vger.kernel.org
Subject: Re: User-level Tasks in Hotplug Scripts?
Date: Sun, 03 Feb 2002 00:58:18 +0000	[thread overview]
Message-ID: <marc-linux-hotplug-101269768908520@msgid-missing> (raw)
In-Reply-To: <marc-linux-hotplug-101256895903801@msgid-missing>


Note: sorry for all the CC's. i've lost track of who is on what list. :P

> > > Is there anything wrong with the simplistic approach of having a demon
> > > listening on a socket? If you want it generic, you have to use generic
> > > means of communication.
> > You don't want to pass out permission to access your X server to anyone
> > who happens to ask for it (if you do, you've compromized everything,
> > or go down into compartmentalized workstation hell, someplace where we
> > went 10 years ago and found fundamentally painful).
> > So the issue is fundamentally one of authenticating
> > the configuration GUI's process to the X server to allow connection.
> There's no reason the listening demon has to be part of X, or is there ?
> An interrested user would start a task listening upon login.

The listener should definitely be left to the desktops, or as a background
process as login in the case of a non-X environment.

The hotplug backend might implement a generic configuration language.
We've done this with gPhoto by using some common widgets and it works
really well. we use it for configuration of camera settings (exposure,
lens modes, etc...). It supports menus, lists, radio buttons, text
entries, etc... all the standard widgets.

Perhaps it would all work something like this:

1) Desktop listener listens on a port/fifo/pipe/whatever...
2) User plugs device
3) Hotplug runs appropriate script ("init"). init would be whatever
hotplug does now.
4) Hotplug then runs script with "get_config" arg to retrieve the
configuration 'widgets' (written to stdout)
5) Hotplug then writes the configuration widgets to the
port/fifo/pipe/whatever, prefixed by a header that describes which device
this is for. For now, hotplug considers itself done.
6) User select settings, selects OK.
7) Desktop listener writes the updated configuration widgets to the
port/fifo/pipe/whatever
8) Hotplug then reads in the updated configuration widgets, then calls
the appropriate hotplug script with "set_config" arg (config items are
read from stdin).
9) Hotplug script handles the rest.

Now, if multiple hotplug scripts try to claim a device, perhaps hotplug
will write a configuration that lets the user select which script to use,
and then it continues with the chosen hotplug script. This is something
that came up when i brought this up earlier: what if jphoto and gphoto
both want to use the device? just let them run, or let the user decide? if
there is no listener, then perhaps they all should run. if there is a
listener, let the user decide.

security? make sure you only accept connections from a user who is locally
logged in (not remote), unless you configure it differently to allow
remote connections. this just needs to be developed further in a USB
security model. (local user = full permissions on all USB devices?) :P

-=Scott Fritzinger
  The gPhoto project
  www.gphoto.org


_______________________________________________
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

  parent reply	other threads:[~2002-02-03  0:58 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2002-02-01 13:09 User-level Tasks in Hotplug Scripts? Ryan Shaw
2002-02-01 23:58 ` David Brownell
2002-02-02 20:55 ` Jim Gettys
2002-02-02 22:02 ` Oliver Neukum
2002-02-02 22:12 ` Jim Gettys
2002-02-02 22:52 ` Oliver Neukum
2002-02-02 23:02 ` David Brownell
2002-02-03  0:58 ` Scott Cuyle Fritzinger [this message]
2002-02-03  8:36 ` Greg KH
2002-02-04  6:02 ` Dmitry Yu. Bolkhovityanov
2002-02-04 15:10 ` Jim Gettys
2002-02-04 19:28 ` Jim Carter
2002-02-05  3:32 ` David Brownell
2002-02-05 15:05 ` Ryan Shaw
2002-02-06 14:30 ` Marcus Harnisch
2002-02-06 14:54 ` Jim Gettys

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=marc-linux-hotplug-101269768908520@msgid-missing \
    --to=scottf@med.unr.edu \
    --cc=linux-hotplug@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).