Commit Graph

9846 Commits

Author SHA1 Message Date
David Malone
3b7e120185 Try to be more careful about using using the file descriptor f_file.
Syslogd should ensure that f_file is a valid file descriptor when
f_type is FILE, CONSOLE, TTY and for a PIPE where f_pid > 0. If the
descriptor is closed/invalid then the type should be set to UNUSED
or the pid should be set to 0.

To this end:
1) Don't close(f->f_file) if we can't send a message to a remote
   host because the file descriptor used for remote logging is
   stored in finet, not in f->f_file. f->f_file is probably
   uninitialised, so I guess we usually end up closing fd 0.
2) Don't close PIPE file descriptors if they are invalid.
3) If the call to p_open fails, don't set the pid.

The OpenBSD patches in this area set f_file to -1 after the fd is
closed and then avoids calling close if f_file < 0. I haven't done
this, but it might be a good idea too.

Inspired by:	PR 67139/OpenBSD
2004-05-30 00:02:19 +00:00
David Malone
75030d0676 Some string fixes.
1) Use strncpy on strings out of utmp.
2) Avoid running off the start of one string while removing white space.
   (I've used slightly different code to OpenBSD here.)
3) Ignore trailing spaces in the priority.

PR:		67139
Submitted by:	Xin LI <delphij@FreeBSD.org.cn>
Obtained from:	OpenBSD
2004-05-29 23:40:30 +00:00
David Malone
6f8c264082 Exit with a warning if the path to one of the logging sockets is
too long, rather than silently truncating them.

PR:		67139
Inspired by:	OpenBSD
2004-05-29 23:27:50 +00:00
David Malone
ac3a1548f8 Fix some bugs that don't manifest themselves in practice.
1) Don't check for getopt returning '?', we have a default case.
2) Check if the priority is LOG_KERN correctly - in practice
   LOG_KERN is 0, so it makes no difference. OpenBSD fixed a
   different nearby bug that we don't have 'cos our definition
   of LOG_MAKEPRI is different to OpenBSD's.

Copy a comment from OpenBSD, observing that LOG_KERN is 0.

Inspired by PR:		67139
2004-05-29 23:24:18 +00:00
David Malone
a944213190 Update a couple of comments.
PR:		67139
Submitted by:	Xin LI <[3]delphij@FreeBSD.org.cn>
Obtained from:	OpenBSD
2004-05-29 23:14:03 +00:00
Christian S.J. Peron
0f27b90770 Remove constant which makes the assumption that the length of
_PATH_DEV will never change. In the un-likely event that _PATH_DEV
should ever change, watch(8) would have broke because of a
mis-generated device name.

Approved by:	bmilekic (mentor)
Pointed out by:	Yvan Boily
2004-05-29 21:03:00 +00:00
Maxim Konovalov
927b481001 o Implement -U flag: run command as user which exists only in jail.
o getpwnam(3) returns NULL and does not set errno when the user does
  not exist.  Bail out with "no such user" instead of "Unknown error: 0".

PR:		bin/67262
Submitted by:	demon (-U flag)
MFC after:	3 weeks
2004-05-29 18:39:27 +00:00
Maxim Konovalov
f1c599147f Format nits. 2004-05-29 06:10:42 +00:00
Tim J. Robbins
b71e13d373 Fix the type of struct bbf's arc_count member: according to gcc's
definition of struct bb_function_info in libgcc2.c, it should be
an int, not a long.
2004-05-29 01:22:53 +00:00
Stefan Farfeleder
11012a9973 Include <net/ethernet.h> to have a prototype for ether_ntoa().
Approved by:	das (mentor)
2004-05-28 17:44:11 +00:00
Nate Lawson
a773b841f2 Unify the start/size parameters for the RSDP search area. Don't bother
trying to exclude the top end of the range since it should hurt to overlap
by 4 bytes in the off-chance the RSDP signature appears incorrectly at the
very top of our search space.
2004-05-28 07:25:23 +00:00
Nate Lawson
a607c5e4cb Check for >= 255 since sign extension from byte to u_int sometimes makes
the value for "unknown" 0xffffffff.  The underlying kernel drivers should
be updated to only return 255 but the ABI is used by too many userland
utilities.

Also, make this WARNS 6 compatible.
2004-05-27 19:23:27 +00:00
Joerg Wunsch
cc09a897ee Fix an off-by-one error in the range check for the maximal -i or -o
block size.
2004-05-27 13:31:16 +00:00
Brooks Davis
cb5df0b27b Use new eui64(3) functions to print EUI-64s and to allow access to nodes
by EUI-64 and name.

Reviewed by:	simokawa
2004-05-26 22:59:55 +00:00
David Malone
ef4dd325c4 Silence some constness and printf type warnings. Most of the
const fixes are ugly 'cos the types in an iovec aren't quite
right for a writev.
2004-05-26 21:14:13 +00:00
Pawel Jakub Dawidek
8a4979c259 Actually negative size is possible for file system, but not for disk. 2004-05-25 12:11:13 +00:00
Maxim Konovalov
b495040835 o Fix typo: s/bslim/bhlim/.
PR:		docs/67170
Submitted by:	Anatoly Zherdev
MFC after:	3 days
2004-05-25 10:43:46 +00:00
Nate Lawson
2c0d74e8e8 Use the correct location of the EBDA for searching for the RSDP.
The EBDA is the 1 KB area addressed by the 16 bit pointer at 0x40E.

