dragonfly.git
15 years agoStyle(9):
Chris Pressey [Thu, 11 Nov 2004 21:16:46 +0000 (21:16 +0000)]
Style(9):
- Do not implicitly treat NUL characters, NULL pointers, or 0-valued
  integers as false-valued booleans; use explicit tests instead.
- Prefer char **argv to char *argv[].
- Small whitespace adjustments.
- No functional changes.

15 years agoAdd various improvements to the "pre-flight installer":
Chris Pressey [Thu, 11 Nov 2004 20:30:05 +0000 (20:30 +0000)]
Add various improvements to the "pre-flight installer":

- Add pfi_autologin variable.  If set to a valid username, the
  installation medium boot process will automatically log in as
  that user.  Defaults to "NONE".

- Add pfi_shutdown_command variable.  This can be set to the
  desired command used to shut down the system when the installer
  finishes doing its thing.  Defaults to "shutdown -h now".

- Launch thttpd on boot if pfi_frontend="cgi".

  In combination, these three settings allow completely
  headless (no monitor, no keyboard) operation of the installer
  independent of a serial connection (i.e. over the network.)

- Have the pfi_sshd_permit_root_login variable honour
  "without-password" and "forced-commands-only" settings. [1]

[1] Submitted by: geekgod

15 years agoUpdate installer to 1.1.2.
Chris Pressey [Thu, 11 Nov 2004 19:45:19 +0000 (19:45 +0000)]
Update installer to 1.1.2.

The most significant change in this update is that there are now two
seperate directories on the install medium, /etc and /etc.hdd :

- /etc contains the configuration used for booting the LiveCD only.
  It is NOT copied to the hard drive.

- /etc.hdd contains the default configuration used for booting from
  a hard drive.  It is NOT used for booting the LiveCD.  It IS copied
  to the hard drive, as /etc .

