freebsd kernel with SKQ
Go to file
Ed Schouten 0eee862a54 Don't make Linux stat() open character devices to resolve its name.
The existing code calls kern_open() to resolve the vnode of a pathname
right after a stat(). This is not correct, because it causes random
character devices to be opened in /dev. This means ls'ing a tape
streamer will cause it to rewind, for example. Changes I have made:

- Add kern_statat_vnhook() to allow binary emulators to `post-process'
  struct stat, using the proper vnode.

- Remove unneeded printf's from stat() and statfs().

- Make the Linuxolator use kern_statat_vnhook(), replacing
  translate_path_major_minor_at().

- Let translate_fd_major_minor() use vp->v_rdev instead of
  vp->v_un.vu_cdev.

Result:

	crw-rw-rw- 1 root root   0, 14 Feb 20 13:54 /dev/ptmx
	crw--w---- 1 root adm  136,  0 Feb 20 14:03 /dev/pts/0
	crw--w---- 1 root adm  136,  1 Feb 20 14:02 /dev/pts/1
	crw--w---- 1 ed   tty  136,  2 Feb 20 14:03 /dev/pts/2

Before this commit, ptmx also had a major number of 136, because it
silently allocated and deallocated a pseudo-terminal. Device nodes that
cannot be opened now have proper major/minor-numbers.

Reviewed by:	kib, netchild, rdivacky (thanks!)
2009-02-20 13:05:29 +00:00
bin Before this fix, pax would stop the restore sequence for 2009-02-01 06:15:46 +00:00
cddl Correct the sense of the "use32" terenary operator so that it uses 2009-01-16 22:16:54 +00:00
contrib Add an extra (void *) cast. The struct if_msghdr has an 8 byte 2009-02-18 19:59:27 +00:00
crypto Prevent cross-site forgery attacks on lukemftpd(8) due to splitting 2009-01-07 20:17:55 +00:00
etc Rename the rc.conf(5) knob if_up_delay to defaultroute_delay to better 2009-02-17 11:55:50 +00:00
games netcat is "now" in base, so point people at nc(1) instead of the port. 2009-01-12 19:17:43 +00:00
gnu Honor WITHOUT_INSTALLLIB in some places. 2009-02-13 16:51:36 +00:00
include sys/pccard is gone. 2009-02-15 11:05:50 +00:00
kerberos5 Add strndup(3) prototype to string.h. 2008-12-08 21:04:24 +00:00
lib These warnings are only relevant on NetBSD it seems. They don't seem 2009-02-19 19:53:58 +00:00
libexec o Fix typo: indentical -> identical. 2009-01-30 09:42:25 +00:00
release use /boot/loader by default, because the boot code seems to 2009-02-20 00:05:33 +00:00
rescue Take a moment to tidy some white space while I'm here. No functional 2008-09-13 19:56:37 +00:00
sbin Display an error message when the requested mode is not known. So the user can 2009-02-19 20:45:37 +00:00
secure Enable getaudit_addr(2) for sshd again. This will un-break the subject 2008-11-30 15:35:24 +00:00
share - Add glarkin and mva to mentor section 2009-02-20 02:48:58 +00:00
sys Don't make Linux stat() open character devices to resolve its name. 2009-02-20 13:05:29 +00:00
tools Doh! r188813 modified an auto-generated file. Fix it for real: 2009-02-20 11:09:55 +00:00
usr.bin Include proper header files for system functions that are used and 2009-02-19 20:07:59 +00:00
usr.sbin Include string.h for strncpy prototype 2009-02-19 19:45:49 +00:00
COPYRIGHT Bump the odometer of the years. A little early this year for 7.1R. 2008-12-30 04:46:25 +00:00
LOCKS Update LOCKS syntax. 2008-06-05 19:47:58 +00:00
MAINTAINERS Update description text 2008-06-06 21:32:01 +00:00
Makefile Permit digits at the beginning and end of kernel config file names for 2008-12-27 15:07:51 +00:00
Makefile.inc1 Implement an idea from Sam Leffler: 2009-01-23 18:23:16 +00:00
ObsoleteFiles.inc Add the pccard header files to ObsoleteFiles.inc. 2009-02-15 18:30:44 +00:00
README
UPDATING Rename the rc.conf(5) knob if_up_delay to defaultroute_delay to better 2009-02-17 11:55:50 +00:00

This is the top level of the FreeBSD source directory.  This file
was last revised on:
$FreeBSD$

For copyright information, please see the file COPYRIGHT in this
directory (additional copyright information also exists for some
sources in this tree - please see the specific source directories for
more information).

The Makefile in this directory supports a number of targets for
building components (or all) of the FreeBSD source tree, the most
commonly used one being ``world'', which rebuilds and installs
everything in the FreeBSD system from the source tree except the
kernel, the kernel-modules and the contents of /etc.  The ``world''
target should only be used in cases where the source tree has not
changed from the currently running version.  See:
http://www.freebsd.org/doc/en_US.ISO8859-1/books/handbook/makeworld.html
for more information, including setting make(1) variables.

The ``buildkernel'' and ``installkernel'' targets build and install
the kernel and the modules (see below).  Please see the top of
the Makefile in this directory for more information on the
standard build targets and compile-time flags.

Building a kernel is a somewhat more involved process, documentation
for which can be found at:
   http://www.freebsd.org/doc/en_US.ISO8859-1/books/handbook/kernelconfig.html
And in the config(8) man page.
Note: If you want to build and install the kernel with the
``buildkernel'' and ``installkernel'' targets, you might need to build
world before.  More information is available in the handbook.

The sample kernel configuration files reside in the sys/<arch>/conf
sub-directory (assuming that you've installed the kernel sources), the
file named GENERIC being the one used to build your initial installation
kernel.  The file NOTES contains entries and documentation for all possible
devices, not just those commonly used.  It is the successor of the ancient
LINT file, but in contrast to LINT, it is not buildable as a kernel but a
pure reference and documentation file.


Source Roadmap:
---------------
bin		System/user commands.

contrib		Packages contributed by 3rd parties.

crypto		Cryptography stuff (see crypto/README).

etc		Template files for /etc.

games		Amusements.

gnu		Various commands and libraries under the GNU Public License.
		Please see gnu/COPYING* for more information.

include		System include files.

kerberos5	Kerberos5 (Heimdal) package.

lib		System libraries.

libexec		System daemons.

release		Release building Makefile & associated tools.

rescue		Build system for statically linked /rescue utilities.

sbin		System commands.

secure		Cryptographic libraries and commands.

share		Shared resources.

sys		Kernel sources.

tools		Utilities for regression testing and miscellaneous tasks.

usr.bin		User commands.

usr.sbin	System administration commands.


For information on synchronizing your source tree with one or more of
the FreeBSD Project's development branches, please see:

  http://www.freebsd.org/doc/en_US.ISO8859-1/books/handbook/synching.html