summaryrefslogtreecommitdiff
path: root/lib/libutil/opendev.3
AgeCommit message (Collapse)Author
2022-08-26Backout "Only return file descriptors to block or character devices"Klemens Nanni
mount_mfs(8) no monger mounts "/build" with the following fstab(5) entry: /dev/sd0b /build mfs rw,noperm,nodev,nosuid,-s=2064348,noauto as found out by bluhm the hard way.
2022-08-25Only return file descriptors to block or character devicesKlemens Nanni
If the requested path contained a slash, opendev(3) blindly opened the file and returned a file descriptor to it. Check for block or character devices (according to OPENDEV_BLCK) and fail for other types. Spotted through installboot(8) which happily opened a stage file as device when forgetting the device argument: # installboot -v ./biosboot Using / as root installing bootstrap on ./biosboot using first-stage /usr/mdec/biosboot, second-stage /usr/mdec/boot installboot: disklabel: ./biosboot: Inappropriate ioctl for device This makes it fail earlier, as expected: # installboot -v ./biosboot installboot: open: ./biosboot: Block device required The case where opendev(3) is passed a string not containing a slash, i.e. a supposed DUID, is fine, as diskmap(4) will ensure that only valid device paths are returned, if the DUID is valid. Feedback OK millert
2015-01-15remove .Tn; from Jan Stary <hans at stare dot cz>Ingo Schwarze
2013-06-05use fancy .In macro for includes. from Jan Klemkow. ok jmc schwarzeTed Unangst
2011-01-03Update to better describe reality, i.e. disklabel(8) UID usage.Kenneth R Westerback
ok jmc@ jsing@
2010-12-17opendev() path argument should be const. OK deraadt@Todd C. Miller
2010-04-01WARNINGS -> CAVEATS, and a little neccessary cleanup;Jason McIntyre
2007-05-31convert to new .Dd format;Jason McIntyre
2007-02-06fix some dodgy displays;Jason McIntyre
2002-05-01o) start new sentence on a new line;Mike Pechkin
o) always close .Bl tags; o) fix usage of .Xr; millert@ ok
2002-04-30Initial cleanup:Mike Pechkin
o) remove extra space in the end of line; o) remove extra blank lines in the end of file; o) remove .Pp before .Ss; o) CAVEAT -> CAVEATS; o) fix usage of .Fa; o) <blank-line> -> .Pp; o) wrap long lines; millert@ ok
2002-02-26mdoc fixes from pjanzenPeter Valchev
2002-02-26rephrase warning; from miodPeter Valchev
2002-02-25print a warning that realpath points to internal static storage space thatPeter Valchev
will be overwritten by subsequent calls; suggested by pjanzen, ok millert
2000-05-01Document device lookup semantics.Hugh Graham
2000-04-30Add OPENDEV_BLCK flag for opening the block devices (the characterTodd C. Miller
device is opened by default). Don't open the file w/o adding a /dev/ prefix unless the file has a '/' in it. This prevents problems where someone says "disklabel sd0" with a file called "sd0" in the cwd. The OPENDEV_DRCT flag has been deprecated as it is the the default behavior and always has been. Add checks for >= MAXPATHLEN and return ENAMETOOLONG in that case.
1999-07-07The proper order of the ``introductory'' macros in a man page is .Dd/.Dt/.Os.Aaron Campbell
Out of the approximately 1450 man pages, only about 90 of them were wrong. Thanks to kwesterback@home.com for coming up with a script and patch to repair this. The patch also inserted a .Os macro in the few man pages that were missing one.
1999-07-02remove redundant .Pp macrosAaron Campbell
1999-05-27or'ing -> OR'ingAaron Campbell
1998-03-10use .OxTodd C. Miller
1996-06-20only write to realpath if non-NULLTheo de Raadt
1996-06-18oops, still missed a typoJason Downs
1996-06-18slight cleaningJason Downs
1996-06-17opendev.3: opendev(3) man pageJason Downs