This avoids the `copy pristine files afterward' rigamarole and, in
so doing, simplifies both manual and automatic install routines.

The README file has also been updated to reflect this change.

Suggested-by: dillon (a while ago)
15 years agoThe 'start = 1' change wasn't needed, revert that one little bit back to
Matthew Dillon [Wed, 10 Nov 2004 20:19:51 +0000 (20:19 +0000)]
The 'start = 1' change wasn't needed, revert that one little bit back to
'start = 0'.

15 years ago- style(9) cleanup
Joerg Sonnenberger [Wed, 10 Nov 2004 18:30:13 +0000 (18:30 +0000)]
- style(9) cleanup
- allow rl_detach to be used for all error recovery in rl_attach
- drop rl_unit and use device_printf instead
- rl_list_tx_init can't fail, make it void
- eliminate splimp in rl_attach, drop it ASAP in rl_detach
- use DEFINE_CLASS_0 instead of expanding it manually

From FreeBSD:
- support cardbus attachments
- support 6bit and 8bit EEPROMs
- use ether_crc32_be instead of local code
- fix some unnessary watchdog conditions
- depend on miibus
- use pci_get_powerstate()/pci_set_powerstate()
- add various PCI and CardBus devices
- bus_dma conversion

15 years agoAdd libarchive to prebuilt libraries.
Joerg Sonnenberger [Wed, 10 Nov 2004 18:05:36 +0000 (18:05 +0000)]
Add libarchive to prebuilt libraries.

15 years agoMerge from vendor branch LIBARCHIVE:
Joerg Sonnenberger [Wed, 10 Nov 2004 18:02:24 +0000 (18:02 +0000)]
Merge from vendor branch LIBARCHIVE:
Import libarchive and bsdtar. The default tar (/usr/bin/tar) can be choosen
at installworld time by setting WITH_BSDTAR. This is not the default yet.

Obtained-from: FreeBSD

15 years agoMerge from vendor branch BSDTAR:
Joerg Sonnenberger [Wed, 10 Nov 2004 18:02:24 +0000 (18:02 +0000)]
Merge from vendor branch BSDTAR:
Import libarchive and bsdtar. The default tar (/usr/bin/tar) can be choosen
at installworld time by setting WITH_BSDTAR. This is not the default yet.

Obtained-from: FreeBSD

15 years agoImport libarchive and bsdtar. The default tar (/usr/bin/tar) can be choosen
Joerg Sonnenberger [Wed, 10 Nov 2004 18:02:24 +0000 (18:02 +0000)]
Import libarchive and bsdtar. The default tar (/usr/bin/tar) can be choosen
at installworld time by setting WITH_BSDTAR. This is not the default yet.

Obtained-from: FreeBSD

15 years agoImport libarchive and bsdtar. The default tar (/usr/bin/tar) can be choosen
Joerg Sonnenberger [Wed, 10 Nov 2004 18:02:24 +0000 (18:02 +0000)]
Import libarchive and bsdtar. The default tar (/usr/bin/tar) can be choosen
at installworld time by setting WITH_BSDTAR. This is not the default yet.

Obtained-from: FreeBSD

15 years agoImport libarchive and bsdtar. The default tar (/usr/bin/tar) can be choosen
Joerg Sonnenberger [Wed, 10 Nov 2004 18:02:24 +0000 (18:02 +0000)]
Import libarchive and bsdtar. The default tar (/usr/bin/tar) can be choosen
at installworld time by setting WITH_BSDTAR. This is not the default yet.

Obtained-from: FreeBSD

15 years agoFix a very serious bug in contigmalloc() which we inherited from FreeBSD-4.x.
Matthew Dillon [Wed, 10 Nov 2004 17:39:20 +0000 (17:39 +0000)]
Fix a very serious bug in contigmalloc() which we inherited from FreeBSD-4.x.
The contigmalloc() code incorrectly assumes that a page in PQ_CACHE can
be reused without having to do any further checks and it unconditionally
busies and frees such pages, and assumes that the page becomes PQ_FREE even
though it might actually have gone to a PQ_HOLD state.  Additionally the
contigmalloc() code unconditionally sets m->object to NULL, ignoring the
fact that the page will be in the VM page bucket hash table if object
happens to not be NULL, leading to page bucket hash table corruption.

The fix is two fold.  First, we add checks for m->busy, (m->flags & PG_BUSY),
m->wire_count, and m->hold_count and do not reuse a page with any of those
set.  We do this for all pages, not just PQ_CACHE pages, though it is
believed that it only needs to be done for PQ_CACHE pages.  Second, we
replace the m->object = NULL assignment with an assertion that it is
already NULL, since it had better be NULL and we cannot just set it to NULL
unconditionally without blowing up the VM page hash table.

Symptoms of the bug include:

    * Filesystem corruption, in particular with slower disk drivers (e.g.
      like the 'twe' driver), or in systems with drivers which use
      contigmalloc() a lot (e.g. require bounce buffers).

      Mangled directory entries, bad indirect blocks (containing data instead
      of indirect block pointers), and files containing other file's data.

    * 'page not found in hash' panic.

This is the last major VM issue in DragonFly, one that has plagued in
particular David Rhodus (who is a heavy user of the 'twe' driver) for over
a year.  I would never have found this bug if not for DR's persistence and
the dozens of kernel cores he was able to provide me over the last year.  We
finally got a core with a 'smoking gun', after having written a program
(/usr/src/test/debug/vmpageinfo.c) to run through all the VM pages and check
their hash table association for correctness it became obvious that pages
were being reused without being removed from the hash table which finally
led to contigmalloc*().

Many thanks to: David Rhodus!  Free gift enclosed!

15 years agoThe min() and max() macros in sys/libkern.h are typed u_int and thus do not
Matthew Dillon [Wed, 10 Nov 2004 08:27:54 +0000 (08:27 +0000)]
The min() and max() macros in sys/libkern.h are typed u_int and thus do not
do the right things when handed negative numbers.  Use MIN and MAX instead.

This was causing renice -N processes to wrap back around to the worst priority
instead of MIN()'ing to the best priority.

15 years agoInstall GNU tar as gtar now in preparation for adding bsdtar.
Joerg Sonnenberger [Wed, 10 Nov 2004 00:01:54 +0000 (00:01 +0000)]
Install GNU tar as gtar now in preparation for adding bsdtar.
/usr/bin/tar is installed as symlink to /usr/bin/gtar, which
gives the current behaviour. Same for the man page. This is disabled,
if WITH_BSDTAR is set.

15 years agoClose .if.
Joerg Sonnenberger [Tue, 9 Nov 2004 22:44:06 +0000 (22:44 +0000)]
Close .if.

Reported-by: esmith
15 years agoAdd SA_LEN patch for client.c, too
Joerg Sonnenberger [Tue, 9 Nov 2004 22:06:54 +0000 (22:06 +0000)]
Add SA_LEN patch for client.c, too

15 years agovmpageinfo is a program which runs through the vm_page_array and the
Matthew Dillon [Tue, 9 Nov 2004 21:50:12 +0000 (21:50 +0000)]
vmpageinfo is a program which runs through the vm_page_array and the
vm_page_buckets hash table and validates the hash table association for
all VM pages which have objects associated with them.  This is primarily
intended for post-mortem checks of kernel cores.

15 years agoMerge from vendor branch NTPD:
Joerg Sonnenberger [Tue, 9 Nov 2004 21:29:34 +0000 (21:29 +0000)]
Merge from vendor branch NTPD:
After another look at the current changes, switch directly to the in-tree
version of OpenNTPD. This is needed e.g. to get the ntpdate-like ntpd -s.

15 years agoAfter another look at the current changes, switch directly to the in-tree
Joerg Sonnenberger [Tue, 9 Nov 2004 21:29:34 +0000 (21:29 +0000)]
After another look at the current changes, switch directly to the in-tree
version of OpenNTPD. This is needed e.g. to get the ntpdate-like ntpd -s.

15 years agoAfter another look at the current changes, switch directly to the in-tree
Joerg Sonnenberger [Tue, 9 Nov 2004 21:29:34 +0000 (21:29 +0000)]
After another look at the current changes, switch directly to the in-tree
version of OpenNTPD. This is needed e.g. to get the ntpdate-like ntpd -s.

15 years agoSwitch to gdb 6.2.1 and wait for new problem reports.
Joerg Sonnenberger [Tue, 9 Nov 2004 21:08:16 +0000 (21:08 +0000)]
Switch to gdb 6.2.1 and wait for new problem reports.

15 years agoImport OpenNTPD 3.6 (the OpenBSD version, not the portable).
Joerg Sonnenberger [Tue, 9 Nov 2004 20:05:42 +0000 (20:05 +0000)]
Import OpenNTPD 3.6 (the OpenBSD version, not the portable).

Obtained-from: OpenBSD

Do enough minor patching to get it WARNS=6 clean (mostly addition of
some header files and expanding SA_LEN, one issue of const discarding
has been submitted back).

15 years agoMerge from vendor branch NTPD:
Joerg Sonnenberger [Tue, 9 Nov 2004 20:05:42 +0000 (20:05 +0000)]
Merge from vendor branch NTPD:
Import OpenNTPD 3.6 (the OpenBSD version, not the portable).

Obtained-from: OpenBSD

Do enough minor patching to get it WARNS=6 clean (mostly addition of
some header files and expanding SA_LEN, one issue of const discarding
has been submitted back).

15 years agoImport OpenNTPD 3.6 (the OpenBSD version, not the portable).
Joerg Sonnenberger [Tue, 9 Nov 2004 20:05:42 +0000 (20:05 +0000)]
Import OpenNTPD 3.6 (the OpenBSD version, not the portable).

Obtained-from: OpenBSD

Do enough minor patching to get it WARNS=6 clean (mostly addition of
some header files and expanding SA_LEN, one issue of const discarding
has been submitted back).

15 years agoUse the speedup patches, too
Joerg Sonnenberger [Tue, 9 Nov 2004 19:31:14 +0000 (19:31 +0000)]
Use the speedup patches, too

15 years agoDefine IOV_MAX for userland too and make it available via sysctl and
Joerg Sonnenberger [Tue, 9 Nov 2004 17:52:45 +0000 (17:52 +0000)]
Define IOV_MAX for userland too and make it available via sysctl and
getconf/sysconf. This is kind of a hack, but too much code wants it.

Obtained-from: FreeBSD

15 years agoAdd lockcountnb() - a non-blocking version of lockcount() to be used only
Matthew Dillon [Tue, 9 Nov 2004 17:41:30 +0000 (17:41 +0000)]
Add lockcountnb() - a non-blocking version of lockcount() to be used only
for assertions when the lock state is supposedly stable.

15 years agoCreate a non-blocking version of BUF_REFCNT() called BUF_REFCNTNB() to be
Matthew Dillon [Tue, 9 Nov 2004 17:36:42 +0000 (17:36 +0000)]
Create a non-blocking version of BUF_REFCNT() called BUF_REFCNTNB() to be
used for non-critical KASSERT()'s or in situations where the buffer lock
is in a known state.

This fixes a blocking condition in the ATA interrupt path.  The normal
BUF_REFCNT() calls lockcount() which obtains a token which caused the
interrupt thread to temporarily block in biodone() due to a KASSERT.

Found-from: kernel core provided by David Rhodus.

15 years agoI don't know why I added use_bpf.h, it isn't needed of course.
Joerg Sonnenberger [Tue, 9 Nov 2004 11:10:10 +0000 (11:10 +0000)]
I don't know why I added use_bpf.h, it isn't needed of course.

15 years agoFix the column width for IPv6 to correctly align the fields.
Joerg Sonnenberger [Tue, 9 Nov 2004 09:10:55 +0000 (09:10 +0000)]
Fix the column width for IPv6 to correctly align the fields.

Submitted-by: Pawel Biernacki <kaktus@dragonflybsd.pl>
15 years agoRemove references to sysinstall, it vanished quite some time ago.
Joerg Sonnenberger [Tue, 9 Nov 2004 08:52:46 +0000 (08:52 +0000)]
Remove references to sysinstall, it vanished quite some time ago.

Submitted-by: Tomaz Borstnar <tomaz.borstnar@over.net>
While at it, add a reference for both pw(8) and tzsetup(8) as appropiate.

15 years agoSmall speedups:
Joerg Sonnenberger [Tue, 9 Nov 2004 08:47:36 +0000 (08:47 +0000)]
Small speedups:
- run.c: instead of counting string lenght and using strcpy afterwards anyway,
  use memmove
- tran.c: use strdup instead of malloc + strcpy

Submitted-by: Andreas Hauser <andy@splashground.de>
15 years agoFix another minor bug-a-boo inherited from 4.x sources, the wrong indirdep
Matthew Dillon [Tue, 9 Nov 2004 04:41:47 +0000 (04:41 +0000)]
Fix another minor bug-a-boo inherited from 4.x sources, the wrong indirdep
pointer was being checked in a conditional.  However, it turns out not
to matter operationally.

15 years agovfs_object_create() was being called too early on devvp in the FFS mount
Matthew Dillon [Tue, 9 Nov 2004 04:25:59 +0000 (04:25 +0000)]
vfs_object_create() was being called too early on devvp in the FFS mount
code, causing FFS's devvp to not be VMIO backed.  This also tickled a
softupdates bug which has been separately fixed.

Its nice to know that everything still works without devvp being VMIO backed,
but we really want to back it :-).  This fixes it.

15 years agoCorrect a softupdates bug, an ir_savebp buffer was not being properly
Matthew Dillon [Tue, 9 Nov 2004 04:22:52 +0000 (04:22 +0000)]
Correct a softupdates bug, an ir_savebp buffer was not being properly
disposed of.  This bug is currently only known to effect filesystems
whos block devices are not VMIO backed.  However, it's a fragile situation
at best so its good to have it fixed anyhow.

ir_savebp is stashed copy of the in-memory version of an indirect file block.
It is stashed using (devvp,blkno) (whereas the actual indirect file block
is stored using (vp,-specialblkno).  For VMIO to also tickle this bug would
have required that other unrelated operations also cache (devvp,blkno), a
case which does not (yet) exist.

15 years agoSmall patch to fix the output of apm. It called print_batt_life twice
Liam J. Foy [Mon, 8 Nov 2004 19:58:12 +0000 (19:58 +0000)]
Small patch to fix the output of apm. It called print_batt_life twice
when it should call print_batt_life and print_batt_time.

15 years agoWe don't have lkm, use aftermountlkm instead.
Joerg Sonnenberger [Mon, 8 Nov 2004 18:33:17 +0000 (18:33 +0000)]
We don't have lkm, use aftermountlkm instead.

15 years agoDo not explicitly set PCIM_CMD_SERRESPEN or PCIM_CMD_PERRESPEN. This was
Matthew Dillon [Mon, 8 Nov 2004 16:50:33 +0000 (16:50 +0000)]
Do not explicitly set PCIM_CMD_SERRESPEN or PCIM_CMD_PERRESPEN.  This was
set in FreeBSD to try to catch device problems, but it looks like we actually
found a device that blows up with an NMI during fwohci_init() so we no longer
set these bits.  OpenBSD doesn't set it.

My theory is that the device is not clearing its internal memory leaving
some of it in a parity-adverse state, causing accesses to the uninitialized
memory to fail.  Alternatively the hardware is just plain broken, but it
seems to probe fine without the bit set so...

Gabor's-hardware:
AMD Athlon 64 3000+ based system.
fwohci0: <Texas Instruments TSB43AB21/A/AI/A-EP> mem
0xd0000000-0xd0003fff,0xd0008000-0xd00087ff irq 11 at device 6.0 on pci0
fwohci0: OHCI version 1.10 (ROM=1)
fwohci0: No. of Isochronous channel is 4.
fwohci0: EUI64 00:90:f5:00:00:32:10:37
fwohci0: Phy 1394a available S400, 1 ports.
fwohci0: Link S400, max_rec 2048 bytes.

NMI-Reported-by: Gabor MICSKO <trey@hup.hu>
15 years agoSync make.1 with the rest of the make source.
Matthew Dillon [Mon, 8 Nov 2004 16:16:44 +0000 (16:16 +0000)]
Sync make.1 with the rest of the make source.

Submitted-by: Max Okumoto <okumoto@home>
Taken-From: FreeBSD

15 years agoAdd tip(1)'s emulation of cu(1) to tip's manual page.
Matthew Dillon [Mon, 8 Nov 2004 16:11:05 +0000 (16:11 +0000)]
Add tip(1)'s emulation of cu(1) to tip's manual page.

Submitted-by: "H.Miyamoto" <Ys@PixyGarden.net>
Based-on: FreeBSD

15 years agoFix a race condition in detach path of Ethernet devices. Most current
Joerg Sonnenberger [Mon, 8 Nov 2004 10:28:48 +0000 (10:28 +0000)]
Fix a race condition in detach path of Ethernet devices. Most current
drivers do something like this:

XX_stop();
ether_ifdetach();

/* continue and assume device is dead now */

This doesn't work in many cases if a BPF user is left and IFF_PROMISC is
active, because bpfdetach does a reset of the timer for many drivers.
The fix is to move the call to if_down into ether_ifdetach, which gives
the expected behaviour.

15 years agoThe last commit created a memory leak because 'buf' is static. Fix that,
Matthew Dillon [Sun, 7 Nov 2004 23:44:38 +0000 (23:44 +0000)]
The last commit created a memory leak because 'buf' is static.  Fix that,
but also make the chosen block size more consistent by basing on the larger
of STDOUT vs rfd rather then just basing it on STDOUT, and change the
constant 1024 to BUFSIZ.

It is unclear whether we should impose a minimum buffer size or a mod
(e.g. x % st_blksize == 0) requirement as well.  There are currently no cases
where this matters as anyone in their right mind will use 'dd' instead of
'cat' on special block devices.  But at least in regards to /proc/*/map
imposing a minimum based on fstat(rfd, ...) makes sense, though to really
be correct we should also 'fix' procfs to report a block size sufficient to
hold the map data in that case.

Reported-by: Jason Smethers <jason@smethers.net>
15 years ago- Remove space
Liam J. Foy [Sun, 7 Nov 2004 21:38:01 +0000 (21:38 +0000)]
- Remove space

Submitted by: The White Space and Void Destroyer aka Douwe Kiela.

15 years agoRemove not needed void casts.
Eirik Nygaard [Sun, 7 Nov 2004 20:54:52 +0000 (20:54 +0000)]
Remove not needed void casts.

Submitted by: Douwe Kiela <virtus@wanadoo.nl>

15 years agostyle(9)
Eirik Nygaard [Sun, 7 Nov 2004 19:42:16 +0000 (19:42 +0000)]
style(9)

15 years ago- Remove (void) casts that are not necessary.
Liam J. Foy [Sun, 7 Nov 2004 19:29:27 +0000 (19:29 +0000)]
- Remove (void) casts that are not necessary.

Submitted by: Douwe Kiela <virtus@wanadoo.nl>

15 years agoSync with FreeBSD rm(1) with my modifications. Some things have been
Liam J. Foy [Sat, 6 Nov 2004 19:37:44 +0000 (19:37 +0000)]
Sync with FreeBSD rm(1) with my modifications. Some things have been
left out of this sync for time being.

- Fix the leakage of a file descriptor in rm_overwrite for non-fatal
  errors(this is for rm -P).
- Fix the fatal malloc() error message.
- When the P flag is set (i.e. Overwrite regular files before deleting them),
  do only unlink the file if we could indeed overwrite the file. See
  http://www.freebsd.org/cgi/cvsweb.cgi/src/bin/rm/rm.c?rev=1.45&content-type=text/x-cvsweb-markup
  for more details.
- Fix poor wording in comment.
- When fts_read() cannot stat the file, it can't be unlinked.  At
  that case, don't display error message when -f flag is used.
- Kindly let the user know rm(1) could not overwrite non-regular
  files and continue to unlink.
- Static functions.
- Constify rw_overwrite() and check().

Ok'ed by: kernel@ eirikn@ and dillon@

15 years agoConsify some variables.
Eirik Nygaard [Sat, 6 Nov 2004 12:33:11 +0000 (12:33 +0000)]
Consify some variables.
This Removes some warnings.

Submitted by: Andreas Hauser <andy@splashground.de>

15 years ago#endif does not take an argument, comment it out.
Eirik Nygaard [Sat, 6 Nov 2004 12:29:17 +0000 (12:29 +0000)]
#endif does not take an argument, comment it out.

Submitted by: Andreas Hauser <andy@splashground.de>

Add $DragonFly$ keyword to:
src/games/hack/config.h
src/games/hack/def.monst.h
src/games/hack/def.rm.h
src/games/hack/def.wseg.h
src/games/hack/hack.Decl.c
src/games/hack/hack.h
src/games/hack/hack.monst.c

15 years agoCorrect a typo and a mdoc(7) style issue.
Matthew Dillon [Fri, 5 Nov 2004 19:09:53 +0000 (19:09 +0000)]
Correct a typo and a mdoc(7) style issue.

Submitted-by: Xin LI <delphij@frontfree.net>
Originally-from: Dima Dorfman <dd@...>

15 years agoRemove an assertion that used to double-check the cred passed into vn_open().
Matthew Dillon [Fri, 5 Nov 2004 18:43:20 +0000 (18:43 +0000)]
Remove an assertion that used to double-check the cred passed into vn_open().
The assertion is no longer needed as the cred is allowed to be different,
and vn_open() may not be called from a process any more.  In particular,
vn_open() may be called from the NDIS driver to open a firmware image file.

Reported-by: Andrew Atrens <atrens@nortelnetworks.com>
15 years agoFix a Trident DMA limitation. Symptom as reported by Brock was that his
Matthew Dillon [Fri, 5 Nov 2004 17:47:48 +0000 (17:47 +0000)]
Fix a Trident DMA limitation.  Symptom as reported by Brock was that his
laptop would lockup.

Submitted-by: Brock Johnson <wildefire@isentry.homelinux.org>
Taken-from: FreeBSD, rev 1.45 and 1.46

15 years agoGive makewhatis an absolute path to make upgrading etc from single-user
Matthew Dillon [Fri, 5 Nov 2004 17:36:05 +0000 (17:36 +0000)]
Give makewhatis an absolute path to make upgrading etc from single-user
mode easier.

Submitted-by: "Henrik N. Jensen" <hnj@unihost.net>
15 years agoBring in some more PCI ID's from FreeBSD.
Matthew Dillon [Fri, 5 Nov 2004 17:13:44 +0000 (17:13 +0000)]
Bring in some more PCI ID's from FreeBSD.

Submitted-by: Andreas Hauser <andy@splashground.de>
Taken-from: FreeBSD

15 years agoAdd humanize_number(3) and split the trimdomain(3) function out from
Matthew Dillon [Fri, 5 Nov 2004 17:05:26 +0000 (17:05 +0000)]
Add humanize_number(3) and split the trimdomain(3) function out from
logwtmp.

Submitted-by: "Douwe Kiela" <virtus@wanadoo.nl>
Taken-From: FreeBSD

15 years agoSave and restore the 'version' counter file when doing a full buildkernel
Matthew Dillon [Fri, 5 Nov 2004 10:09:52 +0000 (10:09 +0000)]
Save and restore the 'version' counter file when doing a full buildkernel
or nativekernel target so the counter is not reset each time.  Note that
the quickkernel target will increment the counter only if something has
changed.

Reported-by: walt <wa1ter@myrealbox.com>
Make some minor FBsd->DFly 'update' target cleanups.

Submitted-by: Michal Belczyk <diavul@bsd.krakow.pl>
15 years agoFix a possible remote DOS against pppd, described in detail at
Matthew Dillon [Fri, 5 Nov 2004 07:27:20 +0000 (07:27 +0000)]
Fix a possible remote DOS against pppd, described in detail at

http://www.securityfocus.com/archive/1/379450/2004-10-24/2004-10-30/0

Submitted-by: "Andre Nathan" <andre@digirati.com.br>
Taken-from: OpenBSD / same file rev 1.6

15 years agoNote last commit: changes were made primarily to avoid global variable name
Matthew Dillon [Fri, 5 Nov 2004 03:12:03 +0000 (03:12 +0000)]
Note last commit: changes were made primarily to avoid global variable name
conflicts with library procedures, 'compress' in particular, that somehow
occured in one or more DragonFly configurations and caused savecore to
believe that the -z option had been specified when it had not.

15 years agoDeclare some of the local variables static.
David Rhodus [Thu, 4 Nov 2004 21:51:18 +0000 (21:51 +0000)]
Declare some of the local variables static.

15 years ago- Remove unnecessary selection statement to see if buf == NULL.
Liam J. Foy [Thu, 4 Nov 2004 21:31:37 +0000 (21:31 +0000)]
- Remove unnecessary selection statement to see if buf == NULL.
- Don't use fileno to get stdout, just use STDOUT_FILENO
- Fix malloc err message

OK'ed by: Joerg and Jeroen

15 years agoRemove a.out support from base. Bumb WARNS to 6 for ldconfig.
Joerg Sonnenberger [Thu, 4 Nov 2004 13:14:11 +0000 (13:14 +0000)]
Remove a.out support from base. Bumb WARNS to 6 for ldconfig.

15 years agoRIP gzip, we found a nicer playmate.
Joerg Sonnenberger [Thu, 4 Nov 2004 12:30:53 +0000 (12:30 +0000)]
RIP gzip, we found a nicer playmate.

15 years agoMove libstdc++3 into the attic. It can be removed from the repo later.
Joerg Sonnenberger [Thu, 4 Nov 2004 12:27:53 +0000 (12:27 +0000)]
Move libstdc++3 into the attic. It can be removed from the repo later.

15 years agoRemove incorrect cache_purge() calls in *_rmdir() (OLD API). These could
Matthew Dillon [Wed, 3 Nov 2004 22:07:21 +0000 (22:07 +0000)]
Remove incorrect cache_purge() calls in *_rmdir() (OLD API).  These could
result in a namecache mountpoint entry losing its vnode association under
the new API.

Panic-Reported-by: Stu
15 years agoFix 'route add -host <target> -interface <interface_name>. This was
Matthew Dillon [Tue, 2 Nov 2004 23:49:38 +0000 (23:49 +0000)]
Fix 'route add -host <target> -interface <interface_name>.  This was
previously adding a static arp entry with the interface's MAC address
instead of the target's address or an incomplete address.  The result is
that the target cannot be routed to.

The fix is to (1) Install the route with 'incomplete' link level info rather
then using the interface's MAC address, (2) Allowing the incomplete address
to be resolved and timeout normally, (3) re-clearing the entry to an
incomplete status instead of destroying it when the ARP times out,
and (4) Making 'arp -d -a' only clear link level routes marked static
instead of deleting them.

Noticed-by: Mikhail Teterin <mi+dragonflybsd@aldan.algebra.com>
15 years ago- Allow ipcs to display information about IPC mechanisms owned by
Liam J. Foy [Tue, 2 Nov 2004 19:38:49 +0000 (19:38 +0000)]
- Allow ipcs to display information about IPC mechanisms owned by
  a user. The option for this is -u user. User can be a username or
  a uid. Obtained from FreeBSD

- Allow ipcs to display information about IPC mechanisms owned by
  a group. The option for this is -g group. Group can be a group name or
  a gid. Wrote by me.

Ok'ed by: dillon@ and kernel@

15 years agoNeeded to add sys/types.h for previous commit. Spotted by Mr Dillon.
Liam J. Foy [Sun, 31 Oct 2004 21:37:12 +0000 (21:37 +0000)]
Needed to add sys/types.h for previous commit. Spotted by Mr Dillon.

15 years agoUpdate the sysperf tools to match the current sysmsg functions.
Eirik Nygaard [Sun, 31 Oct 2004 20:19:24 +0000 (20:19 +0000)]
Update the sysperf tools to match the current sysmsg functions.

sc1 times getuid() using the standard syscall method.
sc2 times getuid() using the new sysmsg method.
sc3 runs in an endless loop calling getuid() with the new sysmsg method.

15 years agoThe gr_gid member of the struct group should be gid_t
Liam J. Foy [Sun, 31 Oct 2004 19:01:00 +0000 (19:01 +0000)]
The gr_gid member of the struct group should be gid_t
and not an int.

Submitted by: Douwe Kiela

15 years agoWhoops! setmode(3) returns a void *, not mode_t *.
Liam J. Foy [Sun, 31 Oct 2004 16:18:37 +0000 (16:18 +0000)]
Whoops! setmode(3) returns a void *, not mode_t *.

15 years agoRemove leftover 'is'.
Jeroen Ruigrok/asmodai [Sun, 31 Oct 2004 11:11:54 +0000 (11:11 +0000)]
Remove leftover 'is'.

15 years agoDocument ENOMEM error case, note how strdup() is 1003:2004 sanctioned.
Jeroen Ruigrok/asmodai [Sun, 31 Oct 2004 11:09:44 +0000 (11:09 +0000)]
Document ENOMEM error case, note how strdup() is 1003:2004 sanctioned.

15 years agoAdd iso-C alias and p1003.1-2004 definition.
Jeroen Ruigrok/asmodai [Sun, 31 Oct 2004 10:31:21 +0000 (10:31 +0000)]
Add iso-C alias and p1003.1-2004 definition.

15 years agoWe have to support uncompress by default, because zcat is used e.g.
Joerg Sonnenberger [Sun, 31 Oct 2004 10:26:26 +0000 (10:26 +0000)]
We have to support uncompress by default, because zcat is used e.g.
by the port system for both gzip and compress files. Therefore
replace GZIP_UNCOMPRESS with NO_GZIP_UNCOMPRESS and the reverse meaning.

15 years agoAdd NetBSD 2.0 and DragonFly 1.1.
Jeroen Ruigrok/asmodai [Sun, 31 Oct 2004 10:14:03 +0000 (10:14 +0000)]
Add NetBSD 2.0 and DragonFly 1.1.

15 years agoFix cpdup man page. The option -v[vvv] should be -v[vv].
Liam J. Foy [Sun, 31 Oct 2004 00:43:14 +0000 (00:43 +0000)]
Fix cpdup man page. The option -v[vvv] should be -v[vv].

Submitted by: Sascha Wildner <saw@online.de>

15 years agoBring in Jeff Wheelhouse's CLOG / circular log file support for syslogd,
Matthew Dillon [Sat, 30 Oct 2004 20:26:48 +0000 (20:26 +0000)]
Bring in Jeff Wheelhouse's CLOG / circular log file support for syslogd,
With some formatting changes.

Side note: CLOG's use of mmap within syslogd is very dangerous and could
lead to syslogd seg-faulting out, especially since the control structure
appears to reside at the end of the physical log file.  Users of circular
log files must take care.

Requested-by: The MOB!
15 years agoThe PRId64 check was wrong, causing bootstrapping failures on
Matthew Dillon [Sat, 30 Oct 2004 18:48:31 +0000 (18:48 +0000)]
The PRId64 check was wrong, causing bootstrapping failures on
FreeBSD-4.x boxes.

15 years agoThe last fix wasn't good enough. This one causes the SWIDTH lines to be
Matthew Dillon [Sat, 30 Oct 2004 18:46:07 +0000 (18:46 +0000)]
The last fix wasn't good enough.  This one causes the SWIDTH lines to be
ignored rather then mapped as 0.

15 years agoConditionalize _CTYPE_SW* for bootstrap purposes.
Matthew Dillon [Sat, 30 Oct 2004 18:14:35 +0000 (18:14 +0000)]
Conditionalize _CTYPE_SW* for bootstrap purposes.

Reported-by: esmith <esmith@patmedia.net>
15 years ago- Remove all registers in bin/. This saves us doing it each time we come
Liam J. Foy [Sat, 30 Oct 2004 13:34:50 +0000 (13:34 +0000)]
- Remove all registers in bin/. This saves us doing it each time we come
  across them.

Ok'ed by: Joerg and kernel@

15 years agoAdd omitted space after 'while'.
Jeroen Ruigrok/asmodai [Sat, 30 Oct 2004 12:14:14 +0000 (12:14 +0000)]
Add omitted space after 'while'.

Submitted by: Sascha Wildner
Asked to commit by: joerg

15 years agoRemove the old one-true-awk.
Joerg Sonnenberger [Sat, 30 Oct 2004 11:51:30 +0000 (11:51 +0000)]
Remove the old one-true-awk.

15 years ago-Set WARNS to 6
Liam J. Foy [Fri, 29 Oct 2004 17:09:09 +0000 (17:09 +0000)]
-Set WARNS to 6
-Add -b option. The option will print the time and date of
 last reboot
-Update man page for the -b option
-Add DragonFly tag

Ok'ed by: Joerg
Subitted by: Douwe Kiela <virtus@wanadoo.nl>

15 years agoAdd special case for the german whois nameserver. Without the
Liam J. Foy [Fri, 29 Oct 2004 15:44:41 +0000 (15:44 +0000)]
Add special case for the german whois nameserver. Without the
'-T dn,ace -C US-ASCII' option one does only get:

$ whois nic.de

domain:    nic.de
status:    connect

More information available on:

http://www.denic.de/en/domains/technik/denic_whois-server/index.html

Obtained-From: FreeBSD
Submitted by: Douwe Kiela <virtus@wanadoo.nl>

15 years ago- Remove unnecessary (void) casts
Liam J. Foy [Fri, 29 Oct 2004 15:18:53 +0000 (15:18 +0000)]
- Remove unnecessary (void) casts
- Use mkstemp over mktemp

Submitted by: Douwe Kiela <virtus@wanadoo.nl>

15 years ago- Bump WARNS to 6
Liam J. Foy [Fri, 29 Oct 2004 15:10:55 +0000 (15:10 +0000)]
- Bump WARNS to 6
- Remove unnecessary (void) casts
- Add $DragonFly$ tag

Submitted by: Douwe Kiela <virtus@wanadoo.nl>

15 years ago- Add $DragonFly$
Liam J. Foy [Fri, 29 Oct 2004 13:52:53 +0000 (13:52 +0000)]
- Add $DragonFly$
- Add WARNS?= 6
- Static usage()
- Add setlocale() call
- Remove ? case

15 years agoUse rune.h instead of runetype.h.
Jeroen Ruigrok/asmodai [Fri, 29 Oct 2004 06:03:21 +0000 (06:03 +0000)]
Use rune.h instead of runetype.h.
Add swidth definitions and lex code to mklocale.
Update manual page with character set encoding information.
Remove deprecated keyword.

Taken from: FreeBSD
Submitted by: Andreas Hauser

15 years agoAdd more locales:
Jeroen Ruigrok/asmodai [Fri, 29 Oct 2004 05:55:50 +0000 (05:55 +0000)]
Add more locales:

Amharic (Ethiopic), Belarusian, Armenian, Kazakh, Korean, various Chinese
encodings.

Taken from: FreeBSD
Submitted by: Andreas Hauser

15 years agoAdd definitions for _CTYPE_SW[0-4MS].
Jeroen Ruigrok/asmodai [Fri, 29 Oct 2004 05:44:40 +0000 (05:44 +0000)]
Add definitions for _CTYPE_SW[0-4MS].

Taken from: FreeBSD

15 years agounmount was not removing the negative hits associated with a mount point.
Matthew Dillon [Thu, 28 Oct 2004 18:56:52 +0000 (18:56 +0000)]
unmount was not removing the negative hits associated with a mount point.
Assign ncp->nc_mount for all nodes and simplify cache_purgevfs() to handle
all cases.

15 years ago-Setmode will deal with the octals, so we dont need to.
Liam J. Foy [Thu, 28 Oct 2004 16:49:24 +0000 (16:49 +0000)]
-Setmode will deal with the octals, so we dont need to.
-Setmode can also be caused to fail because of malloc().
 We test to see setmode() has failed. If it has we check errno.
 If errno == 0 then we have an invalid file mode. If not malloc
 has failed and we the print the error via err().
-Remove '?' case.
-Fix some data types. This is for the setmode fix above.

3 days with no objections has passed!

15 years ago`proto' field was forgotten in the previous commit.
YONETANI Tomokazu [Thu, 28 Oct 2004 08:47:11 +0000 (08:47 +0000)]
`proto' field was forgotten in the previous commit.

Reported-By: Erik P. Skaalerud <erik (at) pentadon.com>
15 years agoSwitch to libz-based gzip.
Joerg Sonnenberger [Wed, 27 Oct 2004 16:34:32 +0000 (16:34 +0000)]
Switch to libz-based gzip.

15 years agoDefine PRId64 as "lld" for older systems laking support for it.
Joerg Sonnenberger [Wed, 27 Oct 2004 16:31:06 +0000 (16:31 +0000)]
Define PRId64 as "lld" for older systems laking support for it.
This is necessary e.g. for FreeBSD 4.9 to build.

Submitted-by: Matt Dillon
15 years agoSince there isn't an authpf user we'll have to grep for the authpf
David Rhodus [Wed, 27 Oct 2004 16:09:32 +0000 (16:09 +0000)]
Since there isn't an authpf user we'll have to grep for the authpf
group member.

Noted by: walt <wa1ter@myrealbox.com>

15 years agoRemove unused variable.
Matthew Dillon [Wed, 27 Oct 2004 08:57:48 +0000 (08:57 +0000)]
Remove unused variable.

15 years agonull_revoke() needs to return 0.
Matthew Dillon [Wed, 27 Oct 2004 08:52:06 +0000 (08:52 +0000)]
null_revoke() needs to return 0.

15 years agoFix a NULL pointer dereference panic that occurs when the TCP protocol
Matthew Dillon [Wed, 27 Oct 2004 03:43:47 +0000 (03:43 +0000)]
Fix a NULL pointer dereference panic that occurs when the TCP protocol
stack races against userland while closing a tcp connection.  It is
possible for userland to queue a disconnect request but for the protocol
stack to then receive a packet that causes it to call tcp_drop()->tcp_close()
which also disconnects the inpcb from the tcpcb.  When the protocol stack
then processes the disconnect request it hits the panic because the inpcb
no longer has a tcpcb connected to it.

The bug generally only occured on SMP systems where the latency in intra-cpu
communication opens up the window of opportunity for the bug to occur.

Panic-Reported-by: Adam K Kirchhoff <adamk@voicenet.com>