bde [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.
bde [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.
imp [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.
imp [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.
imp [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.
imp [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.
imp [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
bde [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.
bde [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 [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 [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>
bde [Mon, 8 Jun 1998 09:47:47 +0000 (09:47 +0000)]
Fixed pedantic semantics errors (bitfields not of type int, signed int
or unsigned int (this doesn't change the struct layout, size or
alignment in any of the files changed in this commit, at least for
gcc on i386's. Using bitfields of type u_char may affect size and
alignment but not packing)).
bde [Mon, 8 Jun 1998 08:50:43 +0000 (08:50 +0000)]
Fixed pedantic semantics errors (bitfields not of type int, signed int
or unsigned int (don't do this in one case where it would change the
object file)).
bde [Mon, 8 Jun 1998 06:04:12 +0000 (06:04 +0000)]
ip_fil.h has 9 separate declarations of iplioctl() in a disgusting
ifdef tangle. The previous commit to ip_fil.h didn't change the
one that actually applies to the current FreeBSD kernel, of course.
Fixed.
jdp [Sun, 7 Jun 1998 21:53:01 +0000 (21:53 +0000)]
Speed up the cleaning of CHROOTDIR by almost a factor of two, by
replacing two monstrous file tree walks with one monstrous tree walk
and two miniscule ones.
phk [Sun, 7 Jun 1998 20:36:55 +0000 (20:36 +0000)]
Add a member function more to the timecounters, this one is for use
with latch based PPS implementations. The client that uses it will
be committed after more testing.
dfr [Sun, 7 Jun 1998 17:13:14 +0000 (17:13 +0000)]
This commit fixes various 64bit portability problems required for
FreeBSD/alpha. The most significant item is to change the command
argument to ioctl functions from int to u_long. This change brings us
inline with various other BSD versions. Driver writers may like to
use (__FreeBSD_version == 300003) to detect this change.
The prototype FreeBSD/alpha machdep will follow in a couple of days
time.
bde [Sun, 7 Jun 1998 11:04:26 +0000 (11:04 +0000)]
Null change. Forgot to mention in previous log message that MNT_NOATIME
is now ignored for special files, so that mounting root with option
noatime doesn't break reporting of idle times in programs like `w'.
The problem of execessive disk updates just to stamp atimes will be
handled for special files by only writing atimes to disk when inodes
become active. This works well because special files are relatively
uncommon and their atimes are even more disposable at panic time than
regular files' atimes.
bde [Sun, 7 Jun 1998 10:49:18 +0000 (10:49 +0000)]
Fixed some longstanding timestamp bugs:
1. mark atimes and mtimes of special files and fifos for update upon
successful completion of non-null i/o, not at the beginning of the
syscall.
2. never update file times for readonly filesystems. They were updated
for stats and closes but not for syncs. The updates were of course
only in-core and were thrown away when the inode was uncached, so
the times sometimes appeared to go backwards.
Improved comments in code related to (1) (mostly by removing them).
Unmacroized ITIMES(). The test in (2) bloated it even more. Don't
call getmicrotime() in the function version of it when we only need
the time in seconds.
brian [Sun, 7 Jun 1998 03:53:08 +0000 (03:53 +0000)]
Search for libraries in dlopen() when the specified path
contains no ``/''s.
Elf already searches it seems.
Mostly submitted by: Mike Smith <mike@smith.net.au>