16693 Commits

Author SHA1 Message Date
dteske
81a43c15a2 Use awk the following (more succinct) awk syntax:
condition1 { action1 }
	condition2 { action2 }

instead of the following syntax:

	{
		if (condition1) { action1 }
		else if (condition2) { action2 }
	}
2016-12-12 21:16:37 +00:00
dteske
a2137139d3 1 is the default descriptor for redirects without an fd prefix 2016-12-12 21:11:55 +00:00
dteske
9474c4bc00 Fix invalid parameter expansion (change $@ to "$@")
Without quotes, $@ loses its special meanining (see below)

% sh -c 'echo $@' /bin/sh "   1   " "   2   "
1 2
% sh -c 'echo "$@"' /bin/sh "   1   " "   2   "
   1       2

The quotes are required to get ARGV to be unperterped
2016-12-12 21:04:11 +00:00
dteske
d5fa50b840 Allow the script path to contain whitespace and special characters 2016-12-12 21:01:20 +00:00
dteske
132073e3d3 Use provided API to centralize dialog title strings 2016-12-12 21:00:09 +00:00
dteske
aec8b5b0d1 Reorder dialog parameters based on commonality for readability 2016-12-12 20:54:20 +00:00
dteske
4cbb470510 Fix incorrect use of provided API
The result of which was incorrectly sized menu dialogs
2016-12-12 20:49:49 +00:00
dteske
73a6483723 Use provided API (change "dialog" to "$DIALOG") 2016-12-12 20:43:09 +00:00
dteske
f36072e86a Whitespace (dialog options separated to minimize diffs) 2016-12-12 20:41:27 +00:00
dteske
7a906cbddf Consolidate redirects into here documents, with proper code indentation 2016-12-12 19:46:49 +00:00
hrs
fc29dcf63c - Refactor listening socket list. All of the listening sockets are
now maintained in a single linked-list in a transport-independent manner.
- Use queue.h for linked-list structure.
- Use linked-list for AllowedPeers.
- Use getaddrinfo(8) even for Unix Domain sockets.
- Use macros to type-casting from/to struct sockaddr{,_in,_in6}.
- Define fu_* macro for union f_un to shorten the member names.
- Remove an extra #include <sys/type.h>.
- Add "static" to non-exported symbols.
- !INET support is still incomplete but will be fixed later.

There is no functional change except for some minor debug messages.
2016-12-12 19:33:40 +00:00
dteske
8deaf769ad Remove an unnecessary "return $?" at end of function 2016-12-12 19:26:55 +00:00
hrs
a92b987411 Temporarily backout the previous commit because it was totally broken due to
unresolved merge conflicts.

Pointy hat to:	hrs
2016-12-12 19:24:52 +00:00
dteske
66586c3cda Use ternary operator 2016-12-12 19:24:32 +00:00
dteske
0d3fb22f07 If you're not going to make use of the products of a match() in awk
(e.g., RSTART and RLENGTH variables) then use ~ instead of match()
2016-12-12 19:12:31 +00:00
dteske
5b403b7aab Now that these variables do not contain the --default-item flag itself,
change the name of the variable from $def_item_... to $default_...
2016-12-12 19:10:39 +00:00
hrs
72a9e76712 - Refactor listening socket list. All of the listening sockets are
now maintained in a single linked-list in a transport-independent manner.
- Use queue.h for linked-list structure.
- Use linked-list for AllowedPeers.
- Use getaddrinfo(8) even for Unix Domain sockets.
- Use macros to type-casting from/to struct sockaddr{,_in,_in6}.
- Define fu_* macro for union f_un to shorten the member names.
- Remove an extra #include <sys/type.h>.
- Add "static" to non-exported symbols.
- !INET support is still incomplete but will be fixed later.

