luigi [Thu, 24 Oct 2002 17:59:58 +0000 (17:59 +0000)]
Fix a bug in MAKEDEV -- when creating /dev/usb, the code was using
whatever random value was already in $unit. It happened to work
because the variable is often unset, but this is not always the
case e.g. when you call "MAKEDEV sio2 usb ..."
This affects -stable as well.
Reviewed by: n_hibma
Silence from: re
MFC after: 3 days
rwatson [Thu, 24 Oct 2002 17:21:40 +0000 (17:21 +0000)]
Provide kernel options for the various MAC policy modules so that
they may be statically linked into the kernel. Note that statically
linked modules, unlike dynamically linked modules, get INVARIANTS,
so if there are INVARIANTS failures, you'll bump into them rather
than not. Add the options to NOTES.
rwatson [Thu, 24 Oct 2002 16:19:52 +0000 (16:19 +0000)]
Have ftpd specify the LOGIN_SETMAC flag to setlogincontext() so that
MAC labels are set if MAC is enabled and configured for the user
logging in.
Note that lukemftpd is not considered a supported application when
MAC is enabled, as it does not use the standard system interfaces for
managing user contexts; if lukemftpd is used with labeled MAC policies,
it will not properly give up privileges when switching to the user
account.
rwatson [Thu, 24 Oct 2002 15:46:10 +0000 (15:46 +0000)]
# WARNING: lukemftpd does not support PAM, MAC, per-class nologin files,
# or any login.conf resource limits or features; use it only if this is
# appropriate for your environment. If you require these features, use
# the regular FreeBSD ftpd below.
Discourage users from using lukemftpd if they rely any of these standard
FreeBSD features that are fully supported by our native ftpd. There
may be other features that are not yet supported that I have not yet
discovered.
jmallett [Thu, 24 Oct 2002 12:57:42 +0000 (12:57 +0000)]
When expanding a specific [1-char] variable, only expand said specific
[1-char] variable. Don't just automatically expand something which
starts with that character.
sheldonh [Thu, 24 Oct 2002 12:57:05 +0000 (12:57 +0000)]
* Modernize aio(4), providing instructions for static and dynamic kernel
linking.
* Fix disorder in the SEE ALSO sections of aio_*(2).
* Remove unnecessary cross-references from the SEE ALSO sections of
aio_*(2); config(8), kldload(8) and kldunload(8) are cross-referenced
from aio(4).
* Remove the KERNEL OPTIONS sections from aio_*(2), now that these
pages cross-reference aio(4), which contains suitable kernel linking
reference material.
iwasaki [Thu, 24 Oct 2002 10:56:33 +0000 (10:56 +0000)]
Add new loader tunable hw.acpi.ec.event_driven so that we control
EcWaitEventIntr()'s behavior.
Some EC controllers require this for working properly (including
sleep/wakeup).
julian [Thu, 24 Oct 2002 08:46:34 +0000 (08:46 +0000)]
Move thread related code from kern_proc.c to kern_thread.c.
Add code to free KSEs and KSEGRPs on exit.
Sort KSE prototypes in proc.h.
Add the missing kse_exit() syscall.
jeff [Thu, 24 Oct 2002 07:59:03 +0000 (07:59 +0000)]
- Now that uma_zalloc_internal is not the fast path don't be so fussy about
extra function calls. Refactor uma_zalloc_internal into seperate functions
for finding the most appropriate slab, filling buckets, allocating single
items, and pulling items off of slabs. This makes the code significantly
cleaner.
- This also fixes the "Returning an empty bucket." panic that a few people
have seen.
marcel [Thu, 24 Oct 2002 07:53:12 +0000 (07:53 +0000)]
o Fix a size calculation based on a 8KB page, while under EFI
pages are 4KB.
o As a second order fix, don't assume we have enough space
after the bootinfo block left in a page to hold the memory
map.
o A third order fix as that we removed the assumption that a
bootinfo block fits in a single 8KB page.
jeff [Thu, 24 Oct 2002 06:17:30 +0000 (06:17 +0000)]
- Move the destructor calls so that they are not called with the zone lock
held. This avoids a lock order reversal when destroying zones.
Unfortunately, this also means that the free checks are not done before
the destructor is called.
jmallett [Thu, 24 Oct 2002 04:10:55 +0000 (04:10 +0000)]
Duplicate the variable name in the v->name field, as otherwise it points to
data that will be modified. And do the appropriate thing now and free the
v->name buffer along with other relinquished memory.
XXX There is duplication here of destroying a Var, which is probably bogus,
and probably missed in a few places.
tjr [Thu, 24 Oct 2002 02:53:45 +0000 (02:53 +0000)]
Replace wcsstr() with an implementation based on strstr(), which is far
more efficient. The problem with the previous implementation was that it
calculated the length of the first argument ("big") with wcslen() when
it was not necessary.
iedowse [Thu, 24 Oct 2002 02:02:34 +0000 (02:02 +0000)]
Unbreak the automatic remapping of an INADDR_ANY destination address
to the primary local IP address when doing a TCP connect(). The
tcp_connect() code was relying on in_pcbconnect (actually in_pcbladdr)
modifying the passed-in sockaddr, and I failed to notice this in
the recent change that added in_pcbconnect_setup(). As a result,
tcp_connect() was ending up using the unmodified sockaddr address
instead of the munged version.
There are two cases to handle: if in_pcbconnect_setup() succeeds,
then the PCB has already been updated with the correct destination
address as we pass it pointers to inp_faddr and inp_fport directly.
If in_pcbconnect_setup() fails due to an existing but dead connection,
then copy the destination address from the old connection.
rwatson [Thu, 24 Oct 2002 01:01:53 +0000 (01:01 +0000)]
Attempt improved use of fts results: use the correct path to the
object to retrieve label information on, rather than directly
consuming the fts-provided paths (none of which are quite right).
This is based on the similar readlink() code, and may contain
the same bugs.
chris [Thu, 24 Oct 2002 01:01:29 +0000 (01:01 +0000)]
mac_free() no longer accepts a void * parameter; only mac_t's are supposed
to be passed. Point this out in a warning notice, which will eventually
go away, sometime between now and -RELEASE.
Obtained from: TrustedBSD Project
Sponsored by: DARPA, NAI Labs
rwatson [Thu, 24 Oct 2002 00:07:30 +0000 (00:07 +0000)]
Teach "ls -Z" to use the policy-agnostic MAC label interfaces rather
than the LOMAC-specific interfaces for listing MAC labels. This permits
ls to view MAC labels in a manner similar to getfmac, when ls is used
with the -l argument. Next generation LOMAC will use the MAC Framework
so should "just" work with this and other policies. Not the prettiest
code in the world, but then, neither is ls(1).
rwatson [Thu, 24 Oct 2002 00:00:57 +0000 (00:00 +0000)]
Use the MAC interface to list process MAC labels rather than using
the LOMAC-specific interface (which is being deprecated). The
revised LOMAC using the MAC framework will export levels listable
using this mechanism.
rwatson [Wed, 23 Oct 2002 23:36:27 +0000 (23:36 +0000)]
Provide a simple sample labeled access control policy, mac_partition.
This policy can be loaded dynamically, and assigns each process a
partition number, as well as permitting processes to operate outside
the partition. Processes contained in a partition can only "see"
processes inside the same partition, so it's a little like jail.
The partition of a user can be set using the label mechanisms in
login.conf. This sample policy is a good starting point for developers
wanting to learn about how to produce labeled policies, as it labels
only one kernel object, the process credential.
rwatson [Wed, 23 Oct 2002 23:36:26 +0000 (23:36 +0000)]
Provide a simple sample labeled access control policy, mac_partition.
This policy can be loaded dynamically, and assigns each process a
partition number, as well as permitting processes to operate outside
the partition. Processes contained in a partition can only "see"
processes inside the same partition, so it's a little like jail.
The partition of a user can be set using the label mechanisms in
login.conf. This sample policy is a good starting point for developers
wanting to learn about how to produce labeled policies, as it labels
only one kernel object, the process credential.
jmallett [Wed, 23 Oct 2002 23:16:43 +0000 (23:16 +0000)]
Remove efree(), it isn't used consistently enough to even pretend that it
might help on the systems it could possibly be used as a bandaid for. In
fact, the only thing it's useful for is instrumenting free(3) calls, and in
that capacity, it's better served as a local patch, than a public wrapper.
rwatson [Wed, 23 Oct 2002 22:50:04 +0000 (22:50 +0000)]
Rename ifconfig's "mac" argument to "maclabel" to prevent confusion
regarding 802.1 MAC and Mandatory Access Control (MAC). Some
potential for confusion remains further in other areas of the
system regarding Message Authentication Codes (MAC).
phk [Wed, 23 Oct 2002 21:05:42 +0000 (21:05 +0000)]
More lobotomy:
remove CHUNK_BSD_COMPAT, it was a bad idea, and now its gone.
remove DOSPTYP_ONTRACK, missed in OnTrack removal commit.
unifdef -DHAVE_GEOM
make tst01 compile again.
phk [Wed, 23 Oct 2002 20:15:10 +0000 (20:15 +0000)]
Rely on sysctl kern.disks to be there, and get rid of one of the far too
many lists of disk device driver names in the system. At this point
we should really get the names from the XML, but hey...
jhb [Wed, 23 Oct 2002 15:53:09 +0000 (15:53 +0000)]
- New-bussify the rc(4) device driver.
- Add detach support to the driver so that you can kldunload the module.
Note that currently rc_detach() fails to detach a unit if any of its
child devices are open, thus a kldunload will fail if any of the tty
devices are currently open.
- sys/i386/isa/ic/cd180.h was moved to sys/dev/ic/cd180.h as part of
this change.
tjr [Wed, 23 Oct 2002 10:52:04 +0000 (10:52 +0000)]
Reimplement more efficiently, using a single forward scan (like strrchr(3))
instead of scanning forwards to find the end of the string then scanning
backwards to find the character.
tjr [Wed, 23 Oct 2002 10:16:21 +0000 (10:16 +0000)]
Add a Standards section, claiming conformance to IEEE Std. 1003.1-2001.
Also add a note to the Bugs section pointing out that strerror() and
perror() share the same static buffer.