Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 29 Oct 2008 06:59:13 +0100
From:      Ed Schouten <ed@80386.nl>
To:        David Wolfskill <david@catwhisker.org>, current@freebsd.org
Subject:   Re: Apparent "permissions" issue with /dev/cuau0?
Message-ID:  <20081029055913.GE1165@hoeg.nl>
In-Reply-To: <20081029050917.GQ69155@bunrab.catwhisker.org>
References:  <20081029050917.GQ69155@bunrab.catwhisker.org>

next in thread | previous in thread | raw e-mail | index | archive | help

--FEz7ebHBGB6b2e8X
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
Content-Transfer-Encoding: quoted-printable

Hello David,

* David Wolfskill <david@catwhisker.org> wrote:
> This seems a bit weird to me.  I'll explain the context, then the
> perceived issue.
>=20
> I maintain a port (astro/gpsman) which can make use of a serial port to
> communicate with a GPS.
>=20
> The author of the program let me know earlier today that he had made a
> tarball of GPSman-6/4 available.  Accordingly, I started updating the
> port to use the new version.
>=20
> While I was doing that, I noticed that there's a stanza in the port's
> Makefile:
>=20
> .if ${OSVERSION} < 600000
> GPSMAN_DEFAULT_PORT?=3D   /dev/cuaa0
> .else
> GPSMAN_DEFAULT_PORT?=3D   /dev/cuad0
> .endif
>=20
> and I recalled that the MPSAFE TTY layer was recently committed to HEAD,
> and that the serial device names changed accordingly.  Thus, while it
> isn't actually essential (as the user can change the device name fairlly
> readily), I thought it would be reasonable to adjust that stanza so that
> folks installing GPSman on a recent CURRENT system would at least have a
> default value that matched something on their system.
>=20
> Accordingly, I changed my working copy to read:
>=20
> .if ${OSVERSION} < 600000
> GPSMAN_DEFAULT_PORT?=3D   /dev/cuaa0
> .elif ${OSVERSION} < 800045
> GPSMAN_DEFAULT_PORT?=3D   /dev/cuad0
> .else
> GPSMAN_DEFAULT_PORT?=3D   /dev/cuau0
> .endif

Yes. That seems to be okay. I think you could already remove the cuaa0
entry, because I'm not sure if we support RELENG_5 anyway?

> I then rebooted my laptop from the CURRENT slice and tried installing
> the (updated) port.
>=20
> The install was clean (as expected).  I found that I needed to move my
> old ~/.gpsman directory aside; on invocation, gpsman offered to create
> ~/.gpsman-dir (where it stashes various preferences).  I was mildly
> pleased to see that the default for the serial port showed up as
> /dev/cuau0 (as desired).
>=20
> I turned on my GPS, plugged it in, tried getting gpsman to talk to it,
> and got a complaint: GPSman said that I didn't have permission (I
> *think* that was its whine, anyway).  I looked; the device was:
>=20
> crw-rw----  1 uucp  dialer    0,  51 Oct 28 20:23 /dev/cuau0
>=20
> and output of id(1) verified that I was in group "dialer" (specifically
> so I could do this type of thing), as expected.
>
> [snip]
>=20
> I suppose I could try using ktrace(1) to get a better idea what's going
> on.  Any other (better?) ideas?

I think the best thing to try is to see what the error code is the
open() call on the TTY returned. EPERM is possible, but it's more likely
you got an ENXIO or EBUSY. You could add printf's to sys/kern/tty.c's
ttydev_open() to see where it falls through.

Another life saving tool is pstat(8). It gives you a list of TTY's on
the system. The `STATE' column should reveal some of the flags that are
currently set in the TTY, which is useful when looking through
ttydev_open(). You could also run `show all ttys' in DDB and use `show
tty <addr>' to dump all state of the TTY in question.

Please let me know if you discover any new issues/run into any problems.
Thanks!

--=20
 Ed Schouten <ed@80386.nl>
 WWW: http://80386.nl/

--FEz7ebHBGB6b2e8X
Content-Type: application/pgp-signature
Content-Disposition: inline

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.9 (FreeBSD)

iEYEARECAAYFAkkH+7EACgkQ52SDGA2eCwXf8QCfQNEv+310CrNRcu1zpa2c3bis
9icAnA9sN+1XxFlXM5cWBUHzYhG/e2g5
=Zk5L
-----END PGP SIGNATURE-----

--FEz7ebHBGB6b2e8X--



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20081029055913.GE1165>