Commit Graph

4813 Commits

Author SHA1 Message Date
Robert Watson
f93d36fd92 Add "-q" argument to sysctl(8), which suppresses a limited set of warnings/
errors generated.  In particular, it suppresses "unknown oid" when
attempting to get or set a sysctl not present in the kernel.

MFC after:	1 week
2005-09-15 16:08:04 +00:00
Ralf S. Engelschall
724447ac41 Fix system shutdown timeout handling by again supporting longer running
shutdown procedures (which have a duration of more than 120 seconds).

We have two user-space affecting shutdown timeouts: a "soft" one in
/etc/rc.shutdown and a "hard" one in init(8). The first one can be
configured via /etc/rc.conf variable "rcshutdown_timeout" and defaults
to 30 seconds. The second one was originally (in 1998) intended to be
configured via sysctl(8) variable "kern.shutdown_timeout" and defaults
to 120 seconds.

Unfortunately, the "kern.shutdown_timeout" was declared "unused" in 1999
(as it obviously is actually not used within the kernel itself) and
hence was intentionally but misleadingly removed in revision 1.107 from
init_main.c. Kernel sysctl(8) variables are certainly a wrong way to
control user-space processes in general, but in this particular case the
sysctl(8) variable should have remained as it supports init(8), which
isn't passed command line flags (which in turn could have been set via
/etc/rc.conf), etc.

As there is already a similar "kern.init_path" sysctl(8) variable which
directly affects init(8), resurrect the init(8) shutdown timeout under
sysctl(8) variable "kern.init_shutdown_timeout". But this time document
it as being intentionally unused within the kernel and used by init(8).
Also document it in the manpages init(8) and rc.conf(5).

Reviewed by: phk
MFC after: 2 weeks
2005-09-15 13:16:07 +00:00
Joel Dahl
abca6092a9 Xref msdosfs(5)
Approved by:	brueffer (mentor)
2005-09-14 16:36:19 +00:00
Robert Watson
d32e7ba722 Don't consider being unable to open the bounds file worthy of printing
at LOG_WARNING by default; instead, consider it something to be printed
to the tty when 'verbose' mode is set.  This avoids printing out extra
lines at every boot on a system with crash dumps enabled, but that has
not yet had to generate a crashdump.

MFC after:	1 week
2005-09-13 19:15:28 +00:00
Lukas Ertl
a48c2af028 Clean up.
Remove unused functions.

Reduce indentation level by reverting the logic of the enclosing
conditional statement.
2005-09-12 14:31:49 +00:00
Pawel Jakub Dawidek
df7eabb059 Even if there are no valid keys in metadata, but provider is attached
we can still use setkey subcommand.

MFC after:	3 days
Found by:	regression tests
2005-09-10 07:43:03 +00:00
Brooks Davis
dd415a50d6 Avoid updating resolv.conf when no changes have actually occured.
Submitted by:	ume
2005-09-08 22:49:17 +00:00
Brooks Davis
3d0181db3f When we fail to aquire a lease, our lease expires without a sucessful
renewal, or we lose link, be more forceful about clearing interface
state so another interface that connects to the same network has a
chance of working.  This doesn't address attemping to connect to both at
once, but appears to allow unplugging from a wired interface and then
inserting a wireless card that associates with an AP bridged to the same
LAN.
2005-09-08 22:15:19 +00:00
Gary W. Swearingen
e17c0e3256 Moved descriptions of securelevels from init(7) to security(7).
Files used both "securelevel" and either "secure level" or
"security level"; all are now "security level".

PR:             docs/84266
Submitted by:   garys
Approved by:    keramida
MFC after:      3 days
2005-09-03 17:16:00 +00:00
Brooks Davis
40767e22ea When we supersed the subnet-mask, write the forced value to the lease
file.  This is what the ISC client does.

Submitted by:	Rostislav Krasny <rosti dot bsd at gmail dot com>
2005-09-02 17:35:35 +00:00
Marcel Moolenaar
5201042924 Add support for setting GPT partition labels. The partitions to be
labeled are selected in the same way as with the remove command.
Update the manpage to have the selection options described for the
label command and referenced to it from the remove command.
The label can be specified on the command line with the -l option
or read from a file with the -f option. In both cases, the label
is assumed to be encoded in UTF-8.

PR: ia64/83124
MFC after: 1 week
2005-09-01 02:49:20 +00:00
Marcel Moolenaar
376e47e284 Dot the i's: multiple devices can be specified, so the usage should
have ellipsis following the device.
2005-09-01 02:42:52 +00:00
Marcel Moolenaar
bdcb67f435 Add a comment before the statement that is responsible for the
removal of the GPT entry. There's a bit of code around that one
statement that it's good to have it stand out a bit more.
2005-09-01 01:15:22 +00:00
Marcel Moolenaar
6918ad7096 Document the -l and -u options of the show command. 2005-08-31 05:56:21 +00:00
Marcel Moolenaar
06185c565b o Replace unicode16() by utf8_to_utf16().
o  Introduce utf16_to_utf8().
o  Add option -l to the show command to display the GPT label instead
   of the friendly partition type.
o  Add option -u to the show command to suppress the friendly output
   and print th raw UUIDs instead.
2005-08-31 05:40:41 +00:00
Marcel Moolenaar
27e701229c /* -> /*- for license. 2005-08-31 01:47:19 +00:00
Brooks Davis
f954ec0bcf Introduce a new helper function check_search() derived for res_hnok to
check the domain-name parameter according to the rules for "search"
strings as documented in resolv.conf(5).  Specifically, the string must
be no more than 256 bytes long and contain no more than six valid domain
names separated by white space.

The previous unchecked values could result in a mangled resolv.conf
file which could effectively deny access to local sites.  This is not
a security issue as rogue dhcp servers could already do this without
sending invalid strings.

Reviewed by:	cperciva
MFC After:	3 days
2005-08-30 18:20:46 +00:00
Christian S.J. Peron
c313f09bfb When using files as backing stores for devices, and the user has requested the
device be created read+write, check to see if the backing store is read only
through the use of the access(2) system call. If this check fails returning
EACCES, EPERM or EROFS then gracefully downgrade the access to read only. Also
print a warning message to stderr, informing the user that the access mode
they requested is not available.

This behavior used to be handled by md(4) but was changed in revision 1.154

Discussed with:	pjd, phk, Dario Freni <saturnero at freesbie dot org>
Reviewed by:	phk
2005-08-30 16:45:32 +00:00
Marcel Moolenaar
4a8718928d This script was helpful during development, but has no reason to
be kept alive. Removal is long overdue as it is.
2005-08-30 06:20:20 +00:00
Marcel Moolenaar
14cbcc591c Don't print the total number of partitions removed now that we print
the name of the partitions that we remove. A summary is unnecessary
and even makes parsing of the output more difficult.

MFC after: 1 week
2005-08-30 06:16:31 +00:00
Maxim Sobolev
db45c56d7d Extend utility to allow recovering single file from the deffective
media.

MFC after:      2 weeks
2005-08-29 23:08:01 +00:00
Giorgos Keramidas
fc3643bb24 Make it clear that the .ko extention of a module to be loaded
is optional.

PR:		docs/85356
Submitted by:	Julien Gabel <jpeg@thilelli.net>
MFC after:	3 days
2005-08-27 22:25:51 +00:00
Marius Strobl
52a7b796a4 As with NO_CRYPT, don't try to compile geli(8) when NO_OPENSSL is defined
either.

MFC after:	1 week
2005-08-27 20:51:12 +00:00
Brooks Davis
001f040a03 The $medium string often contains quoted values with spaces in them (ssids,
for example).  Follow the example of the ISC script and wrap ifconfig
calls using $medium in eval "..." so this works.

Reported by:	iedowse
2005-08-26 20:31:04 +00:00
Takanori Watanabe
cf5a7ef8d1 Update Document. 2005-08-26 11:39:38 +00:00
Brooks Davis
753d6c0327 In read_string(), when the last character was a backslash, unincrement
the output index instead of keeping what ever trash was in the buffer.

Reported by:	iedowse
2005-08-26 01:25:59 +00:00
Brooks Davis
6ae27cb6ce Use a more robust, grep-free command to get the interface of the current
default route.

Submitted by:	Rostislav Krasny <rosti dot bsd at gmail dot com>
2005-08-26 01:07:51 +00:00
Brooks Davis
7e82455ea8 Don't and/remove a route to our assigned IP through 127.0.0.1. It
serves no apparent purpose (we commented this out ages ago in the ISC
scripts) and cases problems with some ADSL setups.

Reported by:	Rostislav Krasny <rosti dot bsd at gmail dot com>
2005-08-26 01:02:38 +00:00
Brooks Davis
1469b42c7d MFOpenBSD rev 1.9: fix a buffer overflow when processing config file
lines that are exactly 81 characters in length.

Obtained from:	OpenBSD
MFC After:	3 days
2005-08-24 00:05:04 +00:00
Brooks Davis
8794fdbb48 Add __FBSDID to all .c files in dhclient to aid in determining file
versions when dealing with user problems.
2005-08-23 23:59:55 +00:00
Christian S.J. Peron
4d3d08301e FreeBSD unconditionally supports write filters now. 2005-08-23 01:35:38 +00:00
Pawel Jakub Dawidek
dd549194ae By default, when doing crypto work in software, start as many threads
as we have active CPUs and bind each thread to its own CPU.

MFC after:	3 days
2005-08-21 18:12:51 +00:00
Simon L. B. Nielsen
b92f49fa86 Remove reference to raid(4), the RAIDframe manual page, which was
deleted a while ago.

PR:		docs/85142
Submitted by:	Jeremy Chadwick <freebsd@jdc.parodius.com>
MFC after:	3 days
2005-08-20 09:10:31 +00:00
Pawel Jakub Dawidek
7a5c26fcbd Allow to change number of iterations for PKCS#5v2. It can only be used
when there is only one key set.

MFC after:	3 days
2005-08-19 22:19:25 +00:00
Pawel Jakub Dawidek
829781048d Move function for calculating number of bits into more central place.
I want to use it so more.

MFC after:	3 days
2005-08-19 22:13:09 +00:00
Ian Dowse
a00a259113 Add the ability to specify the boot2 serial console speed in
/boot.config or on the "boot:" prompt line via a "-S<speed>" flag,
e.g. "-h -S19200". This adds about 50 bytes to the size of boot2
and required a few other small changes to limit the size impact.
This changes only affects boot2; there are further loader changes
to follow.
2005-08-18 00:42:45 +00:00
Pawel Jakub Dawidek
4cb6ca7622 Update manual page (now dedicated kernel thread is always started).
MFC after:	3 days
2005-08-17 15:27:23 +00:00
Christian Brueffer
8d8b579597 Clarify how the 'channel' argument should look like and add an
example on how to obtain information on devices on an ata channel.

PR:		84676
Submitted by:	Kevin Oberman <oberman@es.net>
		Jeremie Le Hen <jeremie@le-hen.org>
MFC after:	3 days
2005-08-16 21:14:25 +00:00
Gleb Smirnoff
9ff95228e8 Implement a new feature for ping(8) - sweeping pings. In a sweeping
ping ICMP payload of packets being sent is increased with given step.
Sweeping pings are useful for testing problematic channels, MTU
issues or traffic policing functions in networks.

PR:		bin/82625
Submitted by:	Chris Hellberg <chellberg juniper.net> (with some cleanups)
2005-08-15 14:15:37 +00:00
Ian Dowse
3b89beb171 Attempt to improve the logic for automatically sizing partitions
to take into account the new default of starting the first partition
after the boot blocks instead of at sector 0. If you used automatic
sizing when the first partition did not start at 0, you would get
an error that the automatically sized partition extended beyond the
end of the disk.

Note that there are probably still many more complex cases where
automatic sizing and placement will not work (e.g. non-contiguous
or out of order partitions).
2005-08-14 22:46:50 +00:00
Pawel Jakub Dawidek
a73148d28d Unfortunately dlerror(3) returns string, so there is no clean way to
ignore "no such file" errors only, which I wanted to do.
Because of this I ignored all other errors on dlopen(3) failure as well,
which isn't good.
Fix this situation by calling access(2) on library file first and ignore
only ENOENT error. This allows to report all the rest of dlopen(3) errors.

MFC after:	3 days
2005-08-14 21:55:18 +00:00
Ian Dowse
9405aea2e2 Don't treat failure to find the operator GID as a fatal error; this
made it impossible to use newfs (and mdmfs) when /etc/group is
missing and /etc is read-only.
2005-08-14 17:07:04 +00:00
Pawel Jakub Dawidek
5b5a030fa4 When keys were configured without passphrase, number of iterations in
metadata is equal to -1. if we then wanted to attach provider (or change
keys) and forget about '-p' flag it failed on assertion (quite ok, without
assertion it could call PKCS#5v2 with 4294967295 iterations).

Instead of failing on assertion, remind about '-p' flag.

MFC after:	3 days
2005-08-14 14:13:07 +00:00
Andrew Thompson
db7d6dc145 Document two missed if_bridge commands 'addr' and 'static'.
Noticed by:	Michal Mertl
Approved by:	mlaier (mentor)
MFC after:	3 days
2005-08-14 03:28:08 +00:00
Sam Leffler
29f0e92957 add list mac and mac:kick support
Submitted by:	Michal Mertl (original version)
MFC after:	2 weeks
2005-08-13 17:38:09 +00:00
Bjoern A. Zeeb
9066356ba1 * Add dynamic sysctl for net.inet6.ip6.fw.
* Correct handling of IPv6 Extension Headers.
* Add unreach6 code.
* Add logging for IPv6.

Submitted by:	sysctl handling derived from patch from ume needed for ip6fw
Obtained from:	is_icmp6_query and send_reject6 derived from similar
		functions of netinet6,ip6fw
Reviewed by:	ume, gnn; silence on ipfw@
Test setup provided by: CK Software GmbH
MFC after:	6 days
2005-08-13 11:02:34 +00:00
Pawel Jakub Dawidek
325319eb3d GELI doesn't need cryptodev.
MFC after:	2 days
2005-08-12 07:44:42 +00:00
Pawel Jakub Dawidek
9417a618d1 Add code for Ext2FS and ReiserFS labels recognition.
Submitted by:	Stanislav Sedov <stas@310.ru>
PR:		kern/84638
MFC after:	1 week
2005-08-12 00:27:45 +00:00
Stefan Farfeleder
515faf2fbe The libedit update made a const cast necessary. 2005-08-07 20:53:33 +00:00
Søren Schmidt
3ea7aedd41 Fix status to report status from the given array. 2005-08-05 13:08:02 +00:00