On Tuesday 12 April 2011, Alexander Polakov wrote: > I am probably misunderstanding something, but are DUID's supposed to be > used in place of device filenames in fstab? I suppose they are, > so this looks strange to me: > > % sudo mount f777cc5bbeded528.a > mount: can't find fstab entry for f777cc5bbeded528.a. > > % grep f777 /etc/fstab > f777cc5bbeded528.a /home ffs rw,nodev,nosuid,noauto 0 0 > > I have got a diff.
Nice find - thanks. I've committed your diff (minus the errx whitespace changes). A similar fix probably should be applied to umount(8), however from a quick glance at the code this will be considerably harder (and/or may need kernel changes). > Index: sbin/mount/mount.c > =================================================================== > RCS file: /cvs/src/sbin/mount/mount.c,v > retrieving revision 1.51 > diff -u -r1.51 mount.c > --- sbin/mount/mount.c 6 Apr 2011 11:36:26 -0000 1.51 > +++ sbin/mount/mount.c 11 Apr 2011 21:56:38 -0000 > @@ -232,9 +232,11 @@ > mntonname = mntbuf->f_mntonname; > } else { > if ((fs = getfsfile(mntpath)) == NULL && > - (fs = getfsspec(mntpath)) == NULL) > - errx(1, "can't find fstab entry for %s.", > - *argv); > + (fs = getfsspec(mntpath)) == NULL && > + (isduid(*argv, 0) == 0 || > + (fs = getfsspec(*argv)) == NULL)) > + errx(1, "can't find fstab entry for > %s.", > + *argv); > if (BADTYPE(fs->fs_type)) > errx(1, "%s has unknown file system type.", > *argv); -- "Reason is not automatic. Those who deny it cannot be conquered by it. Do not count on them. Leave them alone." -- Ayn Rand