Doug Rabson [Wed, 10 Jun 1998 20:40:59 +0000 (20:40 +0000)]
Add my own copyright to this file. The only remnants of NetBSD code here
are in the comments. As such the NetBSD copyright is included to protect
the valuable intellectual copyright included in those comments.
Julian Elischer [Wed, 10 Jun 1998 19:27:56 +0000 (19:27 +0000)]
Back out John's changes 1.45 -> 1.46
Kirk confirms that the original semantic was what he wanted...
(well, a very slight difference)
May fix "dangling deps" panic with soft updates.
Fix for potential hang when trying to reboot the system or
to forcibly unmount a soft update enabled filesystem.
FreeBSD already handled the reboot case differently, this is however a better
fix.
When system act as IPX router (sysctl -w net.ipx.ipx.ipxforwarding=1,
running IPXRouted -s) between IPX configured interfaces, it generate
syslog messages "ipx_ctlinput: cmd 15." even if kernel compiled with
IPXPRINTFS=0 and IPX_ERRPRINTFS=0 options.
PR: 6875
Reviewed by: phk
Submitted by: Vladimir A. Jakovenko <vovik@ntu-kpi.kiev.ua>
Doug Rabson [Wed, 10 Jun 1998 10:57:29 +0000 (10:57 +0000)]
Add initial support for the FreeBSD/alpha kernel. This is very much a
work in progress and has never booted a real machine. Initial
development and testing was done using SimOS (see
http://simos.stanford.edu for details). On the SimOS simulator, this
port successfully reaches single-user mode and has been tested with
loads as high as one copy of /bin/ls :-).
Peter Wemm [Wed, 10 Jun 1998 06:29:23 +0000 (06:29 +0000)]
Don't attempt to change owner/mode/flags that don't need to changed.
This should calm down attempts to `cp -p' to a nfs mount or some other
filesystem that doesn't accept flags or all combinations of flags.
It will warn if it fails to change flags though.
John Polstra [Wed, 10 Jun 1998 04:24:21 +0000 (04:24 +0000)]
This is a null commit to log the fact that I have done a repository
copy to bring these files into libc from libcompat. I will enable
them and kill off the libcompat versions on the main branch soon.
John Birrell [Tue, 9 Jun 1998 23:25:13 +0000 (23:25 +0000)]
Add a commented out CFLAGS entry that can be uncommented to compile thread
lock debug into libc_r. I don't know if this is the best place to document
this, but at least it is recorded somewhere. 8-)
John Birrell [Tue, 9 Jun 1998 23:16:53 +0000 (23:16 +0000)]
Add compile time debug instead of doing this all the time. Reduce the
time that a thread keeps the file descriptor table locked. In particular,
perform malloc/free calls outside the lock and handle the situation
where two threads can race to initialise the table entry for the same
file descriptor.
John Birrell [Tue, 9 Jun 1998 23:13:10 +0000 (23:13 +0000)]
Add support for compile time debug. This is enabled if libc_r is built
with -D_LOCK_DEBUG. This adds the file name and line number to each lock
call and these are stored in the spinlock structure. When using debug
mode, the lock function will check if the thread is trying to lock
something it has already locked. This is not supposed to happen because
the lock will be freed too early.
Without lock debug, libc_r should be smaller and slightly faster.
John Birrell [Tue, 9 Jun 1998 23:08:41 +0000 (23:08 +0000)]
POSIX says that pthread_exit() is not allowed to be called from a
cleanup destructor, so trap this case to prevent me from being being
burnt again by applications that try to do this. With this change, an
application (like one using a mis-configured ACE) will exit the process
after displaying a message quoting the POSIX section that the application
has violated.
Bruce Evans [Tue, 9 Jun 1998 12:52:35 +0000 (12:52 +0000)]
Pass lists of possible root devices and their names up to the
machine-independent code and try mounting the devices in the
lists instead of guessing alternative root devices in a machine-
dependent way.
autoconf.c:
Reject preposterous slice numbers instead of silently converting
them to COMPATIBILITY_SLICE.
Don't forget to force slice = COMPATIBILITY_SLICE in the floppy
device name.
Eliminated most magic numbers and magic device names in setroot().
Fixed dozens of style bugs.
vfs_conf.c:
Put the actual root device name instead of "root_device" in the
mount struct if the actual name is available. This is useful after
booting with -s. If it were set in all cases then it could be used
to do mount(8)'s ROOTSLICE_HUNT and fsck(8)'s hotroot guess better.
Bruce Evans [Tue, 9 Jun 1998 07:19:13 +0000 (07:19 +0000)]
Quick fixes for the mtree bootstrap:
- don't announce `mtree' as `mtools'.
- don't install to ${DESTDIR}/usr/sbin (which often doesn't exist if
DESTDIR is set and may be read-only if DESTDIR is not set).
- install to (${WORLDTMP}/usr/sbin so that the new mtree is actually
in $PATH if DESTDIR is set.
- don't use the host make or the host sys.mk. This is probably
unimportant.
- use a temporary obj dir like the one for `make'. This was mainly
necessary because I forgot to remove the MAKEOBJDIRPREFIX unsetting
which was just a bug for mtree. A non-quick fix would handle mtree
more like a bootstrap tool (the only additional complications are to
create ${BINDIR} and avoid excessive cleaning). Except a non-quick
fix would change much more.
Warner Losh [Tue, 9 Jun 1998 05:06:27 +0000 (05:06 +0000)]
If we get back too much data to fit in result, return NULL. This avoids
a buffer overflow, but might negatively impact those hosts who have
enough aliases to fill MAXHOSTNAMELEN * 2 characters in them.
Good candidate for merging back into -stable. Lightly tested by me, but
it came from OpenBSD a while ago.
Warner Losh [Tue, 9 Jun 1998 04:28:05 +0000 (04:28 +0000)]
o Use snprintf rather than sprintf.
o Revert gid to caller before a shell so we can run setgid.
o minor style nits to make bruce happy :-)
o use strncpy correctly.
Warner Losh [Tue, 9 Jun 1998 04:20:51 +0000 (04:20 +0000)]
Use mkstemp rather than mktemp for yacc's temp files. This change was made
to OpenBSD a long time ago and to my tree shortly thereafter. I think theo
made this change, or one similar to it, but I could be wrong.
Warner Losh [Tue, 9 Jun 1998 04:17:29 +0000 (04:17 +0000)]
o Use snprintf rather than sprintf
o Add more checks for buffer overflows
o Use snprintf rather than strcat/cpy and have better checks for max
length exceeded.
Most of these changes are not exploitable buffer overruns, but it never
hurts to be safe.
Warner Losh [Tue, 9 Jun 1998 03:38:43 +0000 (03:38 +0000)]
Make sure we pass the length - 1 to readlink, since it adds its own
NUL at the end of the path.
Inspired by: OpenBSD's changes in this area by theo de raadt
Bruce Evans [Tue, 9 Jun 1998 03:32:05 +0000 (03:32 +0000)]
Don't generate COMPAT_43 cruft if there are no COMPAT_43 syscalls.
In particular, don't generate an include of "opt_compat.h" if it
wouldn't affect anything we create. This will fix recent breakage
of the ibcs2 LKM. The ibcs2 syscall files were not regenerated
properly, so the LKM didn't break immediately when we started
generating this extraneous include.
Bruce Evans [Tue, 9 Jun 1998 02:55:40 +0000 (02:55 +0000)]
Fixed `make depend', which I broke here about a month ago by moving
the null default for `depend' from bsd.dep.mk to bsd.obj.mk.
bsd.kmod.mk included these files in a bad order, so it picked up
the null default.
Julian Elischer [Mon, 8 Jun 1998 23:55:33 +0000 (23:55 +0000)]
The version of the softdep changes in FreeBSD broke the
(doingdirectory && !newparent) case of ufs_rename().
rename("D1/X/", "D2/Y/") gives a wrong link count for D2.
Submitted by: Bruce Evans <bde@zeta.org.au>
Reviewed by: Kirk McKusick <mckusick@McKusick.COM>
Brian Somers [Mon, 8 Jun 1998 20:23:44 +0000 (20:23 +0000)]
Correct ``set server'' usage and add mention that ``set ns'' changed
in README.changes.
Suggested by: stuart henderson <stuart@internationalschool.co.uk>