ume [Fri, 25 Oct 2002 16:24:28 +0000 (16:24 +0000)]
- kill strcpy
- port range check need to be done before htons. from deraadt
- %d/%u audit
- correct bad practice in the code - it uses two changing variables
to manage buffer (buf and buflen). we eliminate buflen and use
fixed point (ep) as the ending pointer.
- use snprintf, not sprintf
- pass correct name into q.name. from lukem@netbsd
- sync comment
jake [Fri, 25 Oct 2002 16:00:47 +0000 (16:00 +0000)]
Greatly improve readability of trap() by using a table to convert between
trap types and signals to send. Rearrange KASSERTs to better handle faults
early before curthread is setup, or in the case that it gets corrupted or
set to 0.
thomas [Fri, 25 Oct 2002 15:16:54 +0000 (15:16 +0000)]
Add a new /etc/periodic/security script to check for packets
rejected by ipfilter (510.ipfdenied), and a corresponding periodic.conf
knob (daily_status_security_ipfdenied_enable).
imp [Fri, 25 Oct 2002 07:02:52 +0000 (07:02 +0000)]
Use the correct values for LDBL_*. Libc doesn't completely support
long doubles at the moment (printf truncates them to doubles).
However, long doubles to appear to work to the ranges listed in this
commit on both -stable (4.5) and -current. There may be some slight
rounding issues with long doubles, but that's an orthogonal issue to
these constants.
I've had this in my local tree for 3 months, and in my company's local
tree for 15 months with no ill effects.
marcel [Fri, 25 Oct 2002 05:23:08 +0000 (05:23 +0000)]
Add the functionality to create an (empty) GPT from scratch. The
code is directly copied from migrate.c. The intend is to express
migrate in terms of create and add. The functionality to add
partitions is not yet there.
njl [Fri, 25 Oct 2002 01:17:32 +0000 (01:17 +0000)]
The FTP connection caching needs a better interface -- connections are
closed through _fetch_close() which is the only one who knows the connection
REALLY was closed (since ref -> 0). However, FTP keeps its own local
cached_connection and checks if it is valid by comparing it to NULL. This
is bogus since it may have been freed elsewhere by _fetch_close().
This change checks if we are closing the cached_connection and the ref is 1
(soon to be 0). If so, set cached_connection to NULL so we don't
accidentally reuse it. The REAL fix should be to move connection caching
to the common.c level (_fetch_* functions) and NULL the cache(s) in
_fetch_close(). Then all layers could benefit from caching.
mckusick [Fri, 25 Oct 2002 00:20:37 +0000 (00:20 +0000)]
Within ufs, the ffs_sync and ffs_fsync functions did not always
check for and/or report I/O errors. The result is that a VFS_SYNC
or VOP_FSYNC called with MNT_WAIT could loop infinitely on ufs in
the presence of a hard error writing a disk sector or in a filesystem
full condition. This patch ensures that I/O errors will always be
checked and returned. This patch also ensures that every call to
VFS_SYNC or VOP_FSYNC with MNT_WAIT set checks for and takes
appropriate action when an error is returned.
julian [Thu, 24 Oct 2002 23:09:48 +0000 (23:09 +0000)]
Extract out KSE specific code from machine specific code
so that there is ony one copy of it. Fix that one copy
so that KSEs with no mailbox in a KSE program are not a cause
of page faults (this can legitmatly happen).
gallatin [Thu, 24 Oct 2002 18:41:02 +0000 (18:41 +0000)]
Document the (alpha only) "out of memory" and "PT_LOAD: too few segments"
problems with the new groff and mention possible workarounds for people
buildworlding to current.
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).