There is no functional change except for some minor debug messages.
2016-12-12 19:10:14 +00:00
dteske
7186d17fc0 Always pass --default-item parameter to dialog 2016-12-12 19:09:17 +00:00
dteske
6ac73bdcd8 There is zero harm in always passing --default-item to dialog 2016-12-12 19:07:42 +00:00
dteske
6895a533a9 Centralize backtitle string 2016-12-12 19:01:04 +00:00
dteske
85088f1091 Use provided API instead of hard-coded status integers 2016-12-12 18:55:41 +00:00
dteske
65dd648795 Whitespace 2016-12-12 18:52:22 +00:00
dteske
eb2a4fb667 Remove unnecessary `-n' parameter to head/tail 2016-12-12 18:48:00 +00:00
dteske
c523ed6ee1 awk(1) match() takes a regex, use /.../ to remind ourselves of this
NB: The difference between "..." and /.../ for a regex in awk is that
quoted strings go through escape expansion first (e.g., \\ becomes \)
2016-12-12 18:45:52 +00:00
dteske
827f6676dc Be internally consistent (": > ..." is used elsewhere in this file) 2016-12-12 18:43:42 +00:00
dteske
a86c55d3d1 "echo | sed | sed | awk" is silly (changed to "echo | awk") 2016-12-12 18:42:55 +00:00
dteske
74e48b359f Add missing `-e' parameter to sed invocations 2016-12-12 18:39:26 +00:00
dteske
2abc445326 Allow $BSDINSTALL_TMPETC to contain whitespace or special chars 2016-12-12 18:38:18 +00:00
dteske
544da66b52 Group fallbacks together 2016-12-12 18:34:21 +00:00
dteske
fa756bc185 Remove unnecessary quotes around number in test 2016-12-12 18:33:40 +00:00
dteske
53f48a2373 Change "[ ! ... ] && ..." to "[ ... ] || ..." 2016-12-12 18:29:24 +00:00
dteske
5d63bb6317 Collapse tiny if statements 2016-12-12 18:28:20 +00:00
dteske
a848623c29 Replace funny block with something easy to digest 2016-12-12 18:24:41 +00:00
dteske
1390aaa722 Consolidate locals 2016-12-12 18:21:56 +00:00
dteske
0d737976f5 Remove unnecessary local initializers 2016-12-12 18:20:56 +00:00
dteske
ced2b90567 Change "[ ! -z ... ]" => "[ ... ]" and "[ -z ... ]" => "[ ! ... ]" 2016-12-12 18:17:30 +00:00
dteske
eaa4d342d8 Use $( ... ) instead of ... 2016-12-12 18:10:33 +00:00
dteske
889cd4165d Comments 2016-12-12 18:05:54 +00:00
bapt
1fd84d9b40 Fix pkg groupshow <gid>
PR:		204676
Submitted by:	longwitz@incore.de
MFC after:	2 days
2016-12-10 12:48:48 +00:00
rmacklem
fea344561b Patch the nfsd so that it doesn't register with rpcbind for an NFSv4 only
server.

This patch uses the sysctl vfs.nfsd.server_min_nfsvers to determine
if/what versions of NFS service should be registered with rpcbind.
For NFSv4 only, it does not register at all, since NFSv4 always uses 2049
and does not require rpcbind.
For NFSv3 minimum, it registers NFSv3 but not NFSv2.

Tested by:	jmader2@gmu.edu
Submitted by:	jmader2@gmu.edu (earlier version)
MFC after:	2 weeks
Differential Revision:	https://reviews.freebsd.org/D8696
2016-12-08 23:29:56 +00:00
dteske
8a7a41fe62 Functions in their own section 2016-12-08 19:28:12 +00:00
dteske
4efe9f28d0 Remove unnecessary trailing backslashes 2016-12-08 19:26:22 +00:00
dteske
66cde2d5d3 Add support for "hidden" Wi-Fi networks
PR:		bin/214933
Submitted by:	Maxim Filimonov <che@bein.link>
Reviewed by:	dteske, allanjude, adrian
MFC after:	6 days
X-MFC-with:	Follow-up commit for style
2016-12-08 16:41:18 +00:00
n_hibma
48de74606e More typos in strings.
Submitted by:	bde
MFC after:	3 days
2016-12-02 11:30:21 +00:00
araujo
dcae55d955 Use memset(3) instead of bzero(3).
Obtained from:	OpenBSD (r1.12, r1.20, r1.18 and r1.37)
2016-12-02 06:07:27 +00:00
araujo
359d465f28 String terminators are called NUL, not NULL, also the variable
mentioned in the comment is p and not u.

Obtained from:	OpenBSD (r1.34)
2016-12-02 05:49:22 +00:00
n_hibma
1a31db3cf4 Speling fixes and fix line endings for err_msg output.
In some cases there was not \n, in other cases there was.
2016-12-01 09:14:58 +00:00
avg
4596354565 bhyve: stability and performance improvement for dbgport
The TCP server implementation in dbgport does not track clients, so it
may try to write to a disconected socket resulting in SIGPIPE.
Avoid that by setting SO_NOSIGPIPE socket option.

Because dbgport emulates an I/O port to guest, the communication is done
byte by byte.  Reduce latency of the TCP/IP transfers by using
TCP_NODELAY option.  In my tests that change improves performance of
kgdb commands with lots of output (e.g. info threads) by two orders of
magnitude.

A general note.  Since we have a uart emulation in bhyve, that can be
used for the console and gdb access to guests.  So, bvmconsole and bvmdebug
could be de-orbited now.  But there are many existing deployments that
still dependend on those.

Discussed with:	julian, jhb
MFC after:	2 weeks
Sponsored by:	Panzura
2016-11-29 13:11:00 +00:00
delphij
fbc8d8de2c Plug another leak with malformed IPv6 address.
MFC after:	2 weeks
2016-11-28 07:41:01 +00:00
delphij
2059af8c9f Don't leak 'str' when we see a malformed IPv6 address.
MFC after:	2 weeks
2016-11-28 07:33:26 +00:00