Pointed out by:	robert.moore AT intel.com
2004-05-25 05:52:48 +00:00
Nate Lawson
f0dfade9f7 Add suspend/resume support to the debugger. 2004-05-25 02:56:55 +00:00
Pawel Jakub Dawidek
991d64ece8 In verbose mode print disk sizes in human readable form as well.
OK'ed by:	phk
2004-05-24 22:52:32 +00:00
Stefan Farfeleder
e54fb3f2dc Include <timeconv.h> for time conversion functions.
Approved by:	das (mentor)
2004-05-24 16:10:57 +00:00
Lukas Ertl
ede09ff6de Add option '-o' for one-line output in combination with '-d'.
PR:             bin/62911 (patch slightly adopted)
Submitted by:   Corris Randall <corris@line6.net>
2004-05-24 13:22:00 +00:00
Stefan Farfeleder
28e1bf4689 Include <stdlib.h> for exit() and abort() prototypes.
Approved by:	das (mentor)
2004-05-24 13:21:24 +00:00
Stefan Farfeleder
8b061e144e Include <string.h> for prototypes of various string functions.
Approved by:	das (mentor)
2004-05-24 12:44:00 +00:00
Lukas Ertl
835f983348 Diff reduction to NetBSD.
MFNetBSD 1.21; author: itojun
   use bounded string op

MFNetBSD 1.22; author: grant
   s/netbsd.org/NetBSD.org/i

Obtained from:  NetBSD
2004-05-24 12:38:54 +00:00
Stefan Farfeleder
3ff0fa2ac5 Include <rpc/rpc_com.h> for a _rpc_dtablesize() prototype.
Approved by:	das (mentor)
2004-05-24 12:28:27 +00:00
Stefan Farfeleder
40905e9049 Include <netinet/in.h> for ntoh*() and hton*() prototypes.
Approved by:	das (mentor)
2004-05-24 11:59:17 +00:00
Bruce Evans
be8282ba22 Build kgmon for amd64. 2004-05-23 18:30:08 +00:00
Doug Rabson
3d7b1b4143 Don't crash if the CROM is all zeros. 2004-05-23 10:06:33 +00:00
Marius Strobl
458e5419e6 - Add a reference to eeprom(8).
- Spell Open Firmware as "Open Firmware", the way it's done on
  OpenFirmware.org.
2004-05-22 17:06:54 +00:00
Marius Strobl
156e1dec14 Hook eeprom(8) up to the FreeBSD/sparc64 build. 2004-05-22 17:03:52 +00:00
Marius Strobl
96818a07a7 Add eeprom(8), a utility to display and modify system configurations
stored in EEPROM or NVRAM. It's inspired by the NetBSD eeprom(8) and
the SunOS/Solaris eeprom(1M) utilities. Currently, this eeprom(8)
only supports systems equipped with Open Firmware and is only tested
on Sun machines but should work on any platform using Open Firmware.
A bit more specific, eeprom(8) can be used on these systems to do the
same under FreeBSD as can be done using the printenv and setenv
commandos in the boot monitor. One thing that only hardly can be done
using the boot monitor but easily with eeprom(8) is to write a logo
to the "oem-logo" property. eeprom(8) may also be useful to recover
the boot monitor password (in the default configuration only as root,
of course), i.e. when the boot monitor allows you to boot but you
can't alter the configuration because the password is unknown. The
man page may also be a useful reference of the various configuration
variables.

The idea of eeprom(8) is that handlers can be written to add support
for any firmware that stores such configuration in EEPROM or NVRAM;
sort of e.g. eeprom(1M) on Solaris/x86 is used to turn PAE-support
on and off (stored in a file then, not hardware). In FreeBSD, a
candidate for this would be a handler for the EFI boot environment
for FreeBSD/ia64.

eeprom(8) uses some code from NetBSD (eeprom.c and the base for
eeprom.8), the handler for the Open Firmware /options node
(ofw_options.[c,h]) was written using ofw_util.[c,h] from ofwdump(8).

Reviewed by:	ru (slightly earlier version of the man page)
2004-05-22 16:56:04 +00:00
Marius Strobl
8cc2c16287 - Change ofwdump(8) to use sysexits(3) exit codes.
- Make the code use the new OFIOCMAXVALUE instead of defining the maximum
  length of property values locally.
- Move the application specific parts from ofw_util.c to ofwdump.c in
  order to make ofw_util.c more library-like. While ofw_dump_properties()
  could be made non-specific to ofwdump(8) it's currently optimized for
  use in ofwdump(8) and making it a library-like function would just
  complicate the code unnecessarily.
