Commit Graph

11753 Commits

Author SHA1 Message Date
Tony Finch
315c9c163c Update whois(1) synopsis. 2015-05-14 11:33:31 +00:00
Tony Finch
a95cb27ce0 Bump whois(1) date.
(Thanks to bz@ for the reminder!)
2015-05-14 11:25:18 +00:00
Tony Finch
dfef6b156d whois: alphabetize whois server list 2015-05-14 10:33:51 +00:00
Tony Finch
35859f3a2f whois: do not clobber command-line flags when tweaking O_NONBLOCK
This can make whois fail to follow referrals when it should.
The bug was introduced in r281959.
2015-05-14 10:33:33 +00:00
Tony Finch
1326bf51e6 whois: try whois.nic.TLD if TLD.whois-servers.net does not exist
Based on an idea from OpenBSD.
2015-05-14 10:33:01 +00:00
Tony Finch
0279f129c6 whois: check WHOIS_SERVER as well as RA_SERVER environment variables
WHOIS_SERVER is used by Debian's whois client.
2015-05-14 10:32:35 +00:00
Tony Finch
298383b080 whois: code cleanup
Remove deprecated options.

Use pedantically correct types.
2015-05-14 10:32:05 +00:00
Tony Finch
c343f06104 whois: special case certain query suffixes
This extends the existing support for -NORID handles
to include -NICAT, -ARIN, and -RIPE handles.

The suffix machinery is also used to work around a problem with
lack of referrals from the Nominet server for .uk: names under
.ac.uk need to be queried directly at JANET's whois server.
2015-05-14 10:31:37 +00:00
Tony Finch
8b6444e7e4 Clean up whois manual.
Document the RA_SERVER environment variable.

Remove the obsolete -R option, and discourage people from trying
to use the Network Solutions server.

Describe the default behaviour in the DESCRIPTION section,
not buried in the options.
2015-05-14 10:30:37 +00:00
Simon J. Gerraty
28a6bc8146 Merge bmake-20150505 improve detection of malformed conditionals. 2015-05-10 22:03:59 +00:00
Baptiste Daroussin
7bc60a1616 For half and reverse line feeds, recognize both SUSv2-style escape-digit
and BSD-style escape-control-char sequences in the input stream.

Submitted by:	schwarze at OpenBSD
Discussed with:	schwarze at OpenBSD
Obtained from:	OpenBSD
2015-05-10 11:41:38 +00:00
Baptiste Daroussin
f23ed79b08 Fix about ten integer overflows and underflows and a handful of logic
errors in line number handling.

