FreeBSD src
Go to file
Robert Watson ea6027a8e1 Make similar changes to fo_stat() and fo_poll() as made earlier to
fo_read() and fo_write(): explicitly use the cred argument to fo_poll()
as "active_cred" using the passed file descriptor's f_cred reference
to provide access to the file credential.  Add an active_cred
argument to fo_stat() so that implementers have access to the active
credential as well as the file credential.  Generally modify callers
of fo_stat() to pass in td->td_ucred rather than fp->f_cred, which
was redundantly provided via the fp argument.  This set of modifications
also permits threads to perform these operations on behalf of another
thread without modifying their credential.

Trickle this change down into fo_stat/poll() implementations:

- badfo_poll(), badfo_stat(): modify/add arguments.
- kqueue_poll(), kqueue_stat(): modify arguments.
- pipe_poll(), pipe_stat(): modify/add arguments, pass active_cred to
  MAC checks rather than td->td_ucred.
- soo_poll(), soo_stat(): modify/add arguments, pass fp->f_cred rather
  than cred to pru_sopoll() to maintain current semantics.
- sopoll(): moidfy arguments.
- vn_poll(), vn_statfile(): modify/add arguments, pass new arguments
  to vn_stat().  Pass active_cred to MAC and fp->f_cred to VOP_POLL()
  to maintian current semantics.
- vn_close(): rename cred to file_cred to reflect reality while I'm here.
- vn_stat(): Add active_cred and file_cred arguments to vn_stat()
  and consumers so that this distinction is maintained at the VFS
  as well as 'struct file' layer.  Pass active_cred instead of
  td->td_ucred to MAC and to VOP_GETATTR() to maintain current semantics.

- fifofs: modify the creation of a "filetemp" so that the file
  credential is properly initialized and can be used in the socket
  code if desired.  Pass ap->a_td->td_ucred as the active
  credential to soo_poll().  If we teach the vnop interface about
  the distinction between file and active credentials, we would use
  the active credential here.

Note that current inconsistent passing of active_cred vs. file_cred to
VOP's is maintained.  It's not clear why GETATTR would be authorized
using active_cred while POLL would be authorized using file_cred at
the file system level.

Obtained from:	TrustedBSD Project
Sponsored by:	DARPA, NAI Labs
2002-08-16 12:52:03 +00:00
bin Bump document date for the -n option. 2002-08-16 03:13:59 +00:00
contrib Merge gcc.295/cccp.c,v 1.9: don't let gcc(1) hide warnings in system headers. 2002-08-15 08:45:49 +00:00
crypto Resolve conflicts. 2002-08-10 01:50:50 +00:00
etc I missed the single_mountd_enable in rc.network. 2002-08-15 03:29:19 +00:00
games Fix typos (s/seperat/separat/ et al); add FreeBSD ID. 2002-08-12 10:04:32 +00:00
gnu Removed the (never-released) FreeBSD 4.6.1. 2002-08-14 16:57:14 +00:00
include add a check for GNUC < 3 to typedef bool because gcc 3 always seems to 2002-08-16 07:33:14 +00:00
kerberos5 Bootstrapping aid for pre-getprogname(3) systems. 2002-08-13 16:52:52 +00:00
kerberosIV Drop support for COPY, -c has been the default mode of install(1) 2002-07-29 09:40:17 +00:00
lib Hide 'struct ucred' behind '#ifdef _KERNEL', this should stop userland 2002-08-16 07:01:43 +00:00
libexec Bump document date for the 'beep only' change. 2002-08-16 03:08:25 +00:00
release Collapsed the export list, added CD_EXTRA_BITS to it. 2002-08-14 16:50:50 +00:00
sbin sys/netinet/ip_fw2.c: 2002-08-16 10:31:47 +00:00
secure Update list of installed manual pages after regenerating them. 2002-07-30 14:47:24 +00:00
share Remove usbhidaction(1) manual page under SEE ALSO section. This will be 2002-08-16 05:01:11 +00:00
sys Make similar changes to fo_stat() and fo_poll() as made earlier to 2002-08-16 12:52:03 +00:00
tools Add regression tests for sysvipc. 2002-08-15 06:34:37 +00:00
usr.bin Forgot to change branches for my src tree. MFS my birthdate. 2002-08-16 09:41:07 +00:00
usr.sbin Remove a case of exposing 'struct ucred' to userspace. Use a struct xucred 2002-08-15 21:52:22 +00:00
COPYRIGHT Update to add the July 22, 1999 addendum. 1999-09-05 21:33:47 +00:00
MAINTAINERS Added groff(1) and natd(8) entries. 2002-07-18 12:12:15 +00:00
Makefile Indentation. 2002-07-20 10:01:00 +00:00
Makefile.inc1 The intent in rev. 1.299 was to make the CPUTYPE assignment type check 2002-08-08 15:43:23 +00:00
Makefile.upgrade Removed "env" commands. "sh" is a real shell, so 2002-03-19 05:58:36 +00:00
README Fix broken handbook links. 2002-07-21 16:45:30 +00:00
UPDATING Document the effect of contrib/gcc/c-lex.c,v 1.2 commit. 2002-08-15 08:51:24 +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
``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.

kerberosIV	KerberosIV (eBones) package.

lib		System libraries.

libexec		System daemons.

release		Release building Makefile & associated tools.

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