Commit Graph

14420 Commits

Author SHA1 Message Date
Hiroki Sato
bba75509c1 Add a missing white space. 2013-07-09 07:03:54 +00:00
Rick Macklem
9ed4e72ac9 Fix some Kerberos related terminology.
This is a content change.

Requested by:	bjk
2013-07-08 01:47:50 +00:00
Rick Macklem
992e659005 Oops, initialize the krb5 ret values correctly (to anything non-zero). 2013-07-08 01:29:09 +00:00
Rick Macklem
74929c2edf Make sure the krb5 status variables are correctly initialized. 2013-07-08 01:08:57 +00:00
Rick Macklem
b91cd7da8c Document the new "-h" option for the gssd daemon.
This is a content change.

Reviewed by:	jhb
2013-07-08 00:57:12 +00:00
Rick Macklem
bd5012b2df Add a new "-h" option to the gssd daemon that enables support for
host based (kerberos service principal) initiator credentials in
the default keytab file. This option won't actually be useful until
the corresponding kernel changes are committed.

Reviewed by:	jhb
2013-07-08 00:50:57 +00:00
Devin Teske
8e37a7c8b9 Fix typos in the BSD License. 2013-07-07 18:51:44 +00:00
Devin Teske
dfe61b44b0 Be consistent with other usr.sbin programs w/respect to the copyright
wording ("All rights reserved."); I had the casing wrong on many instances.
2013-07-07 18:34:36 +00:00
Devin Teske
f8ea072a54 Be consistent with other usr.sbin programs w/respect to the copyright
wording ("All rights reserved."); I had the casing wrong on many instances.
2013-07-07 18:21:30 +00:00
Devin Teske
94bc33c150 Take the training-wheels off, after nearly 30 months of development. MFC to
stable/9 planned after MFC 3-day period. The MFC to stable/9 is desired for
the next release to get some much-needed time:
+ Living side-by-side with sysinstall for compare/contrast/transition
+ Living side-by-side with bsdinstall for integration/transition
+ Additional feedback/testing before eventual 10.0-R to make it even better

MFC after:	3 days
2013-07-06 04:13:47 +00:00
Devin Teske
39c229261f Don't prevent the user from hanging their system by changing network
settings while NFS mounts are active; but DO warn them and make the
default action to do nothing. (thanks julian)
2013-07-05 23:16:56 +00:00
Devin Teske
636621d9d9 Check for INDEX file first before anything else when processing modules. 2013-07-05 22:25:40 +00:00
Devin Teske
4b97e14f62 Check menuitem before calculating tag. 2013-07-05 22:24:43 +00:00
Devin Teske
52d41f916e Add the necessary code to reinstall packages. Both scripted access
(packageReinstall) and UI access have been tested successfully with a
variation of different situations including:
+ Reinstall a package for which no other packages depend
+ Purposefully do thinks like reinstall a package that is not installed
+ Try to reinstall a package which other installed packages still depend

NOTE: There is no "force" used; if a package is required by other packages,
it will not be uninstalled (and therefore no reinstall is done).
2013-07-05 21:40:31 +00:00
Devin Teske
4254e87dbc Remove superfluous continue at end of loop. (pointy-hat) 2013-07-05 21:32:54 +00:00
Devin Teske
1da51566d5 Add support for processing add-on modules from /usr/local/libexec/bsdconfig
(this is designed to allow new modules to be installed via ports/packages).