- Minor clean-up in ofw_util.c, e.g. make its use of getopt(3) the way
  it's described in style(9), make its usage() static, etc.
- Add a comment in ofw_util.c about why it doesn't call usage() when
  neither the "-a" option nor a node-name where given.
- Add ofw_optnode() and ofw_setprop(), helper functions for the
  OFIOCGETOPTNODE and OFIOCSET ioctls respectively, to ofw_util.[c,h].
- Be consistent with the use of 'const' in ofw_util.[c,h] and add 'const'
  to the function arguments that are acutally const but weren't declared
  as such.
- Mark WARNS=6 clean.

Approved by:	tmm
2004-05-22 16:51:11 +00:00
Josef El-Rayes
7baa65c8e4 Some wordsmithing and mdoc(7) cleanup.
Submitted by:   Michel Lavondès <fox@vader.aacc.cc.md.us>
PR:             docs/66823
Reviewed by:    simon
2004-05-21 21:38:17 +00:00
Daniel Harris
3e580b38ba Typos and nits. 2004-05-20 06:37:44 +00:00
Pawel Jakub Dawidek
147110cb2d Document security.jail.getfsstatroot_only sysctl.
Obtained from:	rwatson's commit log
Approved by:	rwatson
2004-05-20 05:30:16 +00:00
Diomidis Spinellis
dfb3194a21 Send RADIUS gigaword data when OctetsIn or OctetsOut go over UINT32_MAX.
PR:		bin/61294
Submitted by:	Boris Kovalenko
MFC after:	3 weeks
2004-05-19 21:00:42 +00:00
Ken Smith
9b70da0af7 Pressing 's' in the initial menu should result in selecting the 'Standard'
installation as far as most people are concerned but both 'Standard' and
'Select' begin with S and 'Select' is winning.  This makes it so 'Select'
is not select-able using a keystroke but that is probably for the best
and the text on the screen adequately describes how to move back and forth
between 'Select' and 'Exit'.

Adapted from work by:	josef@
PR:			i386/37999
MFC after:		1 week
2004-05-18 16:18:04 +00:00
Joerg Wunsch
2c2d85914f Fix my own style(9) bugs:
. forward declare all static functions
. add a couple of redundant parens in return statements where they've
  been missing
. remove the space after exit since it's a function
2004-05-17 19:19:08 +00:00
Joerg Wunsch
80cdf39ac9 Wire smbmsg(8) into the build. 2004-05-17 10:57:03 +00:00
Joerg Wunsch
325bf22bbd This is smbmsg(8), a small utility to send/receive SMBus messages.
Also included is a `bus-probe' modus of operation to help scanning
an I2C bus.
2004-05-17 10:56:05 +00:00
Stefan Farfeleder
a752604477 Remove spurious semicolons. Outside of functions they are actually errors but
GCC doesn't warn about them without -pedantic.

Approved by:	das (mentor)
PR:		56649
Reviewed by:	md5
2004-05-16 22:08:17 +00:00
Yaroslav Tykhiy
f5896baf9c Add two new options to cron(8), -J and -j. They allow to specify
the maximum amount of time jitter for root and other users, respectively.
Before starting a job, cron(8) will sleep a random number of seconds,
from 0 to the amount specified.  This can help to smooth down load spikes
when a lot of jobs are to start at the beginning of a particular minute
(e.g., the first minute of an hour.)

PR:		bin/66474
Submitted by:	Dmitry Morozovsky <marck <@> rinet.ru>
2004-05-16 19:29:33 +00:00
Nate Lawson
07c8b2af05 If the revision is 0, don't trust the length in the RSDP. Instead assume
an ACPI version 1.0 length.
2004-05-16 18:02:47 +00:00
Nate Lawson
2ff84d1485 Read in the entire RSDP but only run the standard checksum over the
version 1 header.  Add comments to explain what we're doing here better.

Reported by:	Alex Vasylenko <lxv@omut.org>
2004-05-16 05:31:40 +00:00
Matthew N. Dodd
8ebcdbf707 Correct a typo in column header.
Submitted by:	 phk
Obtained from:	 BSDCan
2004-05-15 16:06:59 +00:00
Peter Grehan
7a08579a08 Hook sysinstall to the build for powerpc. 2004-05-15 05:07:14 +00:00
Peter Grehan
ee607da1b8 Mods for powerpc.
Submitted by:  Suleiman Souhlal <refugee@segfaulted.com>
2004-05-15 05:06:19 +00:00
Nate Lawson
8fc0f4c675 Instead of scanning the entire lower 1 MB of RAM, only scan locations
where the RSD PTR can actually occur.  According to section 5.2.2
of the ACPI spec, we only consider two regions for the base address:

    1. EBDA (0x0 - 0x3FF)
    2. High memory (0xE0000 - 0xFFFFF)

I don't know whether this fixes any actual problems but is more correct.
2004-05-14 16:52:39 +00:00
Olivier Houchard
c7730c31ca Do not build sysintall for arm. 2004-05-14 13:44:55 +00:00