Submitted by:	ingo at OpenBSD
Discussed with:	ingo at OpenBSD
Obtained from:	OpenBSD
2015-05-08 22:11:54 +00:00
Baptiste Daroussin
696e43653b Reduce the size to 64 for the commands, 512 was way too large for the purpose
Noticed by:	julian
2015-05-07 21:30:29 +00:00
Gleb Smirnoff
e42e1fcc64 Printing interface names:
o Restore historical behaviour of appending '*' if interface is down,
  and we have enough space to print it (usually we don't). [1]
o Do not truncate interface names when printing in encoded format.
o Report interface flags into encoded format.

PR:		199873 [1]
Sponsored by:	Nginx, Inc.
2015-05-06 16:43:44 +00:00
Baptiste Daroussin
a2ddd55e00 Enlarge the buffer for storing macros as some macros can be longer than 5 2015-05-05 09:54:47 +00:00
Baptiste Daroussin
209bd1c65e Update the list of known roff commands (adding the mdoc package)
Obtained from:	NetBSD
2015-05-05 09:50:21 +00:00
Baptiste Daroussin
955a5eff37 Properly assign open and close brackets and checks memory
Obtained from:	NetBSD
2015-05-05 09:33:32 +00:00
Baptiste Daroussin
ca887f8d07 Ensure we read existing values of the stk table
Obtained from:	NetBSD
2015-05-05 09:29:32 +00:00
Baptiste Daroussin
0a2963a2ac Use stdup(3) and check its return instead from homebrew version using strcpy(3)
and malloc(3)

Obtained from:	NetBSD
2015-05-05 09:26:32 +00:00
Baptiste Daroussin
8916ff53c3 cosmetic fixes
Obtained from:	NetBSD
2015-05-05 09:24:29 +00:00
Baptiste Daroussin
c99acb7302 Apply seom style(9) fixes from NetBSD
Obtained from:	NetBSD
2015-05-05 09:01:42 +00:00
Baptiste Daroussin
224c825745 Prevent useless use of strdup(3)
Obtained from:	NetBSD
2015-05-05 08:25:25 +00:00
Baptiste Daroussin
1dd178d10d Replace homebrewed NIL by NULL 2015-05-05 08:17:40 +00:00
Baptiste Daroussin
179646cc91 Use stdbool instead of homebrewed boolean 2015-05-05 08:15:10 +00:00
Baptiste Daroussin
64a70bfbde Another function to ansify 2015-05-05 07:52:41 +00:00
Baptiste Daroussin
3487fc5d49 Remove unused variables 2015-05-05 07:51:57 +00:00
Baptiste Daroussin
1e0ae120f5 Explicitly use O_RDONLY instead of 0 2015-05-05 07:49:46 +00:00
Baptiste Daroussin
4fc9d67654 Use strlcpy(3) instead of strcpy(3) 2015-05-05 07:47:36 +00:00
Baptiste Daroussin
bd2faad734 upper the warning level to 3 2015-05-05 07:42:40 +00:00
Baptiste Daroussin
c78092e8d0 Another bit of ansification 2015-05-05 07:42:10 +00:00
Baptiste Daroussin
b16000da4b Ansify to allow to work on it later 2015-05-05 07:33:38 +00:00
Baptiste Daroussin
53b89be196 Remove limitation on input lines by using getline(3) 2015-05-04 22:27:55 +00:00
Baptiste Daroussin
72cc039d1a Extend the list of known nroff/troff commands
Obtained from:	heirloom doctools
2015-05-04 22:18:58 +00:00
Baptiste Daroussin
466dd46f7b Take from heirloom's doctools version of checknr(1) some cosmetic fixes
This helps working on synchronising both tools
2015-05-04 22:05:12 +00:00
Brooks Davis
5743dcb3c2 Remove "capability mode sandbox enabled" messages.
These messages serve little purpose and break some consumers.

PR:		199855
Differential Revision:	https://reviews.freebsd.org/D2440
Reviewed by:	rwatson
Approved by:	pjd
MFC after:	1 week
Sponsored by:	DARPA, AFRL
2015-05-04 21:44:51 +00:00
Baptiste Daroussin
2b30fb2639 Parse filename until first space then print the rest of the line after file
inclusion

This is the same behaviour of heirloom's soelim
2015-05-04 18:20:31 +00:00
Baptiste Daroussin
e5ea68e766 Capsicumize col(1) 2015-05-02 12:22:24 +00:00
Baptiste Daroussin
078fd35f79 Actually push the right tests 2015-05-02 12:19:24 +00:00
Baptiste Daroussin
3bf8ad7de2 Add regression test about reverse line feed to col(1) 2015-05-02 12:08:28 +00:00
Baptiste Daroussin
62e2f1e2f4 Add regression tests for soelim(1) 2015-05-02 11:09:58 +00:00
Baptiste Daroussin
b4a0618c44 Improve compatibility groff's soelim
While here implement -C from GNU groff

Reported by:	delphij
2015-05-01 23:54:09 +00:00
Xin LI
6f32f49c02 Correct - handling.
Reported by:	pkg-fallout
X-MFC-with:	r282318
2015-05-01 22:43:26 +00:00
Baptiste Daroussin
363da13804 Replace groff's soelim by soeliminate(1) renamed soelim(1) 2015-05-01 20:08:25 +00:00
Baptiste Daroussin
32c8097270 Remove bundled reallocarray(3) since it is now in libc 2015-05-01 18:32:54 +00:00
Baptiste Daroussin
a9da03ef30 Use defines to improve clarity
MFC after:	2 weeks
2015-05-01 17:33:32 +00:00
Baptiste Daroussin
f6240da93c col: fixing 25 year old bug
Makes col(1) respect POSIX again for escape sequences as decribed in its manpage
The bug was introduced in CSRG in 1990
This also reverts r280911

Differential Revision:	https://reviews.freebsd.org/D2424
Reviewed by:	jhb
MFC after:	2 weeks
2015-05-01 17:18:07 +00:00
Ed Maste
83990d380a Actually add c++filt's Makefile
Missed in r282285

Pointy hat to:	emaste
2015-04-30 22:51:15 +00:00
Ed Maste
0a06cffc15 Add ELF Tool Chain's c++filt to the build
Differential Revision:	https://reviews.freebsd.org/D2408
Reviewed by:	brooks, imp
Sponsored by:	The FreeBSD Foundation
2015-04-30 21:30:33 +00:00
Edward Tomasz Napierala
82224d7df8 Remove spurious period.
MFC after:	1 month
Sponsored by:	International OCD Foun^W^W^WThe FreeBSD Foundation
2015-04-29 17:01:28 +00:00
Edward Tomasz Napierala
aae2a24b49 Make rctl(8) more user-friendly when RACCT/RCTL is disabled for some reason.
MFC after:	1 month
Sponsored by:	The FreeBSD Foundation
2015-04-29 16:41:49 +00:00
Rene Ladan
483117a646 The Dutch queen abdicated two years ago, the national holiday associated with
her birthday is now associated with the birthday of her son.
2015-04-27 17:04:27 +00:00
Mariusz Zaborski
49ceb674df Add myself (oshogbo) to calendar.freebsd and committers-src.dot.
Approved by:	pjd (mentor)
2015-04-27 16:45:16 +00:00
Jilles Tjoelker
c321006086 hexdump: Don't use uninitialized struct stat. 2015-04-26 21:34:55 +00:00
Maxim Sobolev
da551bb2c2 o Properly init prevtime, so that we don't print bogus value in the
first entry reported by the relative mode (-R).

o Properly print negative offsets, which I guess may happen if
records get re-ordered somehow, possibly due to the locking. Right
now we report huge bogus diff (i.e. 2 seconds or so).
2015-04-25 04:58:08 +00:00
Xin LI
3cddd28ef1 Try alternate addresses more agressively.
Attempt to connect to alternate addresses if the connect doesn't
succeed in 180ms, and cut wait time between connection attempts
in half for each additional, if no connection was established.

Take the first connection to succeed and close the others.

This makes whois more responsive when e.g. IPv6 service took long
time or fail to respond.

PR:		158125
Submitted by:	Mark Andrews <marka isc org> (with changes from me)
MFC after:	2 weeks
2015-04-25 00:51:44 +00:00
Edward Tomasz Napierala
9181358e8a Make nfsstat(1) build with WARNS=6.
Sponsored by:	The FreeBSD Foundation
2015-04-24 07:57:59 +00:00
Edward Tomasz Napierala
722e25522e Remove oldnfs support from nfsstat(1).
Reviewed by:	rmacklem@ (earlier version)
Sponsored by:	The FreeBSD Foundation
2015-04-23 14:36:01 +00:00
John Baldwin
179fa75e6e Reassign copyright statements on several files from Advanced
Computing Technologies LLC to Hudson River Trading LLC.

Approved by:	Hudson River Trading LLC (who owns ACT LLC)
MFC after:	1 week
2015-04-23 14:22:20 +00:00
Simon J. Gerraty
db29cad815 Merge bmake-20150418
PR: 199486
2015-04-21 04:40:38 +00:00
Pedro F. Giffuni
df6e4074c0 patch(1): small include changes.
Mostly to match OpenBSD, no functional change.

Obtained from:	OpenBSD
2015-04-20 22:15:18 +00:00
Eitan Adler
6f9b387301 find.1: Add missing whitespace:
Obtained from:	Dragonfly (dee38d02d51cc8316f82b0263158d2546f2398bc)
2015-04-20 02:23:00 +00:00
Eitan Adler
ba6663d9a1 rpcgen: fix use use of strcmp
strcmp only guarantee that it will return at least 1 if the string B
	is greater than that of string A.
2015-04-19 04:53:28 +00:00
Eitan Adler
e4c6d6e268 calendar: remove useless check
lineline checked for 0 in the while loop condition.  There is no need to
	check for it additionally in the body.

CID:	1288959
MFC After:	1 week
2015-04-19 04:27:50 +00:00
Edward Tomasz Napierala
4e25c86f4c Remove some oldnfs remnants.
Differential Revision:	https://reviews.freebsd.org/D2287
Reviewed by:	rmacklem@
Sponsored by:	The FreeBSD Foundation
2015-04-18 16:08:06 +00:00
Xin LI
dec32474f0 r281540 was upstreamed as NetBSD r1.108 of gzip.c, note it as merged. 2015-04-16 22:30:57 +00:00
Allan Jude
630a02daae Fix libxo output from uptime command
the libxo output for uptime returned multiple 'uptime' keys, one each for number of days, hours, and minutes of uptime.
This is invalid JSON.
This patch makes the output the raw number of seconds, as well as adding keys for the individual unit values
A string of the original output from the plain-text uptime command is also added

Differential Revision:	https://reviews.freebsd.org/D2063
Reviewed by:	jmg
Approved by:	marcel
Sponsored by:	ScaleEngine Inc.
2015-04-16 22:09:37 +00:00
Bryan Drewery
8ded906d2a Fix SIGINFO race causing final results to be lost to stderr.
If a SIGINFO comes in after the file is read then the 'siginfo' flag is set to
1 and the next call to show_cnt() (at exit) would print the data to stderr
rather than the expected stdout.

This was found with spamming Poudriere with SIGINFO which caused a 'wc -l'
execution to return no data rather than an expected number.

MFC after:	2 weeks
2015-04-16 21:44:35 +00:00
Bryan Drewery
90e8186404 Remove extra flags from r250462.
MFC after:	1 week
2015-04-16 02:24:40 +00:00
Tijl Coosemans
1243a98e38 Remove the const qualifier from iconv(3) to comply with POSIX:
http://pubs.opengroup.org/onlinepubs/9699919799/functions/iconv.html

Adjust all code that calls iconv.

PR:		199099
Exp-run by:	antoine
MFC after:	2 weeks
2015-04-15 09:09:20 +00:00
Xin LI
c1c4677aec When reading in the original file name from gzip header, we read
in PATH_MAX + 1 bytes from the file.  In r281500, strrchr() is
used to strip possible path portion of the file name to mitigate
a possible attack.  Unfortunately, strrchr() expects a buffer
that is NUL-terminated, and since we are processing potentially
untrusted data, we can not assert that be always true.

Solve this by reading in one less byte (now PATH_MAX) and
explicitly terminate the buffer after the read size with NUL.

Reported by:	Coverity
CID:		1264915
X-MFC-with:	281500
MFC after:	13 days
2015-04-15 00:07:21 +00:00
Andrew Turner
da713b9ed2 Disable truss, gprof, and lint on arm64, they don't build.
Sponsored by:	The FreeBSD Foundation
2015-04-14 10:15:58 +00:00
Eitan Adler
340bde8178 ipcs: fix builds that use gcc
gcc gets annoyed by duplicate declarations

Reported by:	sbruno
Reviewed by:	sbruno
2015-04-14 04:52:52 +00:00
Eitan Adler
11f4012fa1 ipcs: fix warnings (WARNS=1 -> WARNS=6)
- fix shadow warnings
	- change type from off_t to size_t which is more correct and avoids
	  signed/unsigned compare
	- use new initializer format to avoid "missing values" warning

Reviewed by:	jhb
2015-04-13 19:58:11 +00:00
Xin LI
0eeac58930 Sync with NetBSD:
- Mention xz(1) in gzip(1).
 - Strip away path from header name when decompressing.

MFC after:	2 weeks
2015-04-13 19:46:30 +00:00
Edward Tomasz Napierala
01d54ad206 Add libxo(3) support to iscsictl(8).
PR:		198396
Submitted by:	Marie Helene Kvello-Aune <marieheleneka at gmail.com>
MFC after:	1 month
Sponsored by:	The FreeBSD Foundation
2015-04-12 09:36:50 +00:00
Baptiste Daroussin
c271fa9295 Update nvi to 2.1.3 which fixes the data corruption when locale conversion
failed
2015-04-10 17:50:28 +00:00
Baptiste Daroussin
64026fd83c Remove uneeded link to libkiconv 2015-04-09 21:30:11 +00:00
Baptiste Daroussin
32e5044deb Convert mt(1) and libmt to LIBADD
While here fix missing link to libbsdxml for libmt
Fix overlinking in mt(1)
Make add an indirect libmt dependency on bsdxml to allow static linking if
needed
2015-04-09 21:26:38 +00:00
Baptiste Daroussin
b6f4a0a1c7 Remove uneeded sbuf header 2015-04-09 21:23:27 +00:00
Baptiste Daroussin
d56eff2c31 iscsictl(8) does not actually needs to be linked to libcam nor libutil 2015-04-09 21:14:40 +00:00
Ed Maste
0f9b4b57c1 Avoid escaping EOL for line continuation
Reported by:	kib
2015-04-09 15:08:39 +00:00
Ed Maste
56ad941995 ar: Disallow directory traversal
Set ARCHIVE_EXTRACT_SECURE_SYMLINKS and ARCHIVE_EXTRACT_SECURE_NODOTDOT
as in bsdtar to prevent extraction of archive entries whose pathnames
contain .. or whose target directory would be altered by a symlink.
Also disallow absolute pathnames.

We don't currently provide an option to disable this behaviour (as
bsdtar's -P does). It is unlikely to be a problem in practice for ar(1),
but the -P option is not currently used and available if we want to
consider it for this purpose.

Differential Revision:	https://reviews.freebsd.org/D1524
Reported by:	Alexander Cherepanov <cherepan@mccme.ru>
Approved by:	delphij
Obtained from:	ELF tool chain ar, Ticket #474
MFC after:	1 week
Relnotes:	Yes
Sponsored by:	The FreeBSD Foundation
2015-04-09 13:45:17 +00:00
John Baldwin
dbee5c671a Move the 32-bit compatible procfs types from freebsd32.h to <sys/procfs.h>
and export them to userland.
- Define __HAVE_REG32 on platforms that define a reg32 structure and check
  for this in <sys/procfs.h> to control when to export prstatus32, etc.
- Add prstatus32_t and prpsinfo32_t typedefs for the 32-bit structures.
  libbfd looks for these types, and having them fixes 'gcore' in gdb of a
  32-bit process on a 64-bit platform.
- Use the structure definitions from <sys/procfs.h> in gcore's elf32 core
  dump code instead of duplicating the definitions.

Differential Revision:	https://reviews.freebsd.org/D2142
Reviewed by:	kib, nathanw (powerpc bits)
MFC after:	1 week
2015-04-08 16:30:45 +00:00
Pedro F. Giffuni
a45060f0cc patch: Bring small updates from OpenBSD
Prevent null pointer dereference on empty input files when diff requires
a specific version.

Fix division by zero for files with long lines (> 1024) in Plan B mode
by supporting arbitrarily long lines.

Obtained from:	OpenBSD (CVS Rev 1.41, 1.42)
MFC after:	1 week
2015-04-07 18:06:46 +00:00
Takanori Watanabe
8d6f425ddd Check l2cap socket initialisation and define L2CAP_SOCKET_CHECKED
This will fix build.
2015-04-07 16:48:23 +00:00
Allan Jude
212236608c Fix missing AUTHOR section for jot(1), rs(1), and lam(1)
PR:		196786
Differential Revision:	https://reviews.freebsd.org/D2115
Submitted by:	John A. Kunze (Author)
Approved by:	wblock (mentor)
MFC after:	1 week
Sponsored by:	ScaleEngine Inc.
2015-04-07 15:56:08 +00:00
Michael Tuexen
25044bbcfb The code says "or", not "either or". So fix the documentation.
MFC after: 1 week
2015-04-07 14:33:03 +00:00
Gleb Smirnoff
6fe1796015 Like it was already done for 'netstat -i', drop the kvm(3) support
in 'netstat -r'.

The netstat/route.c was the last abuser of struct ifnet and struct
rtentry in the tree. With this change if_var.h can become kernel
only include, _WANT_RTENTRY can go away and projects/ifnet and
projects/routing can go forward.

Differential Revision:	https://reviews.freebsd.org/D2242
Reviewed by:		melifaro, gnn
Sponsored by:		Nginx, Inc.
Sponsored by:		Netflix
2015-04-07 05:50:45 +00:00
Pedro F. Giffuni
0f4b9a9057 Remove custom getdelim(3) and fix a small memory leak.
Originally from Andre Smagin.

Obtained from:	OpenBSD
MFC after:	1 week
2015-04-07 01:17:49 +00:00
Pedro F. Giffuni
b904ab99bc sort(1): Cleanups and a small memory leak.
Remove useless check for leading blanks in the month name.  The
code didn't adjust len after stripping blanks so even if a month
*did* start with a blank we'd end up copying garbage at the end.
Also convert a malloc + memcpy to strdup and fix a memory leak in
the wide char version if mbstowcs() fails.
Originally from Andre Smagin.

Obtained from:  OpenBSD (CVS rev. 1.2, 1.3)
MFC after:	1 week
2015-04-07 01:17:29 +00:00
Mark Johnston
bef6922b96 lockf(1): add a reference to lockf(3).
Submitted by:	Conrad Meyer
MFC after:	1 week
2015-04-06 22:53:23 +00:00
Gleb Smirnoff
c151f24d08 o Make net.inet6.ip6.mif6table return special API structure, that doesn't
contain kernel pointers, and instead has interface index.
  Bump __FreeBSD_version for that change.
o Now, netstat/mroute6.c no longer needs to kvm_read(3) struct ifnet, and
  no longer needs to include if_var.h

Note that this change is far from being a complete move of IPv6 multicast
routing to a proper API. Other structures are still dumped into their
sysctls as is, requiring userland application to #define _KERNEL when
including ip6_mroute.h and then call kvm_read(3) to gather all bits and
pieces. But fixing this is out of scope of the opaque ifnet project.

Sponsored by:	Nginx, Inc.
Sponsored by:	Netflix
2015-04-06 22:12:18 +00:00
Gleb Smirnoff
56d5e0967c Stop including if_var.h from userland.
Sponsored by:	Nginx, Inc.
2015-04-06 09:42:23 +00:00
Pedro F. Giffuni
45e151e97d sort: style knits / cleanups.
Minor cleanups that got accidentally reverted.

Obtained from:	OpenBSD
2015-04-06 03:02:20 +00:00
Pedro F. Giffuni
e5f71a07e4 Revert (partial) r281123, r281125:
sort: style knits / cleanups.

Our style guide(9) specifies that in absence of local variables
an empty line must be inserted.

Pointed out by:	eadler
2015-04-06 02:35:55 +00:00
Pedro F. Giffuni
db8026c7bb sort: style knits / cleanups.
Obtained from:	OpenBSD
2015-04-05 23:06:42 +00:00
Pedro F. Giffuni
bd0f80c667 sort: Fix a comment.
Obtained from:	OpenBSD
2015-04-05 22:34:03 +00:00
Pedro F. Giffuni
f79477ebd5 sort: Cleanup small issues with spaces.
Obtained from:	OpenBSD
2015-04-05 22:22:43 +00:00
Dimitry Andric
fe2efc8c43 Add the llvm-cov and llvm-profdata tools, when WITH_CLANG_EXTRAS is
defined.  These help with processing coverage and profile data.
2015-04-03 19:43:39 +00:00
Edward Tomasz Napierala
42e70ae82a Add IPv6 example to iscsi.conf(5) and tweak ordering.
MFC after:	1 month
Sponsored by:	The FreeBSD Foundation
2015-04-02 11:52:34 +00:00
Edward Tomasz Napierala
dfc58cbca2 Rewrite iscsi.conf(5) to better match iscsictl(8).
MFC after:	1 month
Sponsored by:	The FreeBSD Foundation
2015-04-02 11:18:43 +00:00
Kevin Lo
18463c7749 Remove bogus cast. 2015-03-31 15:03:58 +00:00
Ed Maste
6744fea6b3 Switch to ELF toolchain readelf(1)
ELF toolchain readelf lacked some functionality at the time other tools
(like size, strip, nm, etc.) were switched over to the ELF toolchain
versions. That has been addressed as of the last update, so we can add
it to the list.

PR:		198950 [exp-run]
Reviewed by:	bapt, imp, rpaulo
Relnotes:	yes
Sponsored by:	The FreeBSD Foundation
Differential Revision:	https://reviews.freebsd.org/D2156
2015-03-30 17:38:25 +00:00
Kristof Provost
09a3b0db35 Clarify the ministat default width
The man page states that:
'-w width    Width of ASCII-art plot in characters, default is 74.'

This is not entirely correct. The mini-help is more accurate:
'-w : width of graph/test output (default 74 or terminal width)'

In other words: the man page fails to explain that ministat will default
to the terminal width, not 74. It will only fall back to 74 if stdout is
not a TTY.

Submitted by:	Ben Hutchings <ben@decadent.org.uk>
Approved by:	philip (mentor)
2015-03-26 17:13:11 +00:00
Kevin Lo
cf7f8a9de8 Print size_t's with %zu rather than "%zd.
Reviewed by:	bde
2015-03-26 09:13:16 +00:00
Jung-uk Kim
01ed3ca3de Remove defunct SSLv2 support from fetch(1) and fetch(3). 2015-03-25 18:56:36 +00:00
Pedro F. Giffuni
c0089353cf xlint: update.
Bring some important updates from NetBSD up to about 2008/04/25.
The main feature is initial support for C99.

This is a very basic update to make it easier to merge new
compiler attirbutes but more updates are likely to follow.

Obtained from:	NetBSD
MFC after:	2 weeks
2015-03-23 18:45:29 +00:00
Warren Block
8c2eccbf4b Describe the behavior when both -f and a message are given. Pointed out by
Raphael Abreu <raphael.lorenzeto@gmail.com> on freebsd-doc.

MFC after:	1 week
2015-03-22 01:25:57 +00:00
Pedro F. Giffuni
2fa7a2afac bsdgrep: fix regression in the -f option since r268799
Caused by an incomplete merge from NetBSD.

PR:		198725
MFC after:	3 days
2015-03-21 00:21:30 +00:00
Kenneth D. Merry
d788649d0c Improve the mt(1) rblim display.
The granularity reported by READ BLOCK LIMITS is an exponent, not a
byte value.  So a granularity of 0 means 2^0, or 1 byte.  A
granularity of 1 means 2^1, or 2 bytes.

Print out the individual block limits on separate lines to improve
readability and avoid exceeding 80 columns.

usr.bin/mt/mt.c:
	Fix and improve the 'mt rblim' output.  Add a MT_PLURAL()
	macro so we can print "byte" or "bytes" as appropriate.

Sponsored by:	Spectra Logic
MFC after:	4 days
2015-03-18 20:54:54 +00:00
Kenneth D. Merry
74a177ac50 Fix a couple of problems in the sa(4) media type reports.
The only drives I have discovered so far that support medium type
reports are newer HP LTO (LTO-5 and LTO-6) drives.  IBM drives
only support the density reports.

sys/cam/scsi/scsi_sa.h:
	The number of possible density codes in the medium type
	report is 9, not 8.  This caused problems parsing all of
	the medium type report after this point in the structure.

usr.bin/mt/mt.c:
	Run the density codes returned in the medium type report
	through denstostring(), just like the primary and secondary
	density codes in the density report.  This will print the
	density code in hex, and give a text description if it
	is available.

Thanks to Rudolf Cejka for doing extensive testing with HP LTO drives
and Bacula and discovering these problems.

Tested by:	Rudolf Cejka <cejkar at fit.vutbr.cz>
Sponsored by:	Spectra Logic
MFC after:	4 days
2015-03-18 20:52:34 +00:00
Andrew Turner
e1f65999b6 Allowus to exclude a.out support from ldd and use it with arm64 as it won't
support the a.out format.

Reviewed by:	emaste
Sponsored by:	The FreeBSD Foundation
2015-03-18 13:59:04 +00:00
Ed Maste
42a8247119 xlint: add arm64 #define
Submitted by:	andrew@
Sponsored by:	The FreeBSD Foundation
2015-03-18 13:07:19 +00:00
Ed Maste
8f75a87acd Add arm64 xlint support.
Obtained from:	NetBSD
Sponsored by:	The FreeBSD Foundation
2015-03-17 19:16:51 +00:00
Baptiste Daroussin
ba44fb709d Remove bad and useless LINKS 2015-03-15 23:31:20 +00:00
Jilles Tjoelker
7a970ca937 unzip: Don't subvert vfs.timestamp_precision when setting atime to now.
Also, preserve nanoseconds from libarchive, even though the zip file format
does not currently support nanoseconds in timestamps.
2015-03-15 21:29:20 +00:00
Dimitry Andric
07f4251006 Regenerated llvm/clang manpages. 2015-03-14 19:22:15 +00:00
Dimitry Andric
e0125cfdd1 Merge ^/head r279893 through r279984. 2015-03-14 13:08:00 +00:00
Warner Losh
5f1c186b14 TARGET_* shouldn't be used here. Use MACHINE_* instead. 2015-03-12 08:32:24 +00:00
Warner Losh
2aa222b153 These local variables are unused. gc them. 2015-03-12 08:32:22 +00:00
Dimitry Andric
a857c4c833 Merge ^/head r279759 through r279892. 2015-03-11 19:04:01 +00:00
Scott Long
a506f1dd7f Fix a typo and update the date in the man page.
Submitted by:	emax
Obtained from:	Netflix, Inc.
MFC after:	3 days
2015-03-11 08:08:54 +00:00
Baptiste Daroussin
7d6e57b6c6 Add OpenBSD copyright for reallocarray
Move the function at the bottom of the misc.c file to clearly state the
copyright only stand for this function

PR:		198484
Submitted by:	logan@elandsys.com
2015-03-10 14:22:28 +00:00
Scott Long
cee9136cc6 Implement basic cpuset reporting in procstat via the -S flag.
Obtained from:	Netflix, Inc.
MFC after:	3 days
2015-03-10 09:41:48 +00:00
Mark Johnston
10b92369a1 Call xo_finish(3) before exiting in usage(). 2015-03-09 03:31:26 +00:00
Jilles Tjoelker
33df3caae6 touch(1): Xref utimensat(2) instead of utimes(2). 2015-03-08 22:49:34 +00:00
Dmitry Morozovsky
b4ed898162 Ouch, I've misread the original text.
Still reword phrase a bit, hopefully in a bit less misleading form than before.

MFC after:	1 week
X-MFC-With:	r279783
Pointy Hat to:	marck
2015-03-08 19:50:30 +00:00
Dmitry Morozovsky
2e7a899b36 Correct wordings a bit.
MFC after:	1 week
2015-03-08 17:34:06 +00:00
Jilles Tjoelker
6ab1d4d9c3 env: Fix crash when -S string is not empty but no operand follows.
split_spaces() set argc in main() incorrectly, which caused trouble for
getopt().

Examples:
  env -S '\c'
  env -S -i

PR:		197769
MFC after:	1 week
2015-03-08 14:12:43 +00:00
Dimitry Andric
6404f697a0 Merging ^/head r279596 through r279758. 2015-03-07 23:01:27 +00:00
Pedro F. Giffuni
20254bfa69 rlogin(1): initialize term variable.
CID:		1011522
Obtained from:	NetBSD (CVS 1.18, partial)
2015-03-05 19:51:37 +00:00
Baptiste Daroussin
8ae63aa054 r* commands are not precious anymore 2015-03-04 22:01:44 +00:00
Baptiste Daroussin
e061f95e7b Rework calendar(1) parser
Support includes surrounded by '"' or '<' '>'
Print warnings about bad syntax
Correctly navigate through include directories to find calendar files
Correctly support multiple includes

Tested by:	gjb
MFC after:	1 week
2015-03-04 20:04:23 +00:00
Dimitry Andric
ca65be80fd Merge ^/head r279313 through r279595. 2015-03-04 19:47:33 +00:00
Marcel Moolenaar
315ca438f3 Fix typo in dropped-packets attribute (missing s).
Pointed-out by: allanjude (excellent catch!)
2015-03-04 02:56:32 +00:00
Kenneth D. Merry
5090c893b7 Add density code for DAT-72, and notes on DAT-160.
As it turns out, the density code for DAT-160 (0x48) is the same
as for SDLT220.  Since the SDLT values are already in the table,
we will leave them in place.

Thanks to Harald Schmalzbauer for confirming the DAT-72 density code.

lib/libmt/mtlib.c:
	Add DAT-72 density code, and commented out DAT-160 density
	code.  Explain why DAT-160 is commented out.  Add notes
	explaining where the bpi values for these formats came from.

usr.bin/mt/mt.1:
	Add DAT-72 density code, and add a note explaining that
	the SDLTTapeI(110) density code (0x48) is the same as
	DAT-160.

Sponsored by:	Spectra Logic
MFC after:	3 weeks
2015-03-03 22:49:07 +00:00
Baptiste Daroussin
849684b013 Update mandoc to cvs snaphot from 20150302
Use the new unsupp warning level to detect the unsupported manpages in man(1)
2015-03-02 16:58:57 +00:00
Jilles Tjoelker
22ea47ec90 sh: Fix compiler warnings related to duplicate or missing declarations. 2015-03-01 21:46:55 +00:00
Dimitry Andric
0d56a8cba1 Merge ^/head r279163 through r279308. 2015-02-26 07:26:56 +00:00
Hans Petter Selasky
39b86a6a6f Update to upstream version 2.10
The most notable new feature is support for definition files.

Obtained from:	http://dotat.at/prog/unifdef
MFC after:	1 week
2015-02-25 21:10:03 +00:00
Xin LI
3b557094a2 Explicitly crypt_set_format("des") and bail out if we
can't.  This would prevent problem when we changed the
default crypt(3) algorithm or removed it in the future.

PR:		bin/189958
MFC after:	1 month
2015-02-25 20:47:25 +00:00
Marcel Moolenaar
65f2833127 Fix "netstat -hdw 1" output.
Reported by: np@
2015-02-25 17:06:27 +00:00
Kenneth D. Merry
7b7c7a0533 Fix several problems found by Coverity.
lib/libmt/mtlib.c:
	In mt_start_element(), make sure we don't overflow the
	cur_sb array.  CID 1271325

usr.bin/mt/mt.c:
	In main(), bzero the mt_com structure so that we aren't
	using any uninitialized stack variables.  CID 1271319

	In mt_param(), only allow one -s and one -p argument.  This
	will prevent a memory leak caused by overwriting the
	param_name and/or param_value variables.  CID 1271320 and
	CID 1271322

	To make things simpler in mt_param(), make sure there
	there is only one exit path for the function.  Make sure
	the arguments are explicitly freed.

Sponsored by:	Spectra Logic
Pointed out by:	emaste
MFC after:	1 month
2015-02-25 04:30:23 +00:00
Kenneth D. Merry
43518607b2 Significant upgrades to sa(4) and mt(1).
The primary focus of these changes is to modernize FreeBSD's
tape infrastructure so that we can take advantage of some of the
features of modern tape drives and allow support for LTFS.

Significant changes and new features include:

 o sa(4) driver status and parameter information is now exported via an
   XML structure.  This will allow for changes and improvements later
   on that will not break userland applications.  The old MTIOCGET
   status ioctl remains, so applications using the existing interface
   will not break.

 o 'mt status' now reports drive-reported tape position information
   as well as the previously available calculated tape position
   information.  These numbers will be different at times, because
   the drive-reported block numbers are relative to BOP (Beginning
   of Partition), but the block numbers calculated previously via
   sa(4) (and still provided) are relative to the last filemark.
   Both numbers are now provided.  'mt status' now also shows the
   drive INQUIRY information, serial number and any position flags
   (BOP, EOT, etc.) provided with the tape position information.
   'mt status -v' adds information on the maximum possible I/O size,
   and the underlying values used to calculate it.

 o The extra sa(4) /dev entries (/dev/saN.[0-3]) have been removed.

   The extra devices were originally added as place holders for
   density-specific device nodes.  Some OSes (NetBSD, NetApp's OnTap
   and Solaris) have had device nodes that, when you write to them,
   will automatically select a given density for particular tape drives.

   This is a convenient way of switching densities, but it was never
   implemented in FreeBSD.  Only the device nodes were there, and that
   sometimes confused users.

   For modern tape devices, the density is generally not selectable
   (e.g. with LTO) or defaults to the highest availble density when
   the tape is rewritten from BOT (e.g. TS11X0).  So, for most users,
   density selection won't be necessary.  If they do need to select
   the density, it is easy enough to use 'mt density' to change it.

 o Protection information is now supported.  This is either a
   Reed-Solomon CRC or CRC32 that is included at the end of each block
   read and written.  On write, the tape drive verifies the CRC, and
   on read, the tape drive provides a CRC for the userland application
   to verify.

 o New, extensible tape driver parameter get/set interface.

 o Density reporting information.  For drives that support it,
   'mt getdensity' will show detailed information on what formats the
   tape drive supports, and what formats the tape drive supports.

 o Some mt(1) functionality moved into a new mt(3) library so that
   external applications can reuse the code.

 o The new mt(3) library includes helper routines to aid in parsing
   the XML output of the sa(4) driver, and build a tree of driver
   metadata.

 o Support for the MTLOAD (load a tape in the drive) and MTWEOFI
   (write filemark immediate) ioctls needed by IBM's LTFS
   implementation.

 o Improve device departure behavior for the sa(4) driver.  The previous
   implementation led to hangs when the device was open.

 o This has been tested on the following types of drives:
	IBM TS1150
	IBM TS1140
	IBM LTO-6
	IBM LTO-5
	HP LTO-2
	Seagate DDS-4
	Quantum DLT-4000
	Exabyte 8505
	Sony DDS-2

contrib/groff/tmac/doc-syms,
share/mk/bsd.libnames.mk,
lib/Makefile,
	Add libmt.

lib/libmt/Makefile,
lib/libmt/mt.3,
lib/libmt/mtlib.c,
lib/libmt/mtlib.h,
	New mt(3) library that contains functions moved from mt(1) and
	new functions needed to interact with the updated sa(4) driver.

	This includes XML parser helper functions that application writers
	can use when writing code to query tape parameters.

rescue/rescue/Makefile:
	Add -lmt to CRUNCH_LIBS.

src/share/man/man4/mtio.4
	Clarify this man page a bit, and since it contains what is
	essentially the mtio.h header file, add new ioctls and structure
	definitions from mtio.h.

src/share/man/man4/sa.4
	Update BUGS and maintainer section.

sys/cam/scsi/scsi_all.c,
sys/cam/scsi/scsi_all.h:
	Add SCSI SECURITY PROTOCOL IN/OUT CDB definitions and CDB building
	functions.

sys/cam/scsi/scsi_sa.c
sys/cam/scsi/scsi_sa.h
	Many tape driver changes, largely outlined above.

	Increase the sa(4) driver read/write timeout from 4 to 32
	minutes.  This is based on the recommended values for IBM LTO
	5/6 drives.  This may also avoid timeouts for other tape
	hardware that can take a long time to do retries and error
	recovery.  Longer term, a better way to handle this is to ask
	the drive for recommended timeout values using the REPORT
	SUPPORTED OPCODES command.  Modern IBM and Oracle tape drives
	at least support that command, and it would allow for more
	accurate timeout values.

	Add XML status generation.  This is done with a series of
	macros to eliminate as much duplicate code as possible.  The
	new XML-based status values are reported through the new
	MTIOCEXTGET ioctl.

	Add XML driver parameter reporting, using the new MTIOCPARAMGET
	ioctl.

	Add a new driver parameter setting interface, using the new
	MTIOCPARAMSET and MTIOCSETLIST ioctls.

	Add a new MTIOCRBLIM ioctl to get block limits information.

	Add CCB/CDB building routines scsi_locate_16, scsi_locate_10,
	and scsi_read_position_10().

	scsi_locate_10 implements the LOCATE command, as does the
	existing scsi_set_position() command.  It just supports
	additional arguments and features.  If/when we figure out a
	good way to provide backward compatibility for older
	applications using the old function API, we can just revamp
	scsi_set_position().  The same goes for
	scsi_read_position_10() and the existing scsi_read_position()
	function.

	Revamp sasetpos() to take the new mtlocate structure as an
	argument.  It now will use either scsi_locate_10() or
	scsi_locate_16(), depending upon the arguments the user
	supplies.  As before, once we change position we don't have a
	clear idea of what the current logical position of the tape
	drive is.

	For tape drives that support long form position data, we
	read the current position and store that for later reporting
	after changing the position.  This should help applications
	like Bacula speed tape access under FreeBSD once they are
	modified to support the new ioctls.

	Add a new quirk, SA_QUIRK_NO_LONG_POS, that is set for all
	drives that report SCSI-2 or older, as well as drives that
	report an Illegal Request type error for READ POSITION with
	the long format.  So we should automatically detect drives
	that don't support the long form and stop asking for it after
	an initial try.

	Add a partition number to the sa(4) softc.

	Improve device departure handling. The previous implementation
	led to hangs when the device was open.

	If an application had the sa(4) driver open, and attempted to
	close it after it went away, the cam_periph_release() call in
	saclose() would cause the periph to get destroyed because that
	was the last reference to it.  Because destroy_dev() was
	called from the sa(4) driver's cleanup routine (sacleanup()),
	and would block waiting for the close to happen, a deadlock
	would result.

	So instead of calling destroy_dev() from the cleanup routine,
	call destroy_dev_sched_cb() from saoninvalidate() and wait for
	the callback.

	Acquire a reference for devfs in saregister(), and release it
	in the new sadevgonecb() routine when all devfs devices for
	the particular sa(4) driver instance are gone.

	Add a new function, sasetupdev(), to centralize setting
	per-instance devfs device parameters instead of repeating the
	code in saregister().

	Add an open count to the softc, so we know how many
	peripheral driver references are a result of open
       	sessions.

	Add the D_TRACKCLOSE flag to the cdevsw flags so
	that we get a 1:1 mapping of open to close calls
	instead of a N:1 mapping.

	This should be a no-op for everything except the
	control device, since we don't allow more than one
	open on non-control devices.

	However, since we do allow multiple opens on the
	control device, the combination of the open count
	and the D_TRACKCLOSE flag should result in an
	accurate peripheral driver reference count, and an
	accurate open count.

	The accurate open count allows us to release all
	peripheral driver references that are the result
	of open contexts once we get the callback from devfs.

sys/sys/mtio.h:
	Add a number of new mt(4) ioctls and the requisite data
	structures.  None of the existing interfaces been removed
	or changed.

	This includes definitions for the following new ioctls:

	MTIOCRBLIM      /* get block limits */
	MTIOCEXTLOCATE	/* seek to position */
	MTIOCEXTGET     /* get tape status */
	MTIOCPARAMGET	/* get tape params */
	MTIOCPARAMSET	/* set tape params */
	MTIOCSETLIST	/* set N params */

usr.bin/mt/Makefile:
	mt(1) now depends on libmt, libsbuf and libbsdxml.

usr.bin/mt/mt.1:
	Document new mt(1) features and subcommands.

usr.bin/mt/mt.c:
	Implement support for mt(1) subcommands that need to
	use getopt(3) for their arguments.

	Implement a new 'mt status' command to replace the old
	'mt status' command.  The old status command has been
	renamed 'ostatus'.

	The new status function uses the MTIOCEXTGET ioctl, and
	therefore parses the XML data to determine drive status.
	The -x argument to 'mt status' allows the user to dump out
	the raw XML reported by the kernel.

	The new status display is mostly the same as the old status
	display, except that it doesn't print the redundant density
	mode information, and it does print the current partition
	number and position flags.

	Add a new command, 'mt locate', that will supersede the
	old 'mt setspos' and 'mt sethpos' commands.  'mt locate'
	implements all of the functionality of the MTIOCEXTLOCATE
	ioctl, and allows the user to change the logical position
	of the tape drive in a number of ways.  (Partition,
	block number, file number, set mark number, end of data.)
	The immediate bit and the explicit address bits are
	implemented, but not documented in the man page.

	Add a new 'mt weofi' command to use the new MTWEOFI ioctl.
	This allows the user to ask the drive to write a filemark
	without waiting around for the operation to complete.

	Add a new 'mt getdensity' command that gets the XML-based
	tape drive density report from the sa(4) driver and displays
	it.  This uses the SCSI REPORT DENSITY SUPPORT command
	to get comprehensive information from the tape drive about
	what formats it is able to read and write.

	Add a new 'mt protect' command that allows getting and setting
	tape drive protection information.  The protection information
	is a CRC tacked on to the end of every read/write from and to
	the tape drive.

Sponsored by:	Spectra Logic
MFC after:	1 month
2015-02-23 21:59:30 +00:00
Dimitry Andric
9b2a0d91b8 Merge ^/head r279023 through r279162. 2015-02-22 16:04:37 +00:00
Marcel Moolenaar
e6679c1a71 Add the -c option for specifying the capacity of the disk image. When
a capcity is given, no partitions are required. When no partitions are
given, no scheme needs to be specified either. This makes it possible
to create an entirely empty disk image. To add an empty partitioning
table, specify the scheme.

Bump the version to 20150222.
2015-02-22 04:50:47 +00:00
Marcel Moolenaar
aba885c960 Don't require a scheme if no partitions are given. Change the code
to handle that case. Note that we still require partitions, so the
change is effectively a no-op.
2015-02-22 01:20:49 +00:00
Marcel Moolenaar
b5380f2a09 In scheme_write(), don't overwrite the end parameter with the
return value of image_get_size(). As it so happens, the only
caller of scheme_write() passes exactly that.
2015-02-22 01:01:02 +00:00
Marcel Moolenaar
29eac8d790 Remove extraneous parenthesis in assignment. 2015-02-22 00:58:10 +00:00
Marcel Moolenaar
6504b42f68 Document that netstat(1) supports libxo(3). 2015-02-22 00:01:42 +00:00