Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 10 Jan 2009 16:10:42 -0800
From:      perryh@pluto.rain.com
To:        uspoerlein@gmail.com
Cc:        freebsd-hackers@freebsd.org
Subject:   Re: /dev/dsp* & /dev/audio* devices not present
Message-ID:  <49693902.0x2OQspLPLnuQLwg%perryh@pluto.rain.com>
In-Reply-To: <20090110185135.GB83079@roadrunner.spoerlein.net>
References:  <20090107181032.GA2808@rebelion.Sisis.de> <1231398405.2842.1.camel@daemon2.partygaming.local> <20090108080708.GE1462@roadrunner.spoerlein.net> <4966e5b7.sTBBp%2BJY%2BDDMKG47%perryh@pluto.rain.com> <20090109204014.GA83381@keira.kiwi-computer.com> <496892aa.n9QVqyhWypsSmeIU%perryh@pluto.rain.com> <20090110185135.GB83079@roadrunner.spoerlein.net>

next in thread | previous in thread | raw e-mail | index | archive | help
Ulrich Spoerlein <gmail.com!uspoerlein@agora.rdrop.com> wrote:

> I cannot really comment on the devfs(4) design issues,
> and quite frankly it hasn't bothered my thus far.

It evidently inconvenienced the OP.

> Just another little quirk you get to remember.

If we followed that line of reasoning to its logical
conclusion we would eliminate POLA entirely.

> > IMO it violates POLA, if not POSIX, for open(2) to succeed when
> > applied to a name which, according to readdir(2), does not
> > exist; and it is suboptimal to have "stealth" drivers whose
> > availability for use cannot be discovered by examining /dev.
>
> You forgot directories with --x permissions. You can open many
> files inside them, but readdir(2) will get you nowhere. So this
> is a poor standard by which to judge devfs(4) device cloning.

There are at least two problems with that analysis:

* /dev does not ordinarily have --x permissions.  Even if I amended
  the principle to allow for that case, it would not affect its
  application to this case.

* readdir works for root, even in directories with --x permissions.
  For example:

  $ mkdir test
  $ touch test/file
  $ ls -la test
  total 4
  drwxr-xr-x  2 perryh  perryh  512 Jan 10 15:39 .
  drwxr-xr-x  3 perryh  perryh  512 Jan 10 15:39 ..
  -rw-r--r--  1 perryh  perryh    0 Jan 10 15:39 file
  $ chmod 111 test
  $ ls -ld test
  d--x--x--x  2 perryh  perryh  512 Jan 10 15:39 test
  $ ls -la test
  total 0
  ls: test: Permission denied

  # ls -la test
  total 4
  d--x--x--x  2 perryh  perryh  512 Jan 10 15:39 .
  drwxr-xr-x  3 perryh  perryh  512 Jan 10 15:39 ..
  -rw-r--r--  1 perryh  perryh    0 Jan 10 15:39 file



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?49693902.0x2OQspLPLnuQLwg%perryh>