Ian Dowse [Mon, 9 Feb 2004 00:10:18 +0000 (00:10 +0000)]
Fix a typo that stopped ypset's -h option from working with a
hostname rather than an IP. The code was copying the pointer to the
IP address instead of the IP address itself. The bug has existed
ever since ypset was first imported in 1994.
Ian Dowse [Sun, 8 Feb 2004 23:08:53 +0000 (23:08 +0000)]
Further simplify the code for printing the message buffer:
- Ensure that the buffer ends with "\n\0" to avoid special cases
and allow the use of strtol().
- Use strvisx() on each complete line instead of character by
character.
Ian Dowse [Sun, 8 Feb 2004 21:59:17 +0000 (21:59 +0000)]
Certain ICMP error replies cause ping to perform a reverse DNS
lookup on an IP address from the packet (such as the IP that sent
a TTL exceeded error). If the DNS lookup takes a long time, ^C will
appear to be ineffective since the SIGINT handler just sets a flag
and returns. Work around this by exiting immediately on receipt of
a second SIGINT when DNS lookups are enabled.
Lukas Ertl [Sun, 8 Feb 2004 15:27:58 +0000 (15:27 +0000)]
Don't free ressources that haven't been allocated. This should fix
the "disappearing subdisks" problem when new subdisks can't be created
due to some errors.
This is in fact an ugly hack, but a more elegant solution would probably
require a redesign of vinum in several places.
David Schultz [Sun, 8 Feb 2004 12:38:30 +0000 (12:38 +0000)]
Update the documentation for setpgrp(2) to reflect the access control
checks that the code actually performs. Judging from the 4.2BSD
release notes, the docs have only been out of date for 20 years.
Mike Silbersack [Sun, 8 Feb 2004 07:35:48 +0000 (07:35 +0000)]
Add the SF_NODISKIO flag to sendfile. This flag causes sendfile to be
mindful of blocking on disk I/O and instead return EBUSY when such
blocking would occur.
Results from the DeBox project indicate that blocking on disk I/O
can slow the performance of a kqueue/poll based webserver. Using
a flag such as SF_NODISKIO and throwing connections that would block
to helper processes/threads helped increase performance.
Currently, only the Flash webserver uses this flag, although it could
probably be applied to thttpd with relative ease.
I guess nobody has needed to use the SVR4olator to create device
nodes, or if they did, they're now locked away on the Kurt Gdel
memorial home for the numerically confused:
Don't cast a kernel pointer (from makedev(9)) to an integer (maj+minor combo).
Yaroslav Tykhiy [Sat, 7 Feb 2004 14:54:30 +0000 (14:54 +0000)]
Deny attempts to rename a file from guest users if the policy
says they may not modify existing files through FTP.
Renaming a file is effectively a way to modify it.
For instance, if a malicious party is unable to delete or overwrite
a sensitive file, they can nevertheless rename it to a hidden name
and then upload a troyan horse under the guise of the old file name.
Yaroslav Tykhiy [Sat, 7 Feb 2004 14:11:38 +0000 (14:11 +0000)]
Work around a bug in some clients by never returning raw directory
contents in reply to a RETR command. Such clients consider RETR
as a way to tell a file from a directory. Mozilla is an example.
PR: bin/62232
Submitted by: Bob Finch <bob+freebsd <at> nas <dot> com>
MFC after: 1 week
Scott Long [Sat, 7 Feb 2004 10:30:22 +0000 (10:30 +0000)]
If a command has to be deferred because there are no more resources for it
on the card, unmap it first. This allows it to be picked up properly when
the queue gets kicked again. This was the root problem for the lost command
(i.e. stuck in getblk/vinvalb) problem. While here, panic if commands don't
map correctly instead of just silently ignoring the problem and dropping
command. Also slow down the dynamic allocation of new commands.
It should be safe to go back into the aac waters. Thanks to everyone who
suffered through this and provided good feedback.
Bill Paul [Sat, 7 Feb 2004 06:44:13 +0000 (06:44 +0000)]
Add a whole bunch of new stuff to make the driver for the AMD Am1771/Am1772
802.11b chipset work. This chip is present on the SMC2602W version 3
NIC, which is what was used for testing. This driver creates kernel
threads (12 of them!) for various purposes, and required the following
routines:
and several more. Also, this driver abuses the fact that NDIS events
and timers are actually Windows events and timers, and uses NDIS events
with KeWaitForSingleObject(). The NDIS event routines have been rewritten
to interface with the ntoskrnl module. Many routines with incorrect
prototypes have been cleaned up.
Also, this driver puts jobs on the NDIS taskqueue (via NdisScheduleWorkItem())
which block on events, and this interferes with the operation of
NdisMAllocateSharedMemoryAsync(), which was also being put on the
NDIS taskqueue. To avoid the deadlock, NdisMAllocateSharedMemoryAsync()
is now performed in the NDIS SWI thread instead.
There's still room for some cleanups here, and I really should implement
KeInitializeTimer() and friends.
Scott Long [Sat, 7 Feb 2004 03:51:20 +0000 (03:51 +0000)]
Add a simple tool for checking the queue stats in the aac(4) driver. The
ioctl interface for this has been here for years, so it might as well get
used.
Matt Jacob [Sat, 7 Feb 2004 03:47:33 +0000 (03:47 +0000)]
Checkpoint of work in progress in cleaning up target mode. It actually
seems to work well in RELENG_4. However, 5.X locking foo means that I'll
have to do some quick redesign.
Add ioctl handlers for ISP_GETROLE and ISP_SETROLE ioctls.
Scott Long [Sat, 7 Feb 2004 03:30:32 +0000 (03:30 +0000)]
Reduce AAC_MAX_FIBS to work around some yet-unidentified bugs in the
handling of resources shortages. The driver is now so fast that it can
completely fill all 512 slots on the card, but for some reason only 511
slots are being allocated. Anything that tries to go into the 512th
slot gets silently lost. Both bugs need to be fixed at a later date,
but this should fix the reports of hangs in getblk and vinvalb.
Scott Long [Sat, 7 Feb 2004 03:26:38 +0000 (03:26 +0000)]
- Broaden the scope of locking in aac_command_thread() again to catch some
edge cases in the loop.
- Try to grab a command before dequeueing the bio from the bioq. The old
behaviour of requeuing deferred bios to the end of the bioq is arguably
wrong. This should be fixed in the future to check the bioq head without
automatically dequeueing the bio.
Ruslan Ermilov [Fri, 6 Feb 2004 21:58:32 +0000 (21:58 +0000)]
First round of cleanups to sys/boot/ makefiles:
- do not use PROG for what's not a real C program,
- use sys.mk transformation rules where possible,
- only create the "machine" symlink on AMD64,
- removed MAINTAINER lines in individual makefiles,
- added the LIBSTAND defitinion to <bsd.libnames.mk>,
- somewhat better contents in .depend files.
Peter Wemm [Fri, 6 Feb 2004 20:38:39 +0000 (20:38 +0000)]
Remove the badsw* INVARIANTS checks. The events that this attempts
to catch are already nicely caught by trapping the null pointer derefs.
Remove no-longer-used noswitch/nothrow strings. They were referenced
by the stub cpu_switch() etc functions before they were implemented.
Try something a little different for the lock prefixes.
John Baldwin [Fri, 6 Feb 2004 20:20:07 +0000 (20:20 +0000)]
Sync up MP safe flags with global syscalls.master. This includes write(),
close(), getpid(), ibcs2_setuid(), getuid(), ptrace(), ibcs2_pause(),
ibcs2_nice(), ibcs2_kill(), ibcs2_pgrpsys(), dup(), pipe(), ibcs2_setgid(),
getgid(), umask(), and sigreturn().
John Baldwin [Fri, 6 Feb 2004 19:30:12 +0000 (19:30 +0000)]
- Correct the translation of old rlimit values to properly handle the old
RLIM_INFINITY case for ogetrlimit().
- Use %jd and intmax_t to output negative time in usec in calcru().
- Rework getrusage() to make a copy of the rusage struct into a local
variable while holding Giant and then do the copyout from the local
variable to avoid having to have the original process rusage struct
locked while doing the copyout (which would not be safe). This also
includes a few style fixes from Bruce to getrusage().
Submitted by: bde (1, parts of 3)
Suggested by: bde (2)
Daniel Eischen [Fri, 6 Feb 2004 15:20:56 +0000 (15:20 +0000)]
Add cancellation point to sem_wait() and sem_timedwait() for pshared
semaphores. Also add cancellation cleanup handlers to keep semaphores
in a consistent state.
Submitted in part by: davidxu
Reviewed by: davidxu