Wrong header length used for certain reassembled IP packets.
PR: 6177
Reviewed by: phk, wollman
Submitted by: Eric Sprinkle <eric@ennovatenetworks.com>
Fix dependent-package loading when pkg_adding with an FTP URL. I broke
this when I changed the playpen code to disallow recursion. I know
this fixes a PR someplace but I can't seem to find it with the GNATs
search tool.
setsockopt() transports user option data in an mbuf. if the user
data is greater than MLEN, setsockopt is unable to pass it onto
the protocol handler. Allocate a cluster in such case.
John Dyson [Sat, 11 Apr 1998 20:09:39 +0000 (20:09 +0000)]
Minor typo in the wd driver. The manifestation of this bug
is a tremendous perf decrease due to the disabling of advanced
features such as DMA, Ultra DMA, and 32bit mode. This patch
might have been reported by someone else (I seem to remember
it.)
When pmap_pinit0() allocates a page for proc0's page directory,
kernal page table may need to be extended. But while growing the
kernel page table (pmap_growkernel()), newly allocated kernel page
table pages are entered into every process' page directory. For
proc0, the page directory is not allocated yet, and results in a
page fault. Eventually, the machine panics with "lockmgr: not
holding exclusive lock".
John Birrell [Sat, 11 Apr 1998 07:47:22 +0000 (07:47 +0000)]
Change the FILE locking to be by FILE, not by the underlying fd as
it was. Add a FILE_WAIT state and queue threads waiting for a FILE
lock. Start using the sys/queue.h macros instead of the way that MIT
pthreads did it.
Add a thread name to the private thread structure and a non-POSIX
function to set this. This helps (me at least) when sending a SIGINFO
to a threaded process to get a /tmp/uthread.dump to see what the
<expletive deleted> threads are doing this time. It is nice to be
able to recognise (yes, I spell that with an 's' too) which threads
are which.
John Birrell [Sat, 11 Apr 1998 07:40:47 +0000 (07:40 +0000)]
Add FILE locking stubs for libc.
Change the FILE locking to support kernel threads when linked with
libpthread (which you haven't see yet). This requires that libc become
thread-safe and thread-aware, testing __isthreaded before attempting
to do lock/unlock calls. The impact on non-threaded programs is minor.
This change works with libc_r, so it's the best compromise.
John Birrell [Sat, 11 Apr 1998 07:33:46 +0000 (07:33 +0000)]
Add *_unlocked() macros according to POSIX. In the _THREAD_SAFE case,
test for __isthreaded before calling the lock/unlock functions to
try to save some performance. The _THREAD_SAFE case should become the
default, but since it tests for a global variable in libc, people won't
be able to build -current on pre-3.0 systems unless the default leaves
it out. Such is life.
John Birrell [Sat, 11 Apr 1998 07:02:58 +0000 (07:02 +0000)]
Add a global variable called __isthreaded that can be tested throughout
libc to determine if locking is required. This is needed in libc
for use with kernel threads, but until a thread is created, we don't
really want to bother locking things. The variable was added here
because the crt code calls exit(main()) so all programs will get the
variable.
John Polstra [Fri, 10 Apr 1998 01:20:40 +0000 (01:20 +0000)]
Fix the assembler so that it produces object files with the correct
magic number byte ordering for FreeBSD. This makes "file" describe
our object files as "FreeBSD/i386 object" instead of as NetBSD
object files. In case this seems drastic and risky, Bruce points
out that the "ld -r -x" step that is done on every object file when
building libraries fixes the byte ordering in the same way. I have
been running with this patch for over a month and have seen no
problems.
New mount option nosymfollow. If enabled, the kernel lookup()
function will not follow symbolic links on the mounted
file system and return EACCES (Permission denied).
Bruce Evans [Tue, 7 Apr 1998 12:43:57 +0000 (12:43 +0000)]
Guess the position of the drive number in the device name better so
that `fsck -p' doesn't check multiple slices on the same drive
concurrently. Don't invoke undefined behaviour when searching for
the drive number in strange device names.
PR: 6129
Reviewed by: phk
Submitted by: Yuichi MATSUTAKA <matutaka@osa.att.ne.jp>, but rewritten
by me.
Peter Wemm [Mon, 6 Apr 1998 18:25:21 +0000 (18:25 +0000)]
Rather than let users get fd's to symlink files, make O_NOFOLLOW cause
an error if it gets a link (like it does if it gets a socket). The
implications of letting users try and do file operations on symlinks
themselves were too worrying.
Peter Wemm [Mon, 6 Apr 1998 17:44:40 +0000 (17:44 +0000)]
Don't panic if a VOP_READ() gets through on a short link, Just Do It
(because we can :-). This means you can open a link file (or pseudo-file
in the case of short links where the data is stored in the inode rather
than disk blocks) and read the contents.
However, trap any writes from the user as it's difficult to do the right
thing in all cases. A link may be short and the user may be trying to
extend it beyond the limit and so on. Although.. being able to re-target
a symlink without deleting it first might have been nice.
This stuff is a bit perverse since symlink() and readlink() calls can
end up actually being implemented as read/write vnode ops.
Peter Wemm [Mon, 6 Apr 1998 17:38:43 +0000 (17:38 +0000)]
Implement a new open(2) flag: O_NOFOLLOW. This will instruct open
to not follow symlinks, but to open a handle on the link itself(!).
As strange as this might sound, it has several useful applications
safe race-free ways of opening files in hostile areas (eg: /tmp, a mode
1777 /var/mail, etc). It also would allow things like fchown() to work
on the link rather than having to implement a new syscall specifically for
that task.
Peter Wemm [Mon, 6 Apr 1998 16:13:49 +0000 (16:13 +0000)]
Add a new -F flag which is a superset of -f. It will cause tail to
stat() the file being followed and do a close/reopen if the file has been
renamed and/or rotated. This is damn useful for leaving running on files
in /var/log when newsyslog(8) rotates them.
Peter Wemm [Mon, 6 Apr 1998 15:48:30 +0000 (15:48 +0000)]
Use real types for the SMP pages being allocated rather than arrays of
ints. Remove some no longer needed casts. Initialize the per-cpu
global data area using the structs rather than knowing too much about
layout, alignment, etc.
Prevent rdist from dumping core: do not free() pointer before using it.
Add rcsid. Document -D flag (debug mode). Remove unused includes.
PR:bin/3158 (part 1)