To prevent conflict with itself (sysutils/bsdconfig) as a port (which
installs its base modules to the above directory, it was long-ago decided
that so-called `base' modules would look different than now-defined `add-on'
modules. The structure of the contents for each is the same, but the naming
convention for the module directory must be different.

Base modules are named `[0-9][0-9][0-9].*' to allow SysV-style organization
while add-on modules must avoid this naming style and are simply listed in
alphabetical order by their module directory.

For example, a hypothetical port named `bsdconfig-jails' could install
/usr/local/libexec/bsdconfig/jails and provide `bsdconfig jails' as well as
a new menu entry in the main-menu.

Add-on modules are listed in the main-menu (when bsdconfig is executed with-
out arguments) below a separator after the last base-module.

In `bsdconfig -h' output, add-on modules are listed right alongside base
modules (sorted alphabetically in columnar fashion; left-to-right).

If a base module declares a keyword used by an add-on module, the base
module will always win when given `bsdconfig keyword' syntax.

Add-on modules should avoid declaring any keyword found in `script.subr' as
a reserved-word (`Resword') since bsdconfig also supports `bsdconfig resword'
as a fall-back if no keyword is found to be declared by any module.
2013-07-05 20:13:00 +00:00
Devin Teske
c6470c75f5 Oops, r252833 was not supposed to touch this file. Back-out and recommit
this file with the rest of the files it was supposed to go with.
2013-07-05 20:01:07 +00:00
Devin Teske
e363bf2b1d Don't calculate the tag until we know that we're going to make a new menu
item entry. Also join simple NULL assignments into a single line.
2013-07-05 19:57:40 +00:00
Robert Millan
fe24bdd45e Remove ancient code for FreeBSD 2.x compatibility.
Reviewed by: brian, freebsd-net
2013-07-05 19:26:01 +00:00
Devin Teske
52c2fbe8a9 Oops, r252810 forgot to hook the new example file (browse_packages.sh) into
the Makefile.
2013-07-05 18:50:17 +00:00
Devin Teske
fc20233076 Adhere to 80-column width. 2013-07-05 18:31:26 +00:00
Devin Teske
e153f92628 Document remaining undocumented modules (and remove my silly place-holder
thing at the top, which I was using as a way to make sure I didn't forget
to document any modules).
2013-07-05 18:30:43 +00:00
Devin Teske
f9b9df7f0e Make a correction to the description of invocation with-versus-without
arguments, making things a bit more clear [hopefully].
2013-07-05 18:29:09 +00:00
Devin Teske
37b6146ea3 Document new -d' and -D file' debugging options. 2013-07-05 18:03:00 +00:00
Devin Teske
2a5bf6db9a Change default FTP server (s/ftp-archive/ftp/). 2013-07-05 17:56:15 +00:00
Devin Teske
f0157ce528 Add example shell script for creating a local INDEX file that can be
accessed quickly for browsing a list of available packages.
2013-07-05 17:54:08 +00:00
Devin Teske
b7df1596cf Update HISTORY. 2013-07-05 17:45:54 +00:00
Devin Teske
2902415180 Rest in peace Ron (Ron McDowell Jul.12, 1955 - Aug.26, 2012).
I'll carry-on from here. Thank you so much for your hard work.
2013-07-05 17:44:53 +00:00
Devin Teske
071e3e3997 Update e-mails. 2013-07-05 17:38:54 +00:00
Devin Teske
8c1a61f605 Since r251908, bsdconfig(8) has no direct ties to sade(8) (instead uses
`bsdinstall partedit'). Update references (s/sade/bsdinstall/) and change
the BUGS section to be based on reality.
2013-07-05 17:35:13 +00:00
Devin Teske
318645e0d2 Don't refer to a port manual. 2013-07-05 17:31:05 +00:00
Devin Teske
01dc132c3a mdoc: begin sentences on a new line. 2013-07-05 17:27:55 +00:00
Devin Teske
b07efdb566 Update date on the back of r252802. 2013-07-05 17:23:00 +00:00
Devin Teske
39346a432d Fix a typo. 2013-07-05 17:22:10 +00:00
Devin Teske
a504f1acf5 Whitespace. 2013-07-05 17:21:40 +00:00
Devin Teske
385f563535 Update release info. 2013-07-05 16:49:06 +00:00
Devin Teske
18b13239a2 Update copyright/date on the back of r252798. 2013-07-05 16:47:30 +00:00
Devin Teske
b2c577b5de Update sysrc(8) manual to coincide with r252797:
Do not inherit $SYSRC_VERBOSE from operating environment. The concern is
that when a user (such as myself) which has SYSRC_VERBOSE=1 in his/her
~/.bash_profile or such that when they are told to execute a command like:

	hostname `sysrc -n hostname`

NOTE: To activate a recently configured hostname.

If $SYSRC_VERBOSE is set, then POLA is violated because the output of sysrc
is indirectly influenced (making for an inconsistent experience).
2013-07-05 16:45:25 +00:00
Devin Teske
09ee63bc6a Do not inherit $SYSRC_VERBOSE from operating environment. The concern is
that when a user (such as myself) which has SYSRC_VERBOSE=1 in his/her
~/.bash_profile or such that when they are told to execute a command like:

	hostname `sysrc -n hostname`

NOTE: To activate a recently configured hostname.

If $SYSRC_VERBOSE is set, then POLA is violated because the output of sysrc
is indirectly influenced (making for an inconsistent experience).
2013-07-05 16:21:44 +00:00
Devin Teske
7079fc4e02 Use f_show_msg() instead of f_dialog_msgbox() where appropriate. The main
difference between these two functions:

	Usage: f_show_msg() $format_string [ $format_args ... ]
	Usage: f_dialog_msgbox() $text [ $hline ]

The former lends itself well to displaying the $msg_* i18n text, prompts,
etc. While the latter is better for text you do not control (error strings
captured as a response from external commands) -- or if you have to control
the hline.
2013-07-05 16:00:01 +00:00
Devin Teske
542dd84bad Add the necessary code to uninstall packages (re-install still pending).
Both scripted access (packageDelete) and UI access have been tested
successfully with a variation of different situations including:
+ Uninstall a package which no other installed package depends
+ Uninstall multiple packages which no other installed packages depend
+ Uninstall multiple packages which depend on each other
+ Similar to above but when ordered removal requires tracing dependencies
+ Purposefully do things like uninstall a package that is not installed
+ Try to uninstall a package which other installed packages still depend
+ Try to uninstall multiple packages which other installed packages depend
+ And many more.
2013-07-05 06:52:07 +00:00
Devin Teske
12a9a52070 Add minor debugging. 2013-07-05 06:46:11 +00:00
Devin Teske
384190f25b Prevent f_package_add() from re-performing f_package_detect_installed()
even though f_package_config() may have already detected the installed
packages.
2013-07-05 06:24:18 +00:00
Devin Teske
35925de7b6 Don't deselect a package right after installing it (this went unnoticed
because [currently] we exit after performing requests actions -- if we
ever change this to returning to the package selection screen, this would
have made an impact).
2013-07-05 06:22:25 +00:00
Devin Teske
02af913fc1 Minor debugging changes/additions. 2013-07-05 06:20:01 +00:00
Devin Teske
60fefd1e17 Fix a typo in a comment. 2013-07-05 03:12:29 +00:00
Devin Teske
38ae478b58 Add the beginnings of the old networking services functionality of
sysinstall(8). The UI for this will come later while this exposes the
functionality to the scripted interface. Tested successfully to first
install the pcnfsd package from the `Latest' repository, and second to
configure mountd_flags="-n" in rc.conf(5).
2013-07-05 01:49:20 +00:00
Devin Teske
31185df0d3 Add the necessary code to install packages (uninstall and re-install still
pending). Both scripted access (packageAdd) and UI access have been tested
successfully with a variation of different situations including:
+ Install a package with no dependencies
+ Install a package with dependencies that are already installed
+ Install a package with dependencies where some are already installed
+ Repeat each of the above from FTP and local Directory
+ Purposefully do things like try to install a package that does not exist
+ Try to install a package for which a dependency could not be loaded
+ Try to install a package that is in the INDEX bot not on the media
+ And many more.
2013-07-05 01:44:59 +00:00
Devin Teske
f687c95d86 Add debugging for each of the initialized default variables. 2013-07-05 01:38:42 +00:00
Devin Teske
0e30bd5b2e Add mustberoot.subr to the list of includes for scripts, exposing the helper
function f_mustberoot_init() to make it easy to write scripts that can more
easily transition to the super-user via sudo(8).
2013-07-05 01:37:35 +00:00
Devin Teske
dbc750a529 Remove separate processing of dependent packages from the "Review" screen
since f_package_add (packageAdd resword) processes dependencies itself.
NOTE: This is in preparation for incoming package management code.
2013-07-05 01:32:39 +00:00
Devin Teske
447dfc41b5 Get rid of place-holder in preparation for incoming package mgmt code. 2013-07-05 01:30:13 +00:00
Devin Teske
996caf2185 Comments. 2013-07-05 01:28:30 +00:00
Devin Teske
76ab5f3d5a Allow global default as general fall-back for package management routines. 2013-07-05 01:21:01 +00:00
Devin Teske
a0f49bbab3 Set name of device to directory path (displayed during package operations). 2013-07-05 01:18:54 +00:00
Rui Paulo
f05cddf940 Merge hostapd / wpa_supplicant 2.0.
Reviewed by:	adrian (driver_bsd + usr.sbin/wpa)
2013-07-04 21:12:58 +00:00
Devin Teske
424d0bad55 Implement $probe_only for the media access modules. sysinstall(8) was
allowed to ignore the probe_only argument of its member functions solely
because in the C language, the file accessor methods open and return a file
descriptor and reading of the data is optional. In shell, the file accessor
methods return data on stdout and that data should not be ignored (large
files could block execution).

So, we must adhere to the probe_only flags and in some cases (in the case of
FTP, for example) change the `get' strategy to simply test existence and
return an appropriate status.

This was required because the up-coming package management stuff makes heavy
use of the probe_only argument to try different package suffixes. Every
media access module must implement $probe_only for the `get' accessor.
2013-07-04 20:12:12 +00:00
Warren Block
3e01326432 Whitespace fixes: remove tabs on blank links, spaces following content,
tabs after spaces.

Reviewed by:	gjb
MFC after:	1 week
2013-07-04 18:59:58 +00:00
Warren Block
27f90bebef Put the power modes in a list to make them easier to find.
Reviewed by:	joel
MFC after:	1 week
2013-07-04 12:24:39 +00:00
Dag-Erling Smørgrav
d28832a05e Fall back to sha512 if passwd_format is not set.
MFC after:	3 days
2013-07-04 07:59:11 +00:00
Peter Grehan
a38e2a64dc Support an optional "mac=" parameter to virtio-net config, to allow
users to set the MAC address for a device.

Clean up some obsolete code in pci_virtio_net.c

Allow an error return from a PCI device emulation's init routine
to be propagated all the way back to the top-level and result in
the process exiting.

Submitted by:	Dinakar Medavaram    dinnu sun at gmail (original version)
2013-07-04 05:35:56 +00:00
Pawel Jakub Dawidek
6f691f7ee1 Sandbox rwhod(8) receiver process using capability mode and Capsicum
capabilities.

rwhod(8) receiver can now only receive packages, write to /var/rwho/ directory
and log to syslog.

Submitted by:	Mariusz Zaborski <oshogbo@FreeBSD.org>
Sponsored by:	Google Summer of Code 2013
Reviewed by:	pjd
MFC after:	1 month
2013-07-03 21:07:02 +00:00
Pawel Jakub Dawidek
223eee088f The whole sending functionality was implemented within signal handler,
which is very bad idea. Split sending and receiving in two processes,
which fixes this problem and will help to sandbox rwhod.

Submitted by:	Mariusz Zaborski <oshogbo@FreeBSD.org>
Sponsored by:	Google Summer of Code 2013
Reviewed by:	pjd
MFC after:	1 month
2013-07-03 21:04:20 +00:00
Pawel Jakub Dawidek
90173d7dc6 Style cleanups.
Submitted by:	Mariusz Zaborski <oshogbo@FreeBSD.org>
Sponsored by:	Google Summer of Code 2013
Reviewed by:	pjd
MFC after:	1 month
2013-07-03 20:58:58 +00:00
Dag-Erling Smørgrav
a05aa38cb1 There is no reason to disallow setting the password or account expiry
date to the current date.

MFC after:	3 days
2013-07-03 09:48:24 +00:00
Mikolaj Golub
7f87e7c276 hastResourceWorkerPid is read-only.
Submitted by:	jilles
MFC after:	3 days
2013-07-03 05:54:23 +00:00
Mikolaj Golub
e338dbe453 Add a mib for worker process ID.
MFC after:	3 days
2013-07-02 18:54:39 +00:00
Peter Grehan
34d244edb2 Fix up option parsing to allow a colon in the config section.
Clean up some other unnecessary code.

Submitted by:	Dinakar Medavaram    dinnu sun at gmail
Reviewed by:	neel
2013-07-01 23:53:22 +00:00
Rick Macklem
62869df0c8 Document the fact that an NFSv4 mount uses the host uuid to uniquely
identify the client to the server. As such, NFSv4 mounts
will break if host_enable="NO" is specified.
This is a content change.

Suggested by:	lars@netapp.com
MFC after:	3 days
2013-07-01 21:41:12 +00:00
Tim Kientzle
8f95d0d822 Fix -Wunsequenced
Submitted by:	dt71@gmx.com
2013-06-29 15:58:03 +00:00
Tim Kientzle
1d47232e08 Fix -Wunsequenced warning
Submitted by:	  dt71@gmx.com
2013-06-29 15:54:17 +00:00
David E. O'Brien
fd50eef304 sysconf(3) returns a long, not an int. 2013-06-29 00:37:49 +00:00
Davide Italiano
237abf0c56 - Trim an unused and bogus Makefile for mount_smbfs.
- Reconnect with some minor modifications, in particular now selsocket()
internals are adapted to use sbintime units after recent'ish calloutng
switch.
2013-06-28 21:00:08 +00:00
David E. O'Brien
c7328a9506 sysconf(3) returns a long, not an int. 2013-06-28 17:18:28 +00:00
Peter Grehan
4dfaf1bc08 Allow 8259 registers to be read. This is a transient condition
during Linux boot.

Submitted by:	tycho nightingale at pluribusnetworks com
Reviewed by:	neel
2013-06-28 06:25:04 +00:00
Peter Grehan
7554303627 Allow the PCI config address register to be read. The Linux
kernel does this. Also remove an unused header file.

Submitted by:	tycho nightingale at pluribusnetworks com
Reviewed by:	neel
2013-06-28 05:01:25 +00:00
Jung-uk Kim
0c10b85a19 Consistently cast ACPICA 64-bit integer types when we print them. 2013-06-26 23:52:10 +00:00
Devin Teske
c9c67103c3 More whitespace. 2013-06-24 20:58:54 +00:00
Devin Teske
b19b201996 Whitespace. 2013-06-24 20:39:07 +00:00
Eitan Adler
b3ff5e4561 Remove request to email suggestions and fixes to the author.
He is no longer involved with the FreeBSD project.

While here: remove "no known bugs" and related.  This isn't present in other manual pages.

PR:		docs/179914
2013-06-24 19:57:25 +00:00
Rick Macklem
d51dbb7a98 Document the "-o" option added by r252138.
MFC after:	10 days
2013-06-24 02:24:22 +00:00
Rick Macklem
c323438205 Add a new "-o" option to the gssd which forces gss_init_sec_context()
to use DES and the associated old style GSS initialization token.
This appears to be required for some non-FreeBSD servers to
get a kerberized NFS mount to work. Also, ignore some signals when daemonized,
which might fix the gssd from "disappearing" without leaving a core dump.
Given the tight timeframe for the FreeBSD9.2 release, I have
committed this while waiting for code review. I will commit
changes recommended by the review in a separate commit.

Reviewed by:	dfr (pending)
MFC after:	10 days
2013-06-24 02:19:23 +00:00
Devin Teske
edc9198c33 Add a newline character to the end of the "Check URL again" error message
because long URLs do not induce extra height despite wrapping by dialog(1).
NOTE: For even longer lines, the cursor up/down keys work to scroll through
2013-06-23 10:51:26 +00:00
Devin Teske
47b73aa2c1 Merge r248313 from stable/9 sysinstall(8) to head bsdconfig(8):
Add support for installation directly via HTTP.

While we're here, remove the menu-item for Passive FTP (since moving to
ftp(1) and switching FTPMODE to `auto' by default -- see r251613 -- the
single remaining FTP menu-item works for both ftp.f.o and ftp-archive.f.o;
previously each requiring separately active versus passive both work with
the `auto' setting). In scripting you still have mediaSetFTPActive and
mediaSetFTPPassive but the remaining FTP menu-item uses mediaSetFTP which
defaults to `auto' (aforementioned SVN r251613).
2013-06-23 10:48:26 +00:00
Devin Teske
5ffdcd4c61 Implement the $probe_only parameter (previously unimplemented). 2013-06-23 10:04:23 +00:00
Devin Teske
6a18711a00 Fine-tune the parsing of the URL. Re-order, comment, and add debugging to
each case of unique URL format.
2013-06-23 09:41:47 +00:00
Devin Teske
a7408e5cc1 Fix a code typo that prevented the probing of the current defaultrouter
in-order to pre-populate the editor.
2013-06-22 03:54:17 +00:00
Devin Teske
24365ecc72 Oops, previous revision (r252084) broke non-full-path resolution (e.g.,
ftp://ftp.freebsd.org or ftp://ftp.freebsd.org/). Now both full-path and
non-full resolution is working regardless of trailing-slash.
2013-06-22 03:50:14 +00:00
Devin Teske
ffd2e04e32 Trim the trailing `/' from the ftp_dir when validating that the directory
exists on the FTP server. This now means that when you specify a full-path
to the repository on the FTP server that it doesn't matter whether you have
a trailing `/' or not.
2013-06-22 03:44:49 +00:00
Devin Teske
2c2a50fde6 Take advantage of the fact that f_getvar evaluates the $var_to_get parameter
within braces, allowing all manner of parameter expansions (properly quoted
or escaped, of course).
2013-06-22 02:57:52 +00:00
Devin Teske
4ef0123eb7 Fix a regression introduced by r251967, resulting in:
/usr/libexec/bsdconfig/110.mouse/mouse: 134:
Syntax error: ";;" unexpected (expecting "fi")
2013-06-22 02:51:22 +00:00
Devin Teske
a0d3f1e5bc Fix a regression introduced by r251967, resulting in:
/usr/libexec/bsdconfig/080.console/console: 136:
Syntax error: ";;" unexpected (expecting "fi")
2013-06-22 02:47:54 +00:00
Devin Teske
03104918fe Add missing local declaration. 2013-06-21 23:21:16 +00:00
Devin Teske
bb470eb314 Remove unused library include. 2013-06-21 23:18:29 +00:00
Devin Teske
1de60ff0f4 Alphabetize library includes. 2013-06-21 23:13:55 +00:00
Devin Teske
66badff968 Style. 2013-06-21 22:53:51 +00:00
Devin Teske
5b3821c01c Typo and grammar fixes to comments. 2013-06-21 22:47:31 +00:00
Devin Teske
403c4b46e0 Fix a code typo in a case-statement match expression that prevented IPv6
URLs with port designator from working properly (e.g. http://[::1]:80/).
2013-06-20 07:29:42 +00:00
Devin Teske
e269422b91 When the fall-back of a case-statement is the last thing executed in a
while-loop _and_ all prior matches in the same case-statement either break
or continue, we can safely break the fall-back out of the case-statement.
This should improve readability and allow for longer-lines by reducing the
level of indentation by-one for the fall-back case.
(a continuation of SVN r252019)
2013-06-20 05:51:44 +00:00
Devin Teske
fd3d4fec40 When the fall-back of a case-statement is the last thing executed in a
while-loop _and_ all prior matches in the same case-statement either break
or continue, we can safely break the fall-back out of the case-statement.
This should improve readability and allow for longer-lines by reducing the
level of indentation by-one for the fall-back case.
2013-06-20 05:48:08 +00:00
Devin Teske
a0b423e1f7 Remove pedanticism and consolidate some logic. 2013-06-20 05:42:21 +00:00
Devin Teske
3b1f7d9e5d Add debugging (for a case that shouldn't arise, but makes it more obvious
if a menu addition is made in one plce but forgotten in another).
2013-06-20 05:40:11 +00:00
Devin Teske
1a13494575 Style -- no ;; needed on fallback clause within case-statement. 2013-06-19 18:44:55 +00:00
Devin Teske
ba44a0d54a Whitespace. 2013-06-19 18:32:18 +00:00
Devin Teske
f4a3220ca1 Whitespace and comments. 2013-06-19 18:13:58 +00:00
Devin Teske
3daac03bb7 Alphabetize reserved-word (resword) registration. 2013-06-19 17:14:59 +00:00
Devin Teske
fa8b43c808 Alphabetize includes. 2013-06-19 17:13:16 +00:00
Devin Teske
e52257af13 Remove extra whitespace lines. 2013-06-19 00:24:08 +00:00
Devin Teske
9cd8fcc642 Change a humongous if-statement at the end of f_install_zoneinfo_file() into
an early return, allowing a huge chunk of code to be indented one-level less
2013-06-19 00:13:54 +00:00
Devin Teske
b17d3670ee Take advantage of newly updated f_dialog_{yesno,noyes}() functions from
SVN r251977 (adding an $hline parameter).
2013-06-19 00:09:21 +00:00
Devin Teske
b4dc08d45d When I first wrote the timezone module, it was in sysutils/tzdialog and it
pre-dates bsdconfig. Update the code to take advantage of f_dialog_msgbox().
2013-06-19 00:08:29 +00:00
Devin Teske
68d5c9afb9 Change the f_dialog_{yesno,noyes}() function-arguments in `dialog.subr' to
accomodate an $hline value for overriding the default. This change does
not effect any current modules as it turns out that not one single usage of
either f_dialog_yesno() or f_dialog_noyes() relied on accepting more than a
first argument (read: all occurrences quoted the first parameter; so $* was
never depended upon).

This will allow some custom invocations of --yesno and --noyes to roll over
to these functions (for example, in `timezone/timezone').
2013-06-18 23:48:05 +00:00
Devin Teske
aaeba1c1ea Perform some code consolidation and replace nested case-statements with
more logical if-else statements for each menu selection.
2013-06-18 23:18:32 +00:00
Devin Teske
fcd71b75c9 Fix a regression introduced by r251967, resulting in:
/usr/libexec/bsdconfig/140.startup/startup: 130:
Syntax error: ";;" unexpected (expecting "fi")
2013-06-18 23:14:45 +00:00
Devin Teske
229efb37dc Whitespace. 2013-06-18 23:11:36 +00:00
Devin Teske
df750a6ced Perform some code consolidation and add some additional error
checking/reporting. (similar to SVN revisions 251919 and 251928)
2013-06-18 21:44:35 +00:00
Devin Teske
7cdf48fc2c Comments. 2013-06-18 21:35:38 +00:00
Devin Teske
0071dbd1cd Comments and whitespace. 2013-06-18 09:54:09 +00:00
Devin Teske
997cf00a16 Comments. 2013-06-18 09:45:10 +00:00
Devin Teske
d7d2d8039a Perform some code consolidation and add some additional error
checking/reporting. (similar to SVN revision 251919)
2013-06-18 09:43:10 +00:00
Devin Teske
dee8ed370d Whitespace and comments. 2013-06-18 09:41:34 +00:00
Devin Teske
23fb944196 Perform some code consolidation and add some additional error
checking/reporting. (similar to SVN revisions 251905 and 251915)
2013-06-18 09:28:49 +00:00
Devin Teske
d6abc28bf4 Remove unnecessary loops, perform some code consolidation, and add some
additional error checking/reporting. (same thing going on here as SVN
r251905 -- just this time for the mouse module instead of console)
2013-06-18 09:19:59 +00:00
Devin Teske
f1edae9451 Whitespace. 2013-06-18 09:05:08 +00:00
Devin Teske
131502c303 Use newly enhanced f_dialog_msgbox() from SVN r251912. 2013-06-18 08:59:47 +00:00
Devin Teske
5a97d36067 Change the f_dialog_msgbox() arguments in `dialog.subr' to accomodate an
$hline argument for setting the --hline parameter value. This change does
not effect any current modules as it turns out that not one single usage of
f_dialog_msgbox() relied on accepting more than a first argument (read: all
occurrences quoted the first parameter; so $* was never depended upon).

This will allow some custom invocations of --msgbox to roll over to this
function (for example, in `mouse/disable').
2013-06-18 08:54:02 +00:00
Devin Teske
55bce0c120 Comments. 2013-06-18 08:40:16 +00:00
Devin Teske
c9e7fcd366 Comments. 2013-06-18 08:35:44 +00:00
Devin Teske
274282c82b Fix a typo in a comment. 2013-06-18 08:30:31 +00:00
Devin Teske
97e0eecaf3 Switch bsdconfig Disk Management' from sade(8) to bsdinstall partedit'. 2013-06-18 08:28:03 +00:00
Devin Teske
8de4fc8d23 Oops, in SVN r251905 I forgot that f_die takes the return code as the first
argument (not the format).
2013-06-18 08:22:51 +00:00
Devin Teske
6dcefcac2b Improve the INDEX format. Whitespace improvements, format improvements, typo
and grammatical fixes.
2013-06-18 08:15:56 +00:00
Devin Teske
a67f39c51a Remove unnecessary loops, perform some code consolidation, and add some
additional error checking/reporting.
2013-06-18 07:36:09 +00:00
Devin Teske
c3ffa2ba18 Whitespace improvements. 2013-06-18 07:33:45 +00:00
Baptiste Daroussin
76f8eb196c Fix bindings of keys when in the partition editor. By adding the usual input binding to the "partlist" sub window.
This is a workaround, as for unknown yet reason the keys binded on the Partition Edition window are the one from partlist instead of the one from standard "formfield"

Reported by:	alfred, nwhitehorn
2013-06-17 15:16:14 +00:00
Devin Teske
65c7c08716 Style/comments. 2013-06-15 13:38:21 +00:00
Devin Teske
c6f73e3099 Add skeleton processing of selected packages in the order in which they
should be processed. De-select each package as we "process" (actual
processing still pending) each package so that if we get an error, we can
return to an accurate state of selected packages.
2013-06-14 19:35:30 +00:00
Devin Teske
f184cec5a9 Make the default choice for FTP media access use "auto". 2013-06-11 03:37:29 +00:00
Devin Teske
641cb9ccd9 Fix a bug introduced by r251236; product of bug was the following error in
"Startup"->"View/Edit Startup Configuration"->"Add New"->"Add From List":

[: -eq: unexpected operator

NOTE: Previously mentioned in r251557

Problem caused by removal of $retval to capture exit status of call to
f_dialog_input_rclist().

While we're here, enhance f_dialog_input_rclist() to accept a default-item
to make selecting multiple values to-add more efficient.
2013-06-09 15:36:13 +00:00
Baptiste Daroussin
8ad6d9175c Fix a bad calloc(3) call
MFC after:	2 weeks
2013-06-08 23:48:13 +00:00
Devin Teske
d7b85d2789 Fix a bug introduced with r251190, in which a small hunk was forgotten in
the performance conversion process.

The effect of this was the following error when selecting the menu
"Startup"->"View/Edit Startup Configuration"->"Add New"->"Add From List":

[: -eq: unexpected operator

By running `bsdconfig -d' as root to enable debugging, this turns into:

DEBUG: f_getvar: var=[text] value=[
Error: Expected a number for token 4 of --menu.
Use --help to list options.] r=0
[: -eq: unexpected operator

Indicating that the fourth token for --menu which should be $height was
instead a string (the first item of $menu_list) because it was using the
old size-calculation method and $size was now null (needed to use instead
the new size variables of $height $width and $rows).
2013-06-08 21:45:32 +00:00
Devin Teske
04d380df0c Fix a bug introduced with r249751, in which a small hunk was forgotten in
the performance conversion process.

The effect of this was, when your /etc/defaults/rc.conf file changed
(based on md5(1)) and re-generating the file startup_rcconf_map.cache in
/var/run/bsdconfig/ you would get a screen-dump of its contents before the
menu would appear.
2013-06-08 21:33:09 +00:00
Devin Teske
9039c2f6f7 Fix a typo in comments. 2013-06-08 21:11:26 +00:00
Devin Teske
2d0797c6dd Don't silently ignore errors (found while
testing with `chflags schg /etc/ttys).
2013-06-08 20:47:43 +00:00
Devin Teske
f5e1223b85 Prevent getting hung-up on the following prompt (found while testing with
`chflags schg /etc/ttys'):

override rw-r--r--  root/wheel for /etc/ttys? (y/n [n])

Simply by adding `-f' flag to mv(1).
2013-06-08 20:43:13 +00:00
Devin Teske
5e66bd88c9 Fix a one-character typo. The effects of which were "Console"->"Ttys" menu
would not launch (and gave no error). This was easily diagnosed by running
`bsdconfig -d' as root and seeing the following error right after selecting
the "Ttys" sub-menu:

DEBUG: f_getvar: var=[text] value=[
Error: Expected at least 6 tokens for --menu, have 4.
Use --help to list options.] r=0

Typo was introduced by SVN r251361.
2013-06-08 20:27:16 +00:00
Devin Teske
9b897ae786 Add a prompt to the "Add User" and "Add Group" sub-menu items (under the
"Login Management" module): Use default values for all account details?

If you select "Yes" (the default is "No"), you'll jump past all the prompts
and jump straight to the review screen with all-default values.

Makes adding a lot of users/groups faster/easier if you don't need to
customize more than one or two different values from their defaults.
2013-06-08 19:13:49 +00:00
Devin Teske
528318ae53 Curb another regression (this one introduced by r251545, itself trying to
fix the regression introduced by r251544; which was trying to make things
consistent w/respect to ESC versus YES versus NO in the password disable
prompt in "Login Management".

(need stronger coffee; very sorry for the churn)

With this revision, the "YES", "NO", and implied ESC options all work as-
expected. Choosing "YES" allows you to proceed and the password will be
disabled. Choosing "NO" will bring back around to enter a password for the
account. Pressing ESC will drop you out of either user or group input and
back to the usermgmt screen.
2013-06-08 18:23:41 +00:00
Devin Teske
350db06539 Fix a regression introduced by r251544; if user chooses "NO" when being
asked if they would like to disable password authentication for the account,
loop back to prompt them for the password again.
2013-06-08 18:13:42 +00:00
Devin Teske
7ca5c4cbc6 Check for ESC as a separate choice from "NO" when asking if the operator
would like to disable password management for an account while adding either
a user or group. When being prompted to answer questions while adding a
group or user, two things are trow:

1. You can hit ENTER to blast through all the questions and in the end, the
   group or user is created with sensible defaults for all values.

2. You can press ESC during any prompt to cancel the operation as a whole.

This fix is shoring up an inconsistency in the latter (#2).
2013-06-08 18:08:17 +00:00
Devin Teske
edc6918e0b Track defaultitem in the password and account expiry menus; if the user
presses ESC or chooses Cancel/No in any of the sub-menus, we want to return
to the expiry menu with that item selected.
2013-06-08 17:46:39 +00:00
Devin Teske
3196cddc5d Fix a regression in the "Login Management" module introduced by r251242 in
which choosing to cancel the manual input of expiration time (in seconds
since the UNIX epoch) for either account expiration or password expiration
would see the original value lost.
2013-06-08 17:36:31 +00:00
Devin Teske
f82913db88 Reduce verbosity in the "Console"->"Saver" module (bsdconfig syscons_saver)
by replacing the infinitive [verb] phrase "Simply blank the screen" with a
simple description of what you get; "Blank screen".

PR:		ports/169316
2013-06-08 16:49:19 +00:00
Devin Teske
2a90fca013 Remove extraneous characters ('<<<') from `Exit' menutag in the "Security"
and "Startup"->"Misc" modules to make the menus appear more consistent with
the numerous other modules and look a little cleaner.

PR:		ports/169316
2013-06-08 16:28:08 +00:00
Sean Bruno
06f1884fa8 Implement foreign volume handling. Allows admins to view foreign metadata
and clear or import it for use.

PR:     kern/172091
Submitted by:   smh@freebsd.org
Reviewed by:    jhb@freebsd.org
MFC after:      2 weeks
2013-06-08 02:54:59 +00:00
Xin LI
410bcf7cc7 Make 'portsnap alfred' overwrite ports tree if it's not created by a
portsnap.

Discussed with:	alfred
Reviewed by:	cperciva
2013-06-07 20:21:30 +00:00
Rick Macklem
35ab0ce9ca Fix r251444 so that gssd.c still builds for WITHOUT_KERBEROS.
Reported by:	bf1783@gmail.com
MFC after:	2 weeks
2013-06-06 22:02:03 +00:00
Rick Macklem
d15f63f2fe Document the new "-v" option for the gssd daemon.
This is a content change.

MFC after:	2 weeks
2013-06-05 23:28:29 +00:00
Rick Macklem
7e301aa928 Add a "-v" (verbose) option to the gssd daemon, to help
with diagnosis of kerberized NFS mount problems. When set,
messages are sent to syslog() (or fprintf(stderr,...) if
"-d" is also specified) to indicate activity/results of
kgssapi upcalls.

Reviewed by:	jhb
MFC after:	2 weeks
2013-06-05 23:17:39 +00:00
Xin LI
c84739b210 Use calloc().
MFC after:	2 weeks
2013-06-05 21:56:29 +00:00
Xin LI
ac8e13960d Remove unneeded reference to link.h (sys/link_elf.h).
MFC after:	2 weeks
2013-06-05 21:55:20 +00:00
Devin Teske
291a501e40 Shift Console->Saver menu items to place the default item at the top, making
this menu consistent with Console->Repeat, Console->Font, Console->Screenmap
and many others which place the default choice at the top.

NOTE: SVN r249751 changed things so that these menus highlight the active
selection, so the idea that the default choice (now at top) "can be selected
immediately by hitting ENTER" is not possible unless the default choice is
the currently active setting (e.g., on first visit to the menu). However, it
is still warranted to have the default choice at the top of the menu.

PR:		bin/169316
2013-06-04 17:08:26 +00:00
Devin Teske
595e514d0d Lessen verbosity of "Exit" menutag items to appear more consistent across
menus from one module to the next.

Replacing "Exit this menu (returning to previous)" with "Exit this menu".

PR:		ports/169316
2013-06-04 16:48:23 +00:00
Devin Teske
44392705fa Use f_shell_escape() instead of forking to awk. In this case, the
replacement comes with a great performance increase (as f_shell_escape()
uses the built-in based f_replaceall() which out-performs forking to
awk(1)). This should also improve readability slightly.
2013-06-04 03:47:21 +00:00
Devin Teske
97142e6ae7 Use a case-statement instead of multiple (separate even) if-statements. 2013-06-04 03:38:16 +00:00
Devin Teske
b988241f05 Comments. 2013-06-04 03:37:35 +00:00
Devin Teske
b5bd0bacd6 Similar to r251236, r251242, and r251244. Introduce new function-pair to
dialog(1) API in dialog.subr responsible for retrieving menu-choice data
(for the --menu widget).

Add f_dialog_menuitem_store()/f_dialog_menuitem_fetch() for storing and
retrieving the menuitem (not the tag) from a --menu widget result.

The dialog --menu widget returns the `tag' from the tag/item pair of choices
for a menu list. Because the menu list is often local to the function that
is displaying it, the ability to dereference this into the item is not
possible unless you use a global. This changes things so the function (upon
successful return of dialog) dereferences the tag into the item and stores
it for later retrieval using these functions.

NOTE: Tags are dereferenced into items using f_dialog_menutag2item().
2013-06-04 03:30:44 +00:00
Devin Teske
83822902c2 Fix a code typo (missing `eval') which lead to improperly-sized menu when
displaying packages (menu was always maximum height). The problem was
introduced by SVN r251232.
2013-06-04 00:42:31 +00:00
Devin Teske
b87d5f1f1f Fix menu accenting for the package category list. The single-space indent
for duplicate initial-characters was removed for making comparisons but was
not put back.
2013-06-04 00:38:19 +00:00
Devin Teske
fe9ef40c68 Whitespace and comments. 2013-06-04 00:35:57 +00:00
Devin Teske
790062d26b Improve debugging for f_dialog_*_constrain() to print constrained rather
than unconstrained values.
2013-06-04 00:30:05 +00:00
Brian Somers
6a3193a773 Move ppp.8.m4 back to ppp.8 and de-ifdef it.
Requested by: joel

MFC after:	1 week
2013-06-02 23:56:38 +00:00
Devin Teske
dd5cc066af Like r250701, introduce another handy function for truncating variables to a
specific byte-length. Works like vsnprintf(3).
2013-06-02 23:25:27 +00:00
Devin Teske
f8e121ed61 Fix a typo. In this case, the typo caused the f_noyes() invocation to
display a global instead of the passed-argument; however since the global
always has the same value as the passed argument, it made no difference in
the realtime operation.
2013-06-02 23:23:29 +00:00
Devin Teske
e4cb6ac115 Fix a bug in which the user's choice to Cancel was not recognized. This was
caused by the standard (and correct) behavior of the shell to discard the
return status of lvalue-operands in a pipe-chain.

The solution is to not pipe the file-acquisition directly into sort(1) but
instead store the output (allowing immediate testing of the return status)
and later sort it.
2013-06-02 23:20:46 +00:00
Devin Teske
faf9d0ce1c Fix a bug that would cause a spurious warning to appear to appear in an
edge-case. The case was that you have been through the FTP setup once before
and on the second time through, you cancel at the re-selection of a new FTP
server.

The spurious warning was "device_media: not found" and was caused because
the underlying call to f_device_network_down() did not check to see if the
network device existed before attempting to shut it down.

Add checks to make sure we don't forge ahead unless the device exists.
2013-06-02 23:18:27 +00:00
Devin Teske
538d68ea69 Fix a bug in which the user's choice to Cancel was not properly recognized. 2013-06-02 23:15:12 +00:00
Devin Teske
3b4e309862 Change the name of a couple of functions in `usermgmt/user_input.subr' to
make their purpose more clear by their names:

	f_dialog_input_change() and
	f_dialog_input_expire()

Are now (respectively):

	f_dialog_input_expire_password() and
	f_dialog_input_expire_account()

Upon revisit to this portion of code, the former names were too confusing.
2013-06-02 23:12:32 +00:00
Devin Teske
10908a6f19 Fix a copy/paste error within a comment. 2013-06-02 23:08:21 +00:00
Devin Teske
80ae9845f5 Add some additional debugging to the common media library. 2013-06-02 23:06:33 +00:00
Devin Teske
c01472c194 Make some obvious consolidations in local declaration for readability. 2013-06-02 23:05:01 +00:00
Devin Teske
51c41087d1 Standardize NULL initialization to be consistent. 2013-06-02 23:02:56 +00:00
Devin Teske
80433743e3 Use f_isset() (introduced by r250317) instead of `f_quietly f_getvar ...'. 2013-06-02 22:54:36 +00:00
Devin Teske
42ade6a964 Make proper use of locals in f_dialog_init(). 2013-06-02 22:45:54 +00:00
Devin Teske
f4844f65a9 Improvements to whitespace and comments. 2013-06-02 22:34:40 +00:00
Devin Teske
5b4765c331 Fix option processing from the library layer to address unexpected
behavior(s); e.g., `-Xd' versus `-dX' did not produce the same results.

The libraries common.subr and dialog.subr automatically process the
arguments passed to the program and enable/disable functionality without the
need to process the arguments within your program. For example, if "$@"
contains `-d', common.subr will see this and enable debugging regardless of
whether you process "$@" yourself or not (this automatic processing can
easily be disabled for custom scripts that don't want it; see the afore-
mentioned scripts for additional details).

NOTE: common.subr stores a copy of "$@" in $ARGV for convenient (and
repeated) processing by libraries such as dialog.subr which provide such
transparent functionality for the consuming script(s).

However, the libraries don't know if a program wants to accept `extra'
options. Flags are not really a problem, because the library can be
programmed to silently ignore unknown flags. The trouble comes into play
when the program wants to define an option that takes an argument.

For example:

	bsdconfig -D logfile -X

In the above example, the library uses getopts to process $ARGV and if it
doesn't know that `-D' takes an argument, the option processing will
prematurely terminate on `logfile' (this is standard/correct behavior for
getopts but is undesired in our situation where we have partially off-loaded
main argument processing).

The problem is solved by allowing the program to define an extra set of
options to be included in each library's handling of $ARGV. Only options
that require arguments are truly necessary to be pre-specified in this new
manner.
2013-06-02 22:04:39 +00:00
Devin Teske
052f89691c Standardize the way functions build their arguments leading up to a dialog
invocation. Specifically, "top-load" your arguments and in the order in-
which they will be displayed. For example, many [if not all] widgets display
information in the following order, top-to-bottom (visually):

+ backtitle (displayed behind the widget at top-left)
+ title (at the top of the `window')
+ prompt text (just below the title and above whatever widget you choose)
+ Depending on widget, _one_ of the following:
  - menu list
  - radio list
  - check list
  - text input box with initial text
  - [Xdialog(1)] 2x or 3x text input boxes
  - [dialog(1)] a multi-part form
  - progress bar
  - etc. (many more widget choices)
+ buttons (right below the selected widget)
+ [dialog(1)] the hline (displayed at bottom of `window')

NOTE: Xdialog(1) accepts and silently ignores --hline

When building local arguments for your dialog invocation, if the value can't
be cleanly loaded into a local, add "# Calculated below" to the end of the
local declaration while retaining the block order of argument declarations.

Move other local declarations that are not associated with this top-loading
the dialog arguments to right-above where they are first-used.

Also, standardize on the names of the arguments. For example, always use
$prompt (instead of sometimes $msg and sometimes $prompt); use $menu_list
or $shell_list or $radio_list for those respective widgets; ad nauseum.

While we're doing this, flush-out full arguments for many invocations that
were passing NULL strings (making it unapparent if you were staring at this
one invocation what argument that NULL string was supposed to represent).

Last, while we're in startup/rcconf let's remove the unnecessary use of a
GLOBAL (RCCONF_MENU_LIST) for the menu_list.
2013-06-02 20:02:50 +00:00
Devin Teske
775997786b Improve the dialog(1) API in dialog.subr by adding f_dialog_default_store()
and f_dialog_default_fetch(). Operating similar to functions introduced by
SVN r251236 and r251242, these functions operate as a pair for helping track
the default-item data (for the --menu, --checklist, and --radiolist
widgets).

This replaces the direct usage of a global to store the data with an
abstract method for readability and to centralize the code.
2013-06-02 09:02:12 +00:00
Devin Teske
ec7120b5b2 Similar to r251236, improve the portion of dialog(1) API in dialog.subr
responsible for retrieving stored input (for the --inputbox and --password
widgets).

When we (Ron McDowell and I) developed the first version of bsdconfig, it
used temporary files to store responses from dialog(1). That hasn't been
true for a very long time, so the need to always execute some clean-up
function is long-deprecated. The function that used to perform these clean-
up routines for these widgets was f_dialog_inputstr().

We really don't need f_dialog_inputstr() for its originally designed purpose
as all dialog invocations no longer require temporary files.

Just as in r251236, redesign f_dialog_inputstr() in the following four ways:

1. Rename f_dialog_inputstr() to f_dialog_inputstr_fetch()
2. Introduce the new first-argument of $var_to_set to reduce forking
3. Create a corresponding f_dialog_inputstr_store() to abstract storage
4. Offload the sanitization to a new function, f_dialog_line_sanitize()

It should be noted that f_dialog_line_sanitize() -- unlike its cousin from
SVN r251236, f_dialog_data_sanitize() -- trims leading/trailing whitespace
from the user's input. This helps prevent errors and common mistakes caused
by the fact that the new cdialog implementation allows the right-arrow
cursor key to go beyond the last byte of realtime input (adding whitespace
at the end of the typed value).

While we're centralizing the sanitization, let's rewrite f_dialog_input()
while we're here to likewise reduce forking. The f_dialog_input() function
now expects the first argument of $var_to_set instead of producing results
on standard-out.

These changes greatly improve readability and also improve performance.
2013-06-02 05:45:25 +00:00
Mark Johnston
950ff8e4dd We want to stat the archived log file rather than the logfile itself.
PR:		bin/179122
Submitted by:	Oliver Fromme <olli@secnetix.de>
MFC after:	3 days
2013-06-02 01:10:49 +00:00
Devin Teske
fd962ac699 Improve portion of the dialog(1) API in dialog.subr responsible for
retrieving stored data (for the --menu, --calendar, --timebox, --checklist,
and --radiolist widgets).

When we (Ron McDowell and I) developed the first version of bsdconfig, it
used temporary files to store responses from dialog(1). That hasn't been
true for some very long time, so the need to always store the return status
of dialog(1) and then call some function to clean-up is long-deprecated. The
function that used to do the clean-up was f_dialog_menutag().

We really don't need f_dialog_menutag() for its originally designed purpose,
as all dialog invocations (even when in a sub-shell) do not use temporary
files anymore.

However, we do need to keep f_dialog_menutag() around because it still fills
the need of being able to abstract the procedure for fetching stored data
provided by functions that display the aforementioned widgets.

In re-designing f_dialog_menutag(), four important changes are made:

1. Rename f_dialog_menutag() to f_dialog_menutag_fetch()
2. Introduce the new first-argument of $var_to_set to reduce number of forks
3. Create a corresponding f_dialog_menutag_store() to abstract the storage
4. Offload the sanitization to a new function, f_dialog_data_sanitize()

NOTE: That last one is important. Not all functions need to store their data
for later fetching, meanwhile every invocation of dialog should be sanitized
(as we learned early-on in the i18n-effort -- underlying libraries will spit
warnings to stderr for bad values of $LANG and since dialog outputs its
responses to stderr, we need to sanitize every response of these warnings).

These changes greatly improve readbaility and also improve performance by
reducing unnecessary forking.
2013-06-01 23:58:44 +00:00
Devin Teske
f416c89cb3 Fix a typo introduced by r251190. 2013-06-01 22:12:53 +00:00
Devin Teske
367a23a787 Fix a regression in the packages module introduced by recent r251190.
I somehow neglected this module in merging that API change.
2013-06-01 21:29:53 +00:00
Devin Teske
74036c4de9 Improve portion of the dialog(1) API in dialog.subr responsible for
calculating widget sizes. Instead of forking a sub-shell to calculate the
optimum size for a widget, use a byRef style call-out to set variables in
the parent namespace. For example, instead of:

	size=$( f_dialog_buttonbox_size title btitle msg )
	$DIALOG --title title --backtitle btitle --msgbox msg $size

The new API replaces the above with the following:

	f_dialog_buttonbox_size height width title btitle msg
	$DIALOG --title title --backtitle btitle --msgbox msg $height $width

This reduces the number of forks, improves performance, and makes the code
more readable by revealing the argument-order for widget sizing. It also
makes performing minor adjustments to the calculated values easier as
you no longer have to split-out the response (which required knowledge of
ordering so was counter-intuitive).
2013-05-31 19:07:17 +00:00
Jung-uk Kim
a9c007f1f2 Fix a long standing logic bug introduced in r167814. The code was added to
get RSDP from loader(8) hint via kenv(2) but the bug nullified the new code
and we always fell back to the previous method, i. e., sysctlbyname(3).

MFC after:	3 days
2013-05-31 17:23:38 +00:00
Xin LI
9417953e08 Convert Makefile to have only one file for each line, while I'm there, sort
SRCS to ease future upgrades.
2013-05-30 21:24:33 +00:00
Xin LI
d03c0883ad MFV: tcpdump 4.4.0.
MFC after:	4 weeks
2013-05-30 20:51:22 +00:00
Mark Johnston
dd3368997e - Fix wording. [1]
- Improve the descriptions in the FILES section. [2]

Reported by:	Jason McIntyre [1]
Obtained from:	NetBSD [2]
MFC after:	3 days
2013-05-28 13:54:26 +00:00
Garance A Drosehn
137076c5f7 Change the closeallfds() routine to use closefrom() when it is
available (closefrom() was added to FreeBSD in 8.0-release).
The selection is made at compile-time, as I still compile a
FreeBSD-based version of lpr&friends on other platforms.

While testing I out that (at least on my system) lpd has been
closing 11095 fd's, when there are only 6 fd's open.  The old
code took 120 times more clocktime than calling closefrom().
(although that was still less than 2/1000-ths of a second!)

Reviewed by:	jilles
MFC after:	2 weeks
2013-05-27 22:19:01 +00:00
Mark Johnston
601848d2b2 Include descriptions of the flags and fields printed when dumping the
IPv6 prefix list.

Reviewed by:	hrs
MFC after:	1 week
2013-05-23 19:50:36 +00:00