Commit Graph

4848 Commits

Author SHA1 Message Date
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
Stefan Farfeleder
a3ae5e4ede Use socklen_t where appropriate. 2005-08-05 09:58:49 +00:00
Stefan Farfeleder
d414fcbc3e Garbage collect useless variables. 2005-08-05 07:39:39 +00:00
Stefan Farfeleder
435071dff3 Use the C99 syntax for designated initialisers. 2005-08-05 07:33:50 +00:00
Stefan Farfeleder
70382d5abe Fix commen typos. 2005-08-03 20:57:33 +00:00
Ruslan Ermilov
a5de1230a9 Add missing check for the NO_CRYPT build option.
Reported by:	Alexander Polakov
2005-08-02 20:12:30 +00:00
Sam Leffler
aeffcba3c1 Wireless suport fixups: add a bunch of stuff that's been in the
code but not documented (e.g. wme, mac acl) and correct some
information, etc.

Reviewed by:	brueffer
2005-08-02 19:13:13 +00:00
Sam Leffler
7c0cbd3bfa acm and ack are specified per-ac
MFC after:	3 days
2005-08-01 16:34:41 +00:00
Ceri Davies
b1f1271f26 Correct the description of the TAPE environment variable.
Based on:

PR:		docs/84200
Submitted by:	Gary W. Swearingen <garys at opusnet dot com>
MFC after:	1 week
2005-07-31 13:56:19 +00:00
Christian Brueffer
acc79971c2 Misc cleanup (spelling, grammar, mdoc, style, cut >80 char lines). 2005-07-30 13:27:15 +00:00
Sam Leffler
0c36e9bb67 oops, revert previous change 2005-07-30 03:30:29 +00:00
Sam Leffler
4e5771359e MFC: add fragthreshold parameter and accept - (or any) for rtsthreshold
Approved by:	re (kensmith)
2005-07-30 03:28:41 +00:00
Pawel Jakub Dawidek
16a563e2b4 Update manual page after ggate rewrite.
MFC after:	1 day
2005-07-29 11:22:13 +00:00
Pawel Jakub Dawidek
fd833a6a19 I actually do need libmd. 2005-07-29 10:06:57 +00:00
Brooks Davis
289d89d80f Further fix receive_packet() by using BPF_WORDALIGN to insure the offset
is properly aligned when we move to the next packet.

Obtained from:	ISC dhclient via krw at OpenBSD
2005-07-28 15:30:19 +00:00
Giorgos Keramidas
497dd0f938 Spell "partition" correctly.
PR:		docs/84198
Submitted by:	Gary W. Swearingen
MFC after:	3 days
2005-07-28 10:48:07 +00:00
Brooks Davis
acccb9aa83 Don't reject packets with server names containing characters that are
not allowed in domain names.  RFC 2132 does not list valid or invalid
characters and the ISC client accepts anything here.

Reported by:	ps
2005-07-28 00:24:39 +00:00
Pawel Jakub Dawidek
a05fe8d0e5 I think I found the problem, reconnect geli to the build. 2005-07-27 23:56:32 +00:00
Pawel Jakub Dawidek
0ee6653d31 - Reduce WARNS level to 3, so it will be compilabe on alpha.
- Don't link libmd, it is not needed.
- Connect manual page to the build.

MFC after:	1 week
2005-07-27 23:56:01 +00:00
Pawel Jakub Dawidek
f90af958e4 Disconnect geli from the build for now.
I need to find out first what is the cause of sha2.c compilation problem
on alpha.
2005-07-27 23:30:50 +00:00
Pawel Jakub Dawidek
5ca1fcfe06 Connect GEOM_ELI class to the build.
MFC after:	1 week
2005-07-27 21:47:55 +00:00
Pawel Jakub Dawidek
c58794debd Add GEOM_ELI class which provides GEOM providers encryption.
For features list and usage see manual page: geli(8).

Sponsored by:	Wheel Sp. z o.o.
		http://www.wheel.pl
MFC after:	1 week
2005-07-27 21:43:37 +00:00
Brooks Davis
4eae015de1 Fix a bug in the handling of cases where we got a short (or zero)
capture.  Zero length captures caused an infinte loop and short captures
probably caused memory corruption and a crash.

Reported by:	many
MFC After:	3 days
2005-07-27 19:25:46 +00:00
Brooks Davis
3c0898098e s/if_defaulroute/if_defaultroute/
We may now handle route updates better.
2005-07-26 18:27:37 +00:00
Sam Leffler
ad60ee418a o add fragthreshold support now that the ioctl exists
o accept rtsthreshold - (or any) as a shorthand for rtsthreshold 2346

MFC after:	3 days
2005-07-26 06:00:33 +00:00
Brooks Davis
a65d8df916 Change host-name from type "X" to type "t". This allows the client to
accept NUL-terminated strings as required by RFC 2132.

This solution is not perfect as it removes the ability to send
NUL-terminated host-name options which may be required by some broken
servers.  Given the current lack of an existance proof of such servers
and the fact that servers that send NUL-terminated domain names do
exist, this seems like an acceptable compromise.  A discussion of these
issues can be found at:

http://marc.theaimsgroup.com/?l=dhcp-client&m=96837107208382&w=2

PR:		bin/83468
Reported by:	Sean Winn <sean at gothic dot net dot au>
MFC-after:	3 days
2005-07-25 22:19:09 +00:00
Sam Leffler
b35f2511fa treat REASSOC events just like ASSOC
MFC after:	3 days
2005-07-25 04:32:40 +00:00
Diomidis Spinellis
153fdc98cf Interpret correctly the glob(3) return value.
Previously, interactive commands specifying a non-existent file or
directory used to display an "out of memory error".

MFC after:	2 weeks
2005-07-21 16:12:35 +00:00
Mark Santcroos
ac0ba90dc8 Bump document date.
Reminded by:	ru
2005-07-20 23:12:54 +00:00
Mark Santcroos
6214c00201 Document -b flag of dhclient.
Reviewed by:	ru
MFC after:	3 days
2005-07-20 22:35:44 +00:00
Yoshihiro Takahashi
543f81fa1a Merged from src/sbin/fdisk.
- Attempt gctl verb "write MBR" when updating.
2005-07-15 15:31:19 +00:00
Poul-Henning Kamp
de78c288db Attempt gctl verb "write MBR" when updating.
This should solve the problem of modifying a busy MBR.
2005-07-15 08:02:51 +00:00
Christian Brueffer
f0ea72a038 - Remove MLINKS to nonexistant manpages
- Change some section numbers to match reality
- For MLINKS to manpages from ports, mention which port installs them

MFC after:	3 days
2005-07-14 20:29:08 +00:00
Robert Watson
b7eb47e290 Add a new flag '-k' to ifconfig(8), indicating that it is alright to
print potentially sensitive keying material to stdout.  With the new
802.11 support, ifconfig(8) is now capable of printing 802.11 keys,
and did by default for the root user, which is undesirable in some
environments.  Now it will not print keying material unless requested
(and available to the user).

MFC after:	1 week
2005-07-14 18:33:21 +00:00
Yaroslav Tykhiy
2eb9396fb7 Add symbolic names for the IFF_PPROMISC and IFF_NEEDSGIANT flags
so that ifconfig(8) can print them.

MFC after:	5 days
2005-07-13 21:23:40 +00:00
Joe Marcus Clarke
e60fa01486 * Open permissions on /var/run/devd.pipe so that any user can read devd events
from this socket
* Enable non-blocking I/O on devd.pipe to keep clients from wedging devd.
  If a write(2) on devd.pipe would block, the client in question will be
  removed [1]

Requested by:	rwatson [1]
Approved by:	imp
2005-07-13 17:28:11 +00:00
Joe Marcus Clarke
8381892977 Replace fch{mod,own} with straight ch{mod,own} as the former cannot be used
on socket file descriptors.

Reviewed by:	secteam (cperciva)
Approved by:	imp
2005-07-13 17:10:47 +00:00
Christian Brueffer
ef95d02dd0 mdoc cleanup and whitespace removal after the last commit.
Submitted by:	ru
2005-07-13 09:35:35 +00:00
Pawel Jakub Dawidek
436b93a0dd Don't forget to initialize 'id' field.
MFC after:	3 days
2005-07-13 07:46:55 +00:00
Christian Brueffer
1a44eb0750 Information about the capability flags in 'ifconfig foo0 scan' output.
Most content by:	avatar
Reviewed by:		sam
Approved by:		re (hrs)
MFC after:		3 days
2005-07-12 06:22:02 +00:00
Pawel Jakub Dawidek
c68cb3f674 Don't compile ggatec/ggated in NO_LIBPTHREAD case.
Reported by:	Andrea Campi <andrea+freebsd_cvs_all@webcom.it>
Approved by:	re (scottl)
2005-07-10 15:16:49 +00:00
Warner Losh
cd70782b39 Add the ability to match the on a media type of the device in question.
Submitted by: sam
Approved by: re (scottl)
2005-07-10 03:37:15 +00:00
Pawel Jakub Dawidek
15e088eeb2 Sync which ggate changes.
Approved by:	re (scottl)
2005-07-08 21:29:17 +00:00
Pawel Jakub Dawidek
7be67fe3d1 Reimplement ggatec/ggated applications.
Change communication protocol to be much more resistant on network
problems and to allow for much better performance.

Better performance is achieved by creating two connections between
ggatec and ggated one for sending the data and one for receiving it.
Every connection is handled by separeted thread, so there is no more
synchronous data flow (send and wait for response), now one threads
sends all requests and another receives the data.

Use two threads in ggatec(8):
- sendtd, which takes I/O requests from the kernel and sends them to the
  ggated daemon on the other end;
- recvtd, which waits for ggated responses and forwards them to the kernel.

Use three threads in ggated(8):
- recvtd, which waits for I/O requests and puts them onto incoming queue;
- disktd, which takes requests from the incoming queue, does disk operations
  and puts finished requests onto outgoing queue;
- sendtd, which takes finished requests from the outgoing queue and sends
  responses back to ggatec.

Because there were major changes in communication protocol, there is no
backward compatibility, from now on, both client and server has to run
on 5.x or 6.x (or at least ggated should be from the same FreeBSD version
on which ggatec is running).

For Gbit networks some buffers need to be increased. I use those settings:
kern.ipc.maxsockbuf=16777216
net.inet.tcp.sendspace=8388608
net.inet.tcp.recvspace=8388608
and I use '-S 4194304 -R 4194304' options for both, ggatec and ggated.

Approved by:	re (scottl)
2005-07-08 21:28:26 +00:00
Sam Leffler
fa56f74570 add pureg/-pureg parameter for controlling pureg ap mode support
Reviewed by:	avatar
Approved by:	re (scottl)
2005-07-06 15:39:11 +00:00
Colin Percival
e5610d524c Bump document date. Remove EOL whitespace introduced in previous
commit.  Start new line at sentence break in previous commit.

Approved by:	re (implicit, fixing a commit made 5 minutes ago)
2005-07-01 10:04:33 +00:00
Colin Percival
4beacf6666 Document some limitations of uid/gid rules.
Approved by:	re (rwatson)
MFC after:	3 days
2005-07-01 09:51:10 +00:00
Brooks Davis
a36c0b6b78 Don't complain when we receive smtp, pop, nntp, www, finger, and irc
server options.

Reported by:	Max Boyarov <max_b at tut dot by>
Approved by:	re (dhclient blanket)
2005-06-30 05:50:52 +00:00
Brooks Davis
b388f1cb10 People like to do RFC violating things with the domain-name option and
include a space seperated list of domains instead of the domain of the
host.  This is supported on too many platforms to break for now so,
remove validation of this option for the moment.

The correct solution longer term is to implement RFC 3397 support and
then treat domain-name options containing space seperated lists of
domains as domain-search options for backwards compatability.

Approved by:	re (dhclient blanket)
2005-06-30 05:32:42 +00:00
Ruslan Ermilov
f9ba39e985 Install the dhcp-options.5 manpage.
Timeout from:	brooks
Approved by:	re (blanket manpages)
2005-06-25 11:03:06 +00:00
Ruslan Ermilov
5c52b5abbc Tidy up the markup.
Approved by:	re (blanket)
2005-06-24 10:57:53 +00:00
Ruslan Ermilov
9a7feaa13c Line up the markup.
Approved by:	re (blanket)
2005-06-22 14:55:59 +00:00
Jean-Sébastien Pédron
b6c9debcf0 Build mount_reiserfs on every platforms, not only i386 and pc98.
Reviewed by:	mux (mentor)
Approved by:	re (dougb)
2005-06-21 13:02:45 +00:00
Doug White
9520784e29 Don't bump bounds every time savecore(8) is run.
Submitted by:	Ed Maste <emaste@sandvine.com>
Approved by:	re
2005-06-20 20:01:29 +00:00
Tai-hwa Liang
ecc1960073 Appending "..." to a SSID which contains unprintable characters only when
necessary.

Submitted by:	sam
Approved by:	re (scottl)
2005-06-20 02:33:02 +00:00
Christian Brueffer
e16a2150d3 Remove Xref to mount_hpfs(8), it's not hooked up to the build.
Approved by:	re (blanket)
MFC after:	3 days
2005-06-16 21:35:33 +00:00
Hajimu UMEMOTO
73bbc449db only show a tunnel information of an adequate address family.
Approved by:	re (dwhite)
2005-06-16 19:37:09 +00:00
Ruslan Ermilov
55c82bf0d4 Markup fixes.
Approved by:	re (blanket)
2005-06-14 11:24:56 +00:00
Brooks Davis
59eac186e2 Avoid a null pointer dereference by not expiring our lease if we don't
have an active one.

Submitted by:	sam
Reported by:	James Snow <snow at teardrop dot org>
Approved by:	re (dhclient blanket)
2005-06-13 23:43:08 +00:00
Christian Brueffer
e7951bdf02 It's spelled 'preceded' of course.
Submitted by:	David Adam <zanchey@ucc.gu.uwa.edu.au>
Pointy hat to:	brueffer
2005-06-13 15:49:59 +00:00
Christian Brueffer
3e3a17bb92 Hex strings are _pre_ceeded by 0x, not _pro_ceeded.
PR:		82187
Submitted by:	Anthony Rogers <anthony.j.rogers@gmail.com>
Approved by:	re (blanket)
MFC after:	3 days
2005-06-13 07:55:15 +00:00
Xin LI
46b7a14ba4 Use MOPT_END in favor of MOPT_NULL, which better describes the purporse
of the macro.
2005-06-10 09:51:43 +00:00
Brooks Davis
d5fedb6e96 Add support for /etc/dhclient-enter-hooks to match /etc/dhclient-exit-hooks. 2005-06-10 03:41:18 +00:00
Brooks Davis
d6790d5a5c Add support for /etc/dhclient-exit-hooks file.
Tested by:	Max Boyarov <max_b at tut dot by>
2005-06-08 18:21:56 +00:00
Brooks Davis
9c13d9cd98 Fix build on 64-bit platforms where time_t is 64 bit. Since where
talking about time related to leases, it should be OK to cast these to
(int)s rather than using intmax_t.

Submitted by:	ru
Pointy hat:	brooks
2005-06-07 14:47:54 +00:00
Max Laier
b730879ffa add_proto() now fills proto for us so stop to 'guess' the protocol from the
command and rather trust the value add_proto filled in.  While here, fix an
oversight in the pretty printing of ip6/4 options.
2005-06-07 14:11:17 +00:00