I am hoping someone can help me figure out to to properly handle file
permissions. Let me outline
the situation I am trying to set up.
I have just gotten a HandSpring Visor, which connects via a USB port. (This
is not a question on
USB, or using JPilot, I already have all that stuff up and running. It really
is a question about
file permissions; I'm just using this as the concrete example because it is
the situation prompting
my question). The Visor connects for HotSyncing via /dev/ttyUSB1, which is
owned by root and in
group root; on my system the access privileges are rw-------.
Obviously, I don't want to be root just to sync my PDA. For my Palm IIIxe on
a serial connection to
/dev/cua0, I just (for expediency) made myself (nl) the owner of that device,
but I want to do a
more proper job now for the Visor.
What I did was to create a new group called visor on my system; I make it a
system group:
newgrp -r visor
and then added myself (nl) to that group (or added that group to myself,
depending on how you look
at it...) and then gave group the appropriate access (chmod g+rw
/dev/ttyUSB1).
Here is where my problem lies. When I log in, I am of course UID nl and GID
nl. If I newgrp visor,
then of course my GID becomes visor and I can access the PDA just fine. This
is inconvenient,
however, because when I run JPilot or KPIlot under KDE, these programs will
of course get my login
GID (nl) but that won't do the job.
I had originally thought, perhaps naively, that the way that file permissions
worked is that if you
are not the owner of a file, then if you had access to the group of the file
you could access it
via the group permissions, but it seems via my testing that only the current
group (eg the EGID)
seems to be looked at, not whatever groups you are allowed to change to via
/etc/groups.
The only solution that comes to mind so far is to create a shell script to
"wrapper" JPilot:
#! /bin/sh
newgrp visor
kpilot
newgrp
and change the link in KDE's menus to point to this script instead of
directly to the kpilot
program.
I am wondering if I am missing something or if there is a more elegant
solution that someone can
help me out with.
Thanks in advance.
Neal