NetBSD/external
dholland 723d09ce8e Add containment for the cloning devices hack in vn_open.
Cloning devices (and also things like /dev/stderr) work by allocating
a struct file, stuffing it in the file table (which is a layer
violation), stuffing the file descriptor number for it in a magic
field of struct lwp (which is gross), and then "failing" with one of
two magic errnos, EDUPFD or EMOVEFD.

Before this commit, all callers of vn_open in the kernel (there are
quite a few) were expected to check for these errors and handle the
situation. Needless to say, none of them except for open() itself did,
resulting in internal negative errnos being returned to userspace.

This hack is fairly deeply rooted and cannot be eliminated all at
once. This commit adds logic to handle the magic errnos inside
vn_open; now on success vn_open returns either a vnode or an integer
file descriptor, along with a flag that says whether the underlying
code requested EDUPFD or EMOVEFD. Callers not prepared to cope with
file descriptors can pass NULL for the extra return values, in which
case if a file descriptor would be produced vn_open fails with
EOPNOTSUPP.

Since I'm rearranging vn_open's signature anyway, stop exposing struct
nameidata. Instead, take three arguments: an optional vnode to use as
the starting point (like openat()), the path, and additional namei
flags to use, restricted to NOCHROOT and TRYEMULROOT. (Other namei
behavior, e.g. NOFOLLOW, can be requested via the open flags.)

This change requires a kernel bump. Ride the one an hour ago.
(That was supposed to be coordinated; did not intend to let an hour
slip by. My fault.)
2021-06-29 22:40:53 +00:00
..
apache2 Remove files no longer used by 249b40b558955afe5ac2b549edcf2d7f859c8cc9 2021-05-30 02:58:06 +00:00
atheros
broadcom Make Raspberry PI 3 Model A+ use bwfm config for Model B+ 2021-02-09 11:57:20 +00:00
bsd fix sun2 build 2021-06-18 13:57:52 +00:00
cddl Add containment for the cloning devices hack in vn_open. 2021-06-29 22:40:53 +00:00
gpl2 PR/56256: Germain: cvs info doc incorrect for update -D 2021-06-21 02:48:01 +00:00
gpl3 PR toolchain/56180. Additional to yesterday's commit in gcc, also needed in 2021-06-29 08:51:03 +00:00
historical From wajap at github: 2020-11-02 22:58:51 +00:00
ibm-public use -fcommon where necessary. 2021-04-12 03:57:06 +00:00
intel-fw-eula
intel-fw-public
lgpl3 Copied from mips64el 2021-04-25 23:58:23 +00:00
mit don't install the libuv.pc file for pic (but private) libs as well. 2021-06-18 22:12:02 +00:00
mpl merge local changes between dhcp-4.4.2 and dhcp-4.4.2-P1 2021-05-26 22:52:31 +00:00
nvidia-firmware
ofl also check MKX11FONTS before installing fonts. 2020-11-14 04:32:44 +00:00
public-domain new GCC_NO_* uses for warning issues. most of the users of the new 2021-04-12 06:08:30 +00:00
realtek
zlib/pigz
Makefile Hook up font-liberation-ttf to the build. 2020-11-12 22:28:02 +00:00
README Delete trailing whitespace 2020-11-10 11:00:02 +00:00

README

$NetBSD: README,v 1.18 2020/11/10 11:00:02 gson Exp $

Organization of Sources:

This directory hierarchy is using an organization that separates
source for programs that we have obtained from external third
parties (where NetBSD is not the primary maintainer) from the
system source.

The hierarchy is grouped by license, and then package per license,
and is organized as follows:

	external/

	    Makefile
			Descend into the license sub-directories.

	    <license>/
			Per-license sub-directories.

		Makefile
			Descend into the package sub-directories.

		<package>/
			Per-package sub-directories.

		    Makefile
			Build the package.

		    dist/
			The third-party source for a given package.

		    bin/
		    lib/
		    sbin/
			BSD makefiles "reach over" from these into
			"../dist/".

This arrangement allows for packages to be easily disabled or
excised as necessary, either on a per-license or per-package basis.

The licenses currently used are:

	apache2		Apache 2.0 license.
			http://www.opensource.org/licenses/apache2.0.php

	atheros		Atheros License.

	bsd		BSD (or equivalent) licensed software, possibly with
			the "advertising clause".
			http://www.opensource.org/licenses/bsd-license.php

	cddl		Common Development and Distribution License (the sun
			license which is based on the Mozilla Public License
			version 1.1).
			http://www.opensource.org/licenses/cddl1.php

	gpl2		GNU Public License, version 2 (or earlier).
			http://www.opensource.org/licenses/gpl-2.0.php

	gpl3		GNU Public License, version 3.
			http://www.opensource.org/licenses/gpl-3.0.html

	historical	Lucent's old license:
			http://www.opensource.org/licenses/historical.php

	ibm-public	IBM's public license:
			http://www.opensource.org/licenses/ibmpl.php

	intel-fw-eula	Intel firmware license with redistribution
			restricted to OEM.

	intel-fw-public	Intel firmware license permitting redistribution with
			terms similar to BSD licensed software.

	intel-public	Intel license permitting redistribution with
			terms similar to BSD licensed software.

	mit		MIT (X11) style license.
			http://www.opensource.org/licenses/mit-license.php

	mpl		Mozilla Public license.
			https://opensource.org/licenses/MPL-2.0

	nvidia-firmware	NVIDIA firmware license permitting redistribution for
			use on operating systems distributed under the terms
			of an OSI-approved open source license.

	public-domain	Non-license for code that has been explicitly put
			into the Public Domain.

	realtek		RealTek license.

	zlib		Zlib (BSD-like) license.
			http://www.zlib.net/zlib_license.html

If a package has components covered by different licenses
(for example, GPL2 and the LGPL), use the <license> subdirectory
for the more restrictive license.

If a package allows the choice of a license to use, we'll
generally use the less restrictive license.

If in doubt about where a package should be located, please
contact <core@NetBSD.org> for advice.


Migration Strategy:


Eventually src/dist (and associated framework in other base source
directories) and src/gnu will be migrated to this hierarchy.


Maintenance Strategy:

The sources under src/external/<license>/<package>/dist/ are
generally a combination of a published distribution plus changes
that we submit to the maintainers and that are not yet published
by them.

Make sure all changes made to the external sources are submitted
to the appropriate maintainer, but only after coordinating with
the NetBSD maintainers.