Commit Graph

13449 Commits

Author SHA1 Message Date
Josh Paetzel
689d811165 Check for intel RAID devices
Submitted by:	kris
Obtained from:	PC-BSD
2012-03-12 21:24:40 +00:00
Josh Paetzel
de814251a2 Fix a couple of bugs saving network config.
Don't duplicate wlans_ lines.
Enable ipv6 on wireless devices correctly.

Submitted by:	kris
Obtained from:	PC-BSD
2012-03-12 20:44:44 +00:00
Josh Paetzel
2bcfa25df8 Make sure when creating new MBR partition it is set to active by default.
Submitted by:	kris
Obtained from:	PC-BSD
2012-03-12 20:41:36 +00:00
Josh Paetzel
610ced0a75 Fix a bug running the autoinstall functionality.
Submitted by:	kris
Obtained from:	PC-BSD
2012-03-12 18:50:37 +00:00
Ed Schouten
0ba64b2731 Perform even more style changes.
- Remove unneeded whitespace for function calls.
- Add empty line at the top of functions without local variables.
- Change while (1) to for (;;).

MFC after:	1 week
2012-03-10 14:38:34 +00:00
Ed Schouten
f10070765a Fix whitespace.
MFC after:	1 week
2012-03-10 14:35:09 +00:00
Edward Tomasz Napierala
6b381ff332 Improve error reporting in diskinfo(8) by not displaying errno when
it doesn't make sense.
2012-03-09 18:34:14 +00:00
Ed Maste
f3e566163f Work around broken BIOS memory reporting
Andrzej has a machine with 32GB of RAM, but only 16GB is reported by the
smbios.memory.enabled.  Thus, use the greater of hw.realmem and the smbios
value.

Reported by:	Andrzej Tobola <ato of iem pw edu pl>
2012-03-08 02:00:52 +00:00
Jung-uk Kim
012faf16c1 Make parallel build more safer.
Reviewed by:	tijl
2012-03-07 23:57:49 +00:00
Ed Maste
7ad50a360b Improve multi-line kernel ident parsing
Instead of blindly grabbing the line with 'Version string' and the
following one from the core info file, take all lines after 'Version
string' until the one one that matches the field format in the core info
file.  This provides compatibility with VendorBSD modifications that have
a different kernel ident format.

Reviewed by:	jhb
2012-03-07 18:46:21 +00:00
Bjoern A. Zeeb
7412cb7ef3 Fix building with WITHOUT_INET_SUPPORT set.
Reviewed by:	jamie (actually provided the real fix)
MFC after:	3 days
2012-03-06 18:39:07 +00:00
Edward Tomasz Napierala
811772950f Add LUN resizing to CTL. Also make it possible to explicitly set
size when creating file-backed or device-backed LUN.

Reviewed by:	ken (earlier version)
Sponsored by:	The FreeBSD Foundation
2012-03-06 13:43:57 +00:00
Nathan Whitehorn
0c3cc3c366 Make the chroot shell more functional by providing devfs.
Reported by:	Robert Simmons
MFC after:	4 days
2012-03-05 02:40:18 +00:00
Eitan Adler
d7c784b1a8 Permit the use of raidz3 in pc-sysinstall
PR:		conf/164709
Submitted by:	Garrett Cooper <yanegomi@gmail.com>
Reviewed by:	brd, brooks
Approved by:	cperciva
MFC after:	3 days
2012-03-04 17:33:22 +00:00
Ken Smith
ffd0e88f5d Add entry for packages-8.3-release directory. 2012-03-03 05:04:47 +00:00
Ed Maste
c8b4c0aa6c Grammar: tzsetup now has more than one option. 2012-02-29 14:44:42 +00:00
Martin Matuska
06531226e6 Bump .Dd to reflect latest update
Reported by:	bz
MFC after:	1 week
2012-02-29 07:33:07 +00:00
Martin Matuska
41c0675e6e Add procfs to jail-mountable filesystems.
Reviewed by:	jamie
MFC after:	1 week
2012-02-29 00:30:18 +00:00
Dimitry Andric
07b202a847 Define several extra macros in bsd.sys.mk and sys/conf/kern.pre.mk, to
get rid of testing explicitly for clang (using ${CC:T:Mclang}) in
individual Makefiles.

Instead, use the following extra macros, for use with clang:
- NO_WERROR.clang       (disables -Werror)
- NO_WCAST_ALIGN.clang  (disables -Wcast-align)
- NO_WFORMAT.clang	(disables -Wformat and friends)
- CLANG_NO_IAS		(disables integrated assembler)
- CLANG_OPT_SMALL	(adds flags for extra small size optimizations)

As a side effect, this enables setting CC/CXX/CPP in src.conf instead of
make.conf!  For clang, use the following:

CC=clang
CXX=clang++
CPP=clang-cpp

MFC after:	2 weeks
2012-02-28 18:30:18 +00:00
Martin Matuska
638f378253 mdoc(7) stype - start new sentences on new line
MFC after:	1 week
2012-02-28 07:35:07 +00:00
Jamie Gritton
0c4d49e94a Use the defvs_ruleset paramater when mounting a jail's /dev,
instead of a mount.devfs.ruleset pseudo-parameter.
2012-02-27 22:37:35 +00:00
Jamie Gritton
46571c7c00 From r224286:
Document the potential for jail escape.

From r224615:

  Always disable mount and unmount for jails with enforce_statfs==2.

From r231267:

  A new jail(8) option "devfs_ruleset" defines the ruleset enforcement for
  mounting devfs inside jails. A value of -1 disables mounting devfs in
  jails, a value of zero means no restrictions. Nested jails can only
  have mounting devfs disabled or inherit parent's enforcement as jails are
  not allowed to view or manipulate devfs(8) rules.

From r232059:

  To improve control over the use of mount(8) inside a jail(8), introduce
  a new jail parameter node with the following parameters:

  allow.mount.devfs:
	allow mounting the devfs filesystem inside a jail

  allow.mount.nullfs:
	allow mounting the nullfs filesystem inside a jail

From r232186:

  allow.mount.zfs:
	allow mounting the zfs filesystem inside a jail
2012-02-27 22:28:38 +00:00
Xin LI
cc427081a7 Drop setuid status while doing file operations to prevent potential
information leak.  This changeset is intended to be a minimal one
to make backports easier.

Reviewed by:	kevlo, remko
MFC after:	1 week
2012-02-27 05:49:00 +00:00
Nathan Whitehorn
bfd258f74e Fix segfault if distfetch and distextract binaries are run standalone
without the DISTRIBUTIONS environment variable set.

PR:		bin/165492
Submitted by:	Fernando Apesteguia
MFC after:	4 days
2012-02-26 22:09:21 +00:00
Martin Matuska
e7af90ab00 Analogous to r232059, add a parameter for the ZFS file system:
allow.mount.zfs:
	allow mounting the zfs filesystem inside a jail

This way the permssions for mounting all current VFCF_JAIL filesystems
inside a jail are controlled wia allow.mount.* jail parameters.

Update sysctl descriptions.
Update jail(8) and zfs(8) manpages.

TODO:	document the connection of allow.mount.* and VFCF_JAIL for kernel
	developers

MFC after:	10 days
2012-02-26 16:30:39 +00:00
Daniel Eischen
a2cdef71d1 When using uidstart in /etc/adduser.conf, get the next
available user id and show it in the "Uid [xxx]" prompt.

PR:		163863
Submitted by:	Moritz Wilhelmy (mw at wzff dot de)
MFC after:	2 weeks
2012-02-25 07:58:59 +00:00
Jaakko Heinonen
06eb5e92e2 Exit with proper status when wake() fails.
PR:		bin/153527
Submitted by:	Douglas Steinwand
MFC after:	2 weeks
2012-02-24 07:54:08 +00:00
Jaakko Heinonen
6acc4f15d0 style(9).
MFC after:	2 weeks
2012-02-24 07:49:55 +00:00
Martin Matuska
bf3db8aa65 To improve control over the use of mount(8) inside a jail(8), introduce
a new jail parameter node with the following parameters:

allow.mount.devfs:
	allow mounting the devfs filesystem inside a jail

allow.mount.nullfs:
	allow mounting the nullfs filesystem inside a jail

Both parameters are disabled by default (equals the behavior before
devfs and nullfs in jails). Administrators have to explicitly allow
mounting devfs and nullfs for each jail. The value "-1" of the
devfs_ruleset parameter is removed in favor of the new allow setting.

Reviewed by:	jamie
Suggested by:	pjd
MFC after:	2 weeks
2012-02-23 18:51:24 +00:00
Kevin Lo
29dcf726d2 Handle NULL return from crypt(3). Mostly from DragonFly 2012-02-22 06:27:20 +00:00
Mikolaj Golub
53c49998d5 If permitted protect the supervisor against pageout kill.
Suggested by:	Andrey Zonov <andrey zonov org>
MFC after:	2 weeks
2012-02-19 10:38:55 +00:00
Mikolaj Golub
b6193c2409 Add -r option to restart the program if it has been terminated.
Suggested by:	Andrey Zonov <andrey zonov org>
MFC after:	2 weeks
2012-02-19 10:36:29 +00:00
Mikolaj Golub
195fc497a2 If the supervising process receives SIGTERM, forward it to the spawned
process.  Normally it will cause the child to exit followed by the
termination of the supervisor after removing the pidfile.

This looks like desirable behavior, because termination of a
supervisor usually supposes termination of its charge. Also it will
fix the issue with stale pid files after reboot due to init kills a
supervisor before its child exits.

MFC after:	2 weeks
2012-02-19 10:23:51 +00:00
Mikolaj Golub
2ad4302785 The pidfile_open(3) is going to be fixed to set close-on-exec in order
not to leak the descriptor after exec(3). This raises the issue for
daemon(3) of the pidfile lock to be lost when the child process
executes.

To solve this and also to have the pidfile cleaned up when the program
exits, if a pidfile is specified, spawn a child to exec the command
and wait in the parent keeping the pidfile locked until the child
process exits and remove the file.

Reported by:	Andrey Zonov <andrey zonov org>
Suggested by:	pjd
Reviewed by:	pjd
MFC after:	2 weeks
2012-02-19 10:20:37 +00:00
Jung-uk Kim
a228e013c3 Fix a stupid typo. 2012-02-16 23:05:09 +00:00
Jung-uk Kim
a159c266a9 Merge ACPICA 20120215. 2012-02-16 22:59:29 +00:00
Hans Petter Selasky
79fcfd2e54 Add support for filtering USB devices and USB endpoints to the usbdump utility
when making software USB traces.

MFC after: 1 week
2012-02-16 21:18:36 +00:00
Eitan Adler
c1cb99c965 Fix warning when compiling with gcc46
Approved by:	cperciva
MFC after:	3 days
2012-02-16 05:17:06 +00:00
Kevin Lo
6e807fa629 - Remove some unnecessary cast when assigning NULL to a handle.
- Silent a warning
2012-02-15 02:01:24 +00:00
Kevin Lo
76a387fbba readlink len-1 2012-02-14 10:17:03 +00:00
Ed Schouten
6bbd04d0e4 Restore message in man page on VFS timestamp precision.
Requested by:	bde, jhb
2012-02-14 09:29:37 +00:00
Brooks Davis
df01f319c7 Prevent periodic scripts that run longer than the expected period from
starting up before the previous script finishes.  This prevents an
infinite number of them from piling up and slowing a system down.

Since all the refactoring to make this happen required churning the
indenting of most of this file, make the indentation more consistent.

Reviewed by:	simon
MFC after:	1 week
2012-02-12 23:18:05 +00:00
Ed Schouten
6b99842ada Globally replace u_int*_t from (non-contributed) man pages.
The reasoning behind this, is that if we are consistent in our
documentation about the uint*_t stuff, people will be less tempted to
write new code that uses the non-standard types.

I am not going to bump the man page dates, as these changes can be
considered style nits. The meaning of the man pages is unaffected.

MFC after:	1 month
2012-02-12 18:29:56 +00:00
Ed Schouten
71d8432f98 Replace utxrm(8) by utx(8).
At first, I added a utility called utxrm(8) to remove stale entries from
the user accounting database. It seems there are cases in which we need
to perform different operations on the database as well. Simply rename
utxrm(8) to utx(8) and place the old code under the "rm" command.

In addition to "rm", this tool supports "boot" and "shutdown", which are
going to be used by an rc-script which I am going to commit separately.
2012-02-11 20:28:42 +00:00
Ed Schouten
65f171c657 Correct date. It seems to be 2012. 2012-02-10 13:51:02 +00:00
Ed Schouten
e6ad3d22f4 Detect file modification properly by using tv_nsec.
POSIX 2008 standardizes st_mtim, meaning we can simply use nanosecond
precision to detect file modification.

MFC after:	2 weeks
2012-02-10 13:40:32 +00:00
Eitan Adler
2eb318b31d Fix r231300: Use correct test so we only bail out on error instead of on non-error.
Also, fix a style bug.

Submitted by:	ache
Approved by:	cperciva
MFC after:	1 month
2012-02-10 00:53:39 +00:00
Eitan Adler
839a18b056 Permit the use of relative paths for the prefix argument.
Remove an unnecessary cwd from created plists when -p is specified

PR:		bin/145000
Submitted by:	gcooper
Approved by:	portmgr (flo)
MFC after:	1 month
2012-02-09 20:51:03 +00:00
Martin Matuska
0cc207a6f5 Add support for mounting devfs inside jails.
A new jail(8) option "devfs_ruleset" defines the ruleset enforcement for
mounting devfs inside jails. A value of -1 disables mounting devfs in
jails, a value of zero means no restrictions. Nested jails can only
have mounting devfs disabled or inherit parent's enforcement as jails are
not allowed to view or manipulate devfs(8) rules.

Utilizes new functions introduced in r231265.

Reviewed by:	jamie
MFC after:	1 month
2012-02-09 10:22:08 +00:00
Kevin Lo
870a6d5181 Mention run(4) 2012-02-09 08:33:04 +00:00
Jamie Gritton
1ca35de448 Improvements in error messages:
Some errors printed the jail name for unnamed (command line) jails.

Attempting to create an already-existing jail from the command line
returned with no error (even for non-root) due to bad logic in
start_state.

Ignore kvm_proc errors, which are typically caused by permission
problems.  Instead, stop ignoring permission errors when removing
a jail (but continue to silently ignore other errors, i.e. the
jail no longer existing).  This makes non-root attempts at removing
a jail give a clearer error message.
2012-02-08 23:51:46 +00:00
Garrett Wollman
41b549dc80 It's not an error if unlink(2) fails because the pathname doesn't exist.
Noticed by: kevlo
Pointy hat to: wollman
2012-02-08 05:03:04 +00:00
Jamie Gritton
7ca65ae0fe Allow relative pathnames for jails generated on the command line
(but continue to flag when from a config file).
2012-02-07 22:13:24 +00:00
Dimitry Andric
5e0a19bdee Consistently set RPCGEN_CPP when running rpcgen, so the C preprocessor
set via ${CPP} is used, instead of always using hardcoded /usr/bin/cpp.

MFC after:	1 week
2012-02-07 09:27:07 +00:00
Konstantin Belousov
5c95e6ff60 Be as explicit as possible when describing relation between the -m mask
argument and slices. Adjust example for the same reason.

Submitted by:	Valentin Nechayev <netch netch kiev ua>
MFC after:	3 days
2012-02-04 13:12:52 +00:00
Guy Helmer
b34650e320 Change the notes about the pidfile to include Doug's preference
for pre-creating the pidfile with appropriate owner and permissions.

Requested by dougb
2012-02-01 16:40:59 +00:00
Jamie Gritton
4334a36a6a Better communicate the purpose of "-r *". 2012-01-31 19:45:32 +00:00
Kevin Lo
e01a4776d5 Fix a whitespace nit
Reviewed by:	bz
2012-01-31 05:49:49 +00:00
Jung-uk Kim
688aaa098d Allow contents of multiple directories to be merged to the current image.
Note this patch was submitted to NetBSD and they already adopted it.

http://mail-index.netbsd.org/source-changes/2012/01/28/msg031078.html

MFC after:	1 week
2012-01-31 00:32:37 +00:00
Sean Farley
fd2f39cb85 Since April 2, 2006, Indiana has observed DST.
MFC after:	5 days
2012-01-28 21:06:45 +00:00
Maxim Konovalov
10fa36f0bc o in6_ifinfo() does not do any kvm(3) operations, so
do not guard it by WITH_KVM ifdef.  This allows to build
ifmcstat(8) without kvm(3) support.

PR:		bin/164353
Submitted by:	Ivan Rozhuk
MFC after:	2 weeks
2012-01-27 17:16:44 +00:00
Alexander Motin
19e79b284d Return proper error message if recording device is not specified.
MFC after:	1 week
2012-01-27 09:15:55 +00:00
Kenneth D. Merry
e6bd5983ca Add CAM infrastructure to allow reporting when a drive's long read capacity
data changes.

cam_ccb.h:	Add a new advanced information type, CDAI_TYPE_RCAPLONG,
		for long read capacity data.

cam_xpt_internal.h:
		Add a read capacity data pointer and length to struct cam_ed.

cam_xpt.c:	Free the read capacity buffer when a device goes away.
		While we're here, make sure we don't leak memory for other
		malloced fields in struct cam_ed.

scsi_all.c:	Update the scsi_read_capacity_16() to take a uint8_t * and
		a length instead of just a pointer to the parameter data
		structure.  This will hopefully make this function somewhat
		immune to future changes in the parameter data.

scsi_all.h:	Add some extra bit definitions to struct
		scsi_read_capacity_data_long, and bump up the structure
		size to the full size specified by SBC-3.

		Change the prototype for scsi_read_capacity_16().

scsi_da.c:	Register changes in read capacity data with the transport
		layer.  This allows the transport layer to send out an
		async notification to interested parties.  Update the
		dasetgeom() API.

		Use scsi_extract_sense_len() instead of
		scsi_extract_sense().

scsi_xpt.c:	Add support for the new CDAI_TYPE_RCAPLONG advanced
		information type.

		Make sure we set the physpath pointer to NULL after freeing
		it.  This allows blindly freeing it in the struct cam_ed
		destructor.

sys/param.h:	Bump __FreeBSD_version from 1000005 to 1000006 to make it
		easier for third party drivers to determine that the read
		capacity data async notification is available.

camcontrol.c,
mptutil/mpt_cam.c:
		Update these for the new scsi_read_capacity_16() argument
		structure.

Sponsored by:	Spectra Logic
2012-01-26 18:09:28 +00:00
Guy Helmer
704523b073 Revert 229667: After some discussion of this change, it seems it is
better to leave the pidfile open where it was. Add a note to the
man page describing pidfile strategies to use if the daemon is to
be run as a user other than root.
2012-01-25 14:50:12 +00:00
Hiroki Sato
a22ed494f8 Fix a SIGSEGV problem in directory entry renaming. 2012-01-25 07:45:15 +00:00
Nathan Whitehorn
090dd24636 Experimental support for booting CHRP-type PowerPC systems from hard disks. 2012-01-25 03:37:39 +00:00
Ed Maste
3129859c92 Clean up reinstall option and remove duplicate code
- Move the reinstall logic to be before menus are initialised
  (menus are not needed when reinstalling a zonefile).

- Remove unnecessary re-initialization of path_db.

- Update variable name and error message because we now use the
  zone name relative to /usr/share/zoneinfo, not the full path.

pr:		bin/164041
Submitted by:	Devin Teske <dteske vicor com>
MFC after:	1 week
2012-01-25 02:15:40 +00:00
Martin Matuska
d637f5bf9a Try resolving jail path with realpath(3).
jail(8) does a chdir(2) to the given path argument. Kernel evaluates the
jail path from the new cwd and not from the original cwd, which leads to
undesired behavior if given a relative path.

Reviewed by:	jamie
MFC after:	2 weeks
2012-01-24 08:04:38 +00:00
Eitan Adler
30d3283b15 Fix warning when compiling with gcc46:
error: variable 'clnt_stat' set but not used

Approved by:	dim, cperciva (mentor, blanket for pre-mentorship already-approved commits)
MFC after:	3 days
2012-01-20 01:39:26 +00:00
Eitan Adler
de879bdae9 Fix warning when compiling with gcc46:
error: variable 'flags' set but not used

Approved by:	dim, cperciva (mentor, blanket for pre-mentorship already-approved commits)
MFC after:	3 days
2012-01-20 01:39:16 +00:00
Eitan Adler
3688cbc221 Fix warning when compiling with gcc46:
error: variable 'a' set but not used

Approved by:	dim, cperciva (mentor, blanket for pre-mentorship already-approved commits)
MFC after:	3 days
2012-01-20 01:39:08 +00:00
Eitan Adler
335797f33e Fix warning when compiling with gcc46:
error: variable 'fd' set but not used

Approved by:	dim, cperciva (mentor, blanket for pre-mentorship already-approved commits)
MFC after:	3 days
2012-01-20 01:39:01 +00:00
Eitan Adler
e0ef7724c3 Fix warning when compiling with gcc46:
error: variable 'target' set but not used

Approved by:	dim, cperciva (mentor, blanket for pre-mentorship already-approved commits)
MFC after:	3 days
2012-01-20 01:38:52 +00:00
Eitan Adler
3f028229d9 Fix warning when compiling with gcc46:
error: variable 'i2c' set but not used

Approved by:	dim, cperciva (mentor, blanket for pre-mentorship already-approved commits)
MFC after:	3 days
2012-01-20 01:38:44 +00:00
Eitan Adler
43074f1626 Fix warning when compiling with gcc46:
error: variable 'parentrecnum' set but not used

Approved by:    dim, cperciva (mentor, blanket for pre-mentorship already-approved commits)
MFC after:      3 days
2012-01-20 01:38:35 +00:00
Eitan Adler
460c768f9a Fix a variety of warnings when compiling with gcc46
Approved by:	dim, cperciva (mentor, blanket for pre-mentorship already-approved commits)
MFC after:	3 days
2012-01-20 01:38:28 +00:00
Eitan Adler
92da524baa Fix warning when compiling with gcc46:
error: variable 'temp' set but not used

Approved by:	dim
Approved by:	cperciva (mentor, blanket for pre-mentorship already-approved commits)
MFC after:	3 days
2012-01-20 01:38:21 +00:00
Eitan Adler
e0bcf08675 Fix warning when compiling with gcc46:
error: variable 'dirp' set but not used
	error: variable 'dirplen' set but not used

Approved by:	dim, cperciva (mentor, blanket for pre-mentorship already-approved commits)
MFC after:	3 days
2012-01-20 01:38:12 +00:00
Eitan Adler
6240691ac7 Fix warning when compiling with gcc46:
error: variable 'now' set but not used

Approved by:	dim, cperciva (mentor, blanket for pre-mentorship already-approved commits)
MFC after:	3 days
2012-01-20 01:38:05 +00:00
Eitan Adler
831b96303a Fix warning when compiling with gcc46:
error: variable 'current_cpu' set but not used

Approved by:	dim, cperciva (mentor, blanket for pre-mentorship already-approved commits)
MFC after:	3 days
2012-01-20 01:37:56 +00:00
Eitan Adler
2bb133e752 Fix warning when compiling with gcc46:
error: variable 'len' set but not used

Approved by:	dim, cperciva (mentor, blanket for pre-mentorship already-approved commits)
MFC after:	3 days
2012-01-20 01:37:49 +00:00
Eitan Adler
e3febf407d Fix warning when compiling with gcc46:
error: variable 'extra_async_bytes' set but not used

Approved by:    dim, cperciva (mentor, blanket for pre-mentorship already-approved commits)
MFC After:	3 days
2012-01-20 01:37:39 +00:00
Eitan Adler
7268c7daff Fix warning when compiling with gcc46:
error: variable 'addrs' set but not used

Approved by:	dim
Approved by:	cperciva (mentor, blanket for pre-mentorship already-approved commits)
MFC After:	3 days
2012-01-20 01:37:31 +00:00
Eitan Adler
9840ec1752 Fix warning when compiling with gcc46:
error: variable 'hostname' set but not used

Approved by:	dim, cperciva (mentor, blanket for pre-mentorship already-approved commits)
MFC after:	3 days
2012-01-20 01:37:23 +00:00
Nathan Whitehorn
6fe359f292 Warn if trying to install over an existing partition, which usually fails
anyway due to libarchive not being able to overwrite schg flags.

PR:		bin/164278
MFC after:	4 days
2012-01-18 15:59:23 +00:00
Ed Maste
da4b02cf70 Fix #ifdef VERBOSE for UTC case
Update verbose output to match what actually happens when selecting
the UTC option, and when the -n option is used.

Patch updated slightly for new libdialog.

PR:		bin/164042
Submitted by:	Devin Teske <dteske vicor com>
MFC after:	2 weeks
2012-01-18 04:37:35 +00:00
Ed Maste
e202760872 Don't write /var/db/zoneinfo when zone is not actually changed.
If the specified zone file does not exist or the -n flag is specified,
do not update /var/db/zoneinfo.

PR:		bin/164039
Submitted by:	Devin Teske <dteske vicor com>
MFC after:	1 week
2012-01-18 04:12:32 +00:00
Ed Maste
b0ba9fbc47 Add missing line continuation \. It did not cause any issue because
the same path is already being included in ../Makefile.inc.

PR:		164192
Submitted by:	Devin Teske <dteske vicor com>
MFC after:	2 weeks
2012-01-18 02:44:22 +00:00
Hiroki Sato
b2870827a3 Revert changes in r228790. It prevented the ypserv daemon from working with
with multiple socktypes.
2012-01-17 20:39:33 +00:00
Jaakko Heinonen
d325001438 Change checkpath() to not exit on error. This is a prerequisite for
fixing the mount(8) "failok" option.

PR:		163668
Reviewed by:	Garrett Cooper, delphij (previous version)
2012-01-16 19:34:21 +00:00
Jung-uk Kim
c99b7c4e40 Remove unused ACPICA sources from userland makefiles. 2012-01-13 22:16:47 +00:00
Kevin Lo
b1c09bd5ff Fix copyright year
Spotted by:	pluknet
2012-01-13 09:08:41 +00:00
Kevin Lo
a3a2bf4b67 fgets(3) returns a pointer, so compare against NULL, not integer 0. 2012-01-13 06:51:15 +00:00
Garrett Wollman
8c261aeac3 Use a reasonable-sized buffer when formatting error messages about
installing zoneinfo.  While we're in the vicinity, add some missing
error checking to eliminate an unhelpful error message when unlink()
fails.

/me is embarrassed by the quality of his 16-year-old code.
The whole thing is awful and could stand a complete rewrite.

PR:		164038
Submitted by:	Devin Teske (but implemented differently)
2012-01-12 05:50:32 +00:00
Kenneth D. Merry
130f4520cb Add the CAM Target Layer (CTL).
CTL is a disk and processor device emulation subsystem originally written
for Copan Systems under Linux starting in 2003.  It has been shipping in
Copan (now SGI) products since 2005.

It was ported to FreeBSD in 2008, and thanks to an agreement between SGI
(who acquired Copan's assets in 2010) and Spectra Logic in 2010, CTL is
available under a BSD-style license.  The intent behind the agreement was
that Spectra would work to get CTL into the FreeBSD tree.

Some CTL features:

 - Disk and processor device emulation.
 - Tagged queueing
 - SCSI task attribute support (ordered, head of queue, simple tags)
 - SCSI implicit command ordering support.  (e.g. if a read follows a mode
   select, the read will be blocked until the mode select completes.)
 - Full task management support (abort, LUN reset, target reset, etc.)
 - Support for multiple ports
 - Support for multiple simultaneous initiators
 - Support for multiple simultaneous backing stores
 - Persistent reservation support
 - Mode sense/select support
 - Error injection support
 - High Availability support (1)
 - All I/O handled in-kernel, no userland context switch overhead.

(1) HA Support is just an API stub, and needs much more to be fully
    functional.

ctl.c:			The core of CTL.  Command handlers and processing,
			character driver, and HA support are here.

ctl.h:			Basic function declarations and data structures.

ctl_backend.c,
ctl_backend.h:		The basic CTL backend API.

ctl_backend_block.c,
ctl_backend_block.h:	The block and file backend.  This allows for using
			a disk or a file as the backing store for a LUN.
			Multiple threads are started to do I/O to the
			backing device, primarily because the VFS API
			requires that to get any concurrency.

ctl_backend_ramdisk.c:	A "fake" ramdisk backend.  It only allocates a
			small amount of memory to act as a source and sink
			for reads and writes from an initiator.  Therefore
			it cannot be used for any real data, but it can be
			used to test for throughput.  It can also be used
			to test initiators' support for extremely large LUNs.

ctl_cmd_table.c:	This is a table with all 256 possible SCSI opcodes,
			and command handler functions defined for supported
			opcodes.

ctl_debug.h:		Debugging support.

ctl_error.c,
ctl_error.h:		CTL-specific wrappers around the CAM sense building
			functions.

ctl_frontend.c,
ctl_frontend.h:		These files define the basic CTL frontend port API.

ctl_frontend_cam_sim.c:	This is a CTL frontend port that is also a CAM SIM.
			This frontend allows for using CTL without any
			target-capable hardware.  So any LUNs you create in
			CTL are visible in CAM via this port.

ctl_frontend_internal.c,
ctl_frontend_internal.h:
			This is a frontend port written for Copan to do
			some system-specific tasks that required sending
			commands into CTL from inside the kernel.  This
			isn't entirely relevant to FreeBSD in general,
			but can perhaps be repurposed.

ctl_ha.h:		This is a stubbed-out High Availability API.  Much
			more is needed for full HA support.  See the
			comments in the header and the description of what
			is needed in the README.ctl.txt file for more
			details.

ctl_io.h:		This defines most of the core CTL I/O structures.
			union ctl_io is conceptually very similar to CAM's
			union ccb.

ctl_ioctl.h:		This defines all ioctls available through the CTL
			character device, and the data structures needed
			for those ioctls.

ctl_mem_pool.c,
ctl_mem_pool.h:		Generic memory pool implementation used by the
			internal frontend.

ctl_private.h:		Private data structres (e.g. CTL softc) and
			function prototypes.  This also includes the SCSI
			vendor and product names used by CTL.

ctl_scsi_all.c,
ctl_scsi_all.h:		CTL wrappers around CAM sense printing functions.

ctl_ser_table.c:	Command serialization table.  This defines what
			happens when one type of command is followed by
			another type of command.

ctl_util.c,
ctl_util.h:		CTL utility functions, primarily designed to be
			used from userland.  See ctladm for the primary
			consumer of these functions.  These include CDB
			building functions.

scsi_ctl.c:		CAM target peripheral driver and CTL frontend port.
			This is the path into CTL for commands from
			target-capable hardware/SIMs.

README.ctl.txt:		CTL code features, roadmap, to-do list.

usr.sbin/Makefile:	Add ctladm.

ctladm/Makefile,
ctladm/ctladm.8,
ctladm/ctladm.c,
ctladm/ctladm.h,
ctladm/util.c:		ctladm(8) is the CTL management utility.
			It fills a role similar to camcontrol(8).
			It allow configuring LUNs, issuing commands,
			injecting errors and various other control
			functions.

usr.bin/Makefile:	Add ctlstat.

ctlstat/Makefile
ctlstat/ctlstat.8,
ctlstat/ctlstat.c:	ctlstat(8) fills a role similar to iostat(8).
			It reports I/O statistics for CTL.

sys/conf/files:		Add CTL files.

sys/conf/NOTES:		Add device ctl.

sys/cam/scsi_all.h:	To conform to more recent specs, the inquiry CDB
			length field is now 2 bytes long.

			Add several mode page definitions for CTL.

sys/cam/scsi_all.c:	Handle the new 2 byte inquiry length.

sys/dev/ciss/ciss.c,
sys/dev/ata/atapi-cam.c,
sys/cam/scsi/scsi_targ_bh.c,
scsi_target/scsi_cmds.c,
mlxcontrol/interface.c:	Update for 2 byte inquiry length field.

scsi_da.h:		Add versions of the format and rigid disk pages
			that are in a more reasonable format for CTL.

amd64/conf/GENERIC,
i386/conf/GENERIC,
ia64/conf/GENERIC,
sparc64/conf/GENERIC:	Add device ctl.

i386/conf/PAE:		The CTL frontend SIM at least does not compile
			cleanly on PAE.

Sponsored by:	Copan Systems, SGI and Spectra Logic
MFC after:	1 month
2012-01-12 00:34:33 +00:00
Jung-uk Kim
ec3fc72f94 Merge ACPICA 20120111. 2012-01-11 23:06:37 +00:00
Shteryana Shopova
b9288caaf6 Implement an option to execute SNMP walks using GETBULK requests in bsnmpwalk(1)
retrieving multiple values with a Single PDU.

Reviewed by:	philip@
Tested by:	tsanand129 (at) gmail (dot) com
2012-01-10 15:29:03 +00:00
Eitan Adler
2394cc2228 X11BASE has been deprecated for a long time and will die soon
Approved by:	x11 (eadler)
Approved by:	brucec
MFC after:	1 week
2012-01-09 00:48:19 +00:00
Guy Helmer
074db536b3 Allow daemon(8) to run pidfile_open() before relenquishing privileges
so pid files can be written in /var/run when started as root.

I do not expect this to cause any security issues, but if anyone objects
it could be easily reverted.

PR:		bin/159568
MFC after:	4 weeks
2012-01-05 22:48:36 +00:00
Ulrich Spörlein
389ae6c65d Touch up some more small typos missed in the previous round.
Reported by:	Ben Kaduk <minimarmot@gmail.com> et al.
2012-01-05 21:36:45 +00:00
Ulrich Spörlein
f7bcc1c411 Further fix a typo and spelling classic correctly in function names,
too.

Submitted by:	Ben Kaduk <minimarmot@gmail.com>
2012-01-05 21:36:36 +00:00
Ulrich Spörlein
b81da4450d Partial backout of r228990, restore original MIB object name.
It's too late to change this in 9.0 -- so we have a release with the
misspelling in the wild and should not break users that depend on it.

Deprecating/replacing it because of a one-char typo seems excessive.
2012-01-05 21:36:28 +00:00
Pawel Jakub Dawidek
9a492fd171 Add an missing argument to open(2). If O_CREAT flag is specified,
file permission has to be specified as well.
2012-01-04 07:21:37 +00:00
Pawel Jakub Dawidek
24bc5224c6 Add an missing argument to open(2). If O_CREAT flag is specified,
file permission has to be specified as well.
2012-01-04 07:04:43 +00:00
Ed Schouten
b3608ae18f Replace index() and rindex() calls with strchr() and strrchr().
The index() and rindex() functions were marked LEGACY in the 2001
revision of POSIX and were subsequently removed from the 2008 revision.
The strchr() and strrchr() functions are part of the C standard.

This makes the source code a lot more consistent, as most of these C
files also call into other str*() routines. In fact, about a dozen
already perform strchr() calls.
2012-01-03 18:51:58 +00:00
Ed Schouten
b589816c74 Fix subtle typo: compare against idx -- not index.
In this contest, index refers to the index(3) function. In this case it
doesn't really harm, as this function is never called with idx == NULL.

MFC after:	2 weeks
2012-01-03 11:10:15 +00:00
Ed Schouten
c70a327b9f Simply use getprogname() to obtain the name of the process. 2012-01-03 11:08:58 +00:00
Stefan Farfeleder
45360108f8 Fix typos in command descriptions. 2011-12-31 12:12:41 +00:00
Ulrich Spörlein
3df5ecac8c Spelling fixes for usr.sbin/ 2011-12-30 10:58:14 +00:00
Ulrich Spörlein
f76b319989 Reencode files to UTF-8. Drop CP1252 em-dash. 2011-12-30 00:59:08 +00:00
Xin LI
981dfb0965 - Fail when the utility is not invoked as rtprio nor idprio.
- use warnx() to tell the user whether a process is running in normal,
   idle or realtime priority. with the old code it would have been possible
   for another process to send data to stdout between
	printf("%s: ", p);
   and
	printf("* priority\n");
   and thus break the formatting.
 - 'rtprio 10 -0' triggeres non-intuitive behavior.  It would first set the
   priority of itself to 10 *and* would then try to execute '-0'. Of course,
   setting the priority of [id|rt]prio itself doesn't make a lot of sense,
   but it is intuitive compared to the previous behavior.
 - 'rtprio -t --1' will actually pass over the '-1' to rtprio().  Now
   invoking rtprio like this will catch the wrong usage before passing
   over the invalid argument to rtprio().
 - Garrett Cooper suggested to add further diagnostics where the failure
   occures, if execvp fails.

PR:		bin/154042
Submitted by:	arundel
MFC after:	1 month
2011-12-27 20:03:57 +00:00
Eitan Adler
19e1bf2997 - document the -l option to usermod
PR:		docs/161588
Submitted by:	"Luchesar V. ILIEV" <luchesar.iliev@gmail.com>
Approved by:	gjb
MFC after:	1 week
2011-12-22 03:36:54 +00:00
Eitan Adler
5bf8645b8d - Fix style(9) bug I introduced in the last commit
Approved by:	jhb
2011-12-21 20:47:24 +00:00
Eitan Adler
520374b5aa - Remove extraneous null ptr deref checks
- Fix memory leak

Submitted by:	Slono Slono <slonoman2011@yandex.ru>
Approved by:	jhb
MFC after:	1 week
2011-12-21 20:27:41 +00:00
John Baldwin
f9a0145857 Allow boot0cfg to force a PXE boot via boot0 on the next boot.
- Fix boot0 to check for PXE when using the pre-set setting for the
  preferred slice.
- Update boot0cfg to use slice 6 to select PXE.  Accept a 'pxe' argument
  instead of a number for the 's' option as a way to select PXE as well.

Submitted by:	Andrew Boyer  aboyer averesystems
MFC after:	2 weeks
2011-12-20 15:19:29 +00:00
Ed Schouten
55a1bde99c Small cleanups to panic() prototype.
- Let panic() use _Noreturn and __printflike() instead of GCC-specific
  attributes.
- Remove prototype from ffs_subr.c and let it include ffs_extern.h.
- Forward declare struct inode to make ffs_extern.h not depend on it.
2011-12-20 12:34:17 +00:00
Dimitry Andric
8a0e4ea185 In usr.sbin/yp_mkdb/yp_mkdb.c, cast some printf field width parameters
to int, cast time_t to intmax_t, and use the corresponding printf length
modifier.

MFC after:	1 week
2011-12-19 20:44:44 +00:00
Dimitry Andric
5eeae9a725 In usr.sbin/uhsoctl/uhsoctl.c, fix a few warnings about format strings
not being literals.

MFC after:	1 week
2011-12-19 20:38:26 +00:00
Dimitry Andric
5c67a2799c Fix r228719; when you use intmax_t, you need stdint.h.
Pointy hat to:	dim
MFC after:	1 week
2011-12-19 20:33:53 +00:00
Dimitry Andric
655353a78c Some people pointed out long is 32-bit on some arches, while time_t is
64-bit, so better cast time_t to intmax_t, and use the appropriate
printf format strings.

MFC after:	1 week
2011-12-19 20:29:50 +00:00
Dimitry Andric
ad5b59d82c In usr.sbin/timed, fix several issues with printf formats:
- Cast time_t's to long, and print them with %ld.
- Print ptrdiff_t's with %td.
- Print ssize_t's and size_t's with %zd and %zu.
- Print int32_t's with %d.
Also, replace some int variables with the more appropriate size_t.

MFC after:	1 week
2011-12-19 18:08:31 +00:00
Dimitry Andric
136fb141c6 Unfortunately, clang gives warnings about sendmail code that cannot be
turned off yet.  Since this is contrib code, and we don't really care
about the warnings, just turn make them non-fatal for now.

MFC after:	1 week
2011-12-19 13:35:44 +00:00
Dimitry Andric
b134560923 Forgot to add usr.sbin/sade/label.c in the previous commit.
MFC after:	1 week
2011-12-18 01:14:38 +00:00
Dimitry Andric
7b910e702a In usr.sbin/sade/install.c and usr.sbin/sade/label.c, fix a few warnings
about format strings not being literals.

MFC after:	1 week
2011-12-18 01:13:21 +00:00
Dimitry Andric
4c14050c9d In usr.sbin/sa/db.c, avoid warnings about assigning two const char
arrays to non-const void pointers, by casting away const explicitly.

MFC after:	1 week
2011-12-18 01:08:25 +00:00
Dimitry Andric
0af4e80ae5 In usr.sbin/rpc.ypupdated/yp_dbupdate.c, since intmax_t is signed, just
like time_t, better use %jd instead of %ju.  Strangely enough, neither
gcc, clang nor gcc 4.6 warn about this discrepancy...

MFC after:	1 week
2011-12-18 00:55:46 +00:00
Dimitry Andric
ae1d153674 In usr.sbin/rpc.ypupdated/yp_dbupdate.c, include stdint.h, so intmax_t
is known, otherwise it won't build.

Pointy hat to:	dim
MFC after:	1 week
2011-12-18 00:44:59 +00:00
Dimitry Andric
7027737f5a In usr.sbin/rpc.ypupdated/yp_dbupdate.c, use the appropriate printf
length modifier for time_t (after casting it to intmax_t).

MFC after:	1 week
2011-12-18 00:40:30 +00:00
Dimitry Andric
2214781145 In usr.sbin/route6d/route6d.c, use the correct printf length modifier
for an ssize_t.

MFC after:	1 week
2011-12-18 00:03:03 +00:00
Dimitry Andric
5893527d84 In usr.sbin/pw/pw_user.c, use the correct printf length modifier for a
ptrdiff_t.

MFC after:	1 week
2011-12-17 23:46:47 +00:00
Dimitry Andric
e2d0cd59c3 In usr.sbin/pmccontrol/pmccontrol.c, fix a few warnings about format
strings not being literals.

MFC after:	1 week
2011-12-17 23:39:13 +00:00
Dimitry Andric
9a3df8edd1 In usr.sbin/pkg_install/updating/main.c, use the size of the destination
buffer as size argument to strlcpy(), not the length of the source.

MFC after:	1 week
2011-12-17 23:35:46 +00:00
Dimitry Andric
b41349deef Use NO_WCAST_ALIGN for usr.sbin/ndiscvt; because this is only built for
x86, any alignment warnings can be safely ignored.  Define YY_NO_INPUT
in usr.sbin/ndiscvt/inf-token.l, so no unused lex functions are defined.

MFC after:	1 week
2011-12-17 22:16:27 +00:00
Dimitry Andric
97fbdc11ea In usr.sbin/lpr/lpd/printjob.c, use the correct printf length modifiers
for off_t (aka int64_t).

MFC after:	1 week
2011-12-17 22:05:28 +00:00
Dimitry Andric
7ae1a27825 In usr.sbin/lpr/filters/lpf.c, use a less obtuse way of clearing the
buffer, that also avoids warnings.

MFC after:	1 week
2011-12-17 21:37:21 +00:00
Dimitry Andric
740885817c In usr.sbin/keyserv, fix some implicit enum conversions, and use the
correct printf length modifiers for uid_t.

MFC after:	1 week
2011-12-17 20:53:06 +00:00
Dimitry Andric
cfed15e6c5 In usr.sbin/iostat/iostat.c, use printf format specifiers from
inttypes.h for u_int64_t's.  While here, sort #include directives.

MFC after:	1 week
2011-12-17 20:25:23 +00:00
Dimitry Andric
928e797dc0 In usr.sbin/i2c/i2c.c, fix a few warnings about format strings not being
literals.

MFC after:	1 week
2011-12-17 20:12:17 +00:00
Dimitry Andric
e0c518be94 In usr.sbin/ctm/ctm_dequeue/ctm_dequeue.c, cast a printf field width
parameter to int.

MFC after:	1 week
2011-12-17 20:07:42 +00:00
Dimitry Andric
5207dac8ba Use NO_WCAST_ALIGN for usr.sbin/cpucontrol; because this is only built
for x86, any alignment warnings can be safely ignored.

MFC after:	1 week
2011-12-17 19:58:48 +00:00
Dimitry Andric
1605515d77 In usr.sbin/bsnmpd/modules/snmp_wlan/wlan_snmp.h, use the correct
enumeration types for the mesh_peering and mesh_forwarding members of
struct wlan_iface, to fix enum conversion warnings.

MFC after:	1 week
2011-12-17 19:53:08 +00:00
Dimitry Andric
14fa6dc403 Use NO_WCAST_ALIGN for usr.sbin/boot0cfg; because this is only built for
x86, any alignment warnings can be safely ignored.

MFC after:	1 week
2011-12-17 19:33:26 +00:00
Dimitry Andric
98e0f284ba In usr.sbin/bluetooth/sdpd/server.c, don't use the size of a pointer as
the length argument to memset, but the size of the object pointed to.

MFC after:	1 week
2011-12-17 19:26:03 +00:00
Ed Schouten
4d9a3537ff Add missing static and const keywords to kbdcontrol.
None of the symbols provided by kbdcontrol.c are used by other source
files of this binary. Slightly reduce the binary size and make much more
symbols read-only by adding proper static and const keywords.
2011-12-12 12:33:38 +00:00
Fabien Thomas
96ff3b75d4 Add VIA microde update support to cpuctl(4) and cpucontrol(8).
Support have been tested with X2 CPU and QuadCore CPU.

MFC after:	1 month
2011-12-12 12:30:44 +00:00
Ed Schouten
3be02c20ca Add static keywords to vidcontrol(1).
While there, remove the false optimisation of the colors array. It seems
that changing it to an array of pointers instead of a 16x16 array does
not cause any increase in binary size at all.
2011-12-11 21:02:33 +00:00
Ed Schouten
e120624d32 Add missing static keyword.
All global variables and functions in powerd are marked static, except
this array of strings. Add the keyword, for consistency.
2011-12-11 19:22:42 +00:00
Ed Schouten
516c8ed9dd Replace char copyright[] by static const char copyright[].
It seems the latter is used throughout the tree.
2011-12-10 18:11:06 +00:00
John Baldwin
1b202316ec Use the correct volume identifier field when parsing MR_EVT_ARG_LD_STRIP
arguments.

MFC after:	2 weeks
2011-12-05 15:11:35 +00:00
Nathan Whitehorn
6081c922d2 Prevent user astonishment by providing the shell option at the end, after
any installer-provided configuration files have been copied. This allows
users to edit their fstab, if desired, and to see what the installer has
placed in rc.conf.

Requested by:	phk
MFC after:	1 day
2011-12-02 02:05:26 +00:00
Ken Smith
9cd86fa6ba Add a screen that asks if the user would like to enable crash dumps,
giving them a very brief description of the trade-offs.  Whether the
user opts in or out add an entry to what will become /etc/rc.conf
explaining what dumpdev is and how to turn on/off crash dumps.  The folks
who handle interacting with users submitting PRs have asked for this.

Reviewed by:	nwhitehorn
MFC after:	1 day
2011-12-02 00:38:47 +00:00
Max Khon
fcc050e759 Sync xdialog_menu() implementation with sade. 2011-12-01 09:02:57 +00:00
Max Khon
0f94127a5b Fix dialog autosizing: dlg_count_columns() does not handle NL characters. 2011-12-01 09:01:51 +00:00
Max Khon
d28e8f62e8 Generate ${NORMAL_CTFCONVERT} invocation without '@' modifier:
- ${NORMAL_CC} is also invoked without '@'
- Userland CTF support was changed previously to echo ctfconvert invocations too
2011-11-30 13:33:09 +00:00
Doug Barton
878c6432be If using DISTDIR we need to be sure to create a ${DESTDIR}/var/db/zoneinfo
PR:		bin/162891
Submitted by:	Helge Oldach <src-mergemaster-nov11@oldach.net>
2011-11-29 08:22:12 +00:00
Xin LI
6dc3afae75 In build_volume(), check if arrays is allocated before traversing its
items.  While parsing the arrays input, it's possible that we reach the
error path before initializing the 'arrays' pointer, which in turn leads
to a NULL deference.

Submitted by:	Garrett Cooper
MFC after:	1 week
2011-11-29 08:16:14 +00:00
Jung-uk Kim
3f0275a033 Merge ACPICA 20111123. 2011-11-28 23:36:48 +00:00
Kevin Lo
c725e3ef7a Plug memory leaks and fix open(2) error check.
Reviewed by:	nwhitehorn
MFC after:	3 days
2011-11-28 05:34:16 +00:00
Warren Block
df799cbad3 Point out that @reboot runs at every cron startup, not just system
startup.

Discussed on:	hackers@

Approved by:	gjb (mentor)
MFC after:	1 week
2011-11-25 17:41:12 +00:00
Max Khon
320baf06b8 Remove DEBUG_FLAGS. 2011-11-25 07:10:59 +00:00
Max Khon
8396c7de45 calloc +1 DIALOG_LISTITEM to prevent possible wild pointer access
in dlg_default_listitem().
2011-11-24 18:45:23 +00:00
Max Khon
166a0ada4e Port to new libdialog. 2011-11-24 18:37:16 +00:00
Max Khon
246864a52b Disk selection dialog is now a normal menu, not a checkboxed menu:
checkboxed menu is confusing and also can not be implemented
in new libdialog.
2011-11-24 15:47:01 +00:00
Max Khon
3567b2c445 Port to new libdialog. 2011-11-24 13:24:06 +00:00
Max Khon
9265b03823 Remove unused code. 2011-11-24 10:08:22 +00:00
Max Khon
23c64763a9 Remove unused code. 2011-11-24 08:56:24 +00:00
Max Khon
2dc3da8c3f Remove unused functions. 2011-11-23 19:11:03 +00:00
Max Khon
66b007568a - Remove unused old libdialog includes
- Remove unused functions
2011-11-23 19:06:30 +00:00
Ed Maste
f1e7af36c0 Avoid double free creating a new RAID with invalid command line arguments.
Submitted by:	Xin Huang <xhuang sandvine com>
Reviewed by:	rstone@
MFC after:	1 week
2011-11-23 17:02:27 +00:00
Kevin Lo
de028133d4 Plug fd leaks 2011-11-23 10:27:18 +00:00
David E. O'Brien
d6b6324f02 KNF 2011-11-15 06:50:10 +00:00
David E. O'Brien
37d6f8a9e6 Improve the chances of matching an outputted string with the line of code. 2011-11-15 06:44:07 +00:00
Eitan Adler
3b6dc18ef5 - fix duplicate "a a" in some comments
Submitted by:	eadler
Approved by:	simon
MFC after:	3 days
2011-11-13 17:06:33 +00:00
Alfred Perlstein
c13b66c053 Fix spelling of extract.
Pointed out by: gcooper
2011-11-13 06:39:49 +00:00
Alfred Perlstein
d1982439b2 Utilize shell's IFS instead of forking ~6 processes to
handle splitting input files on a '|'.  This greatly
reduces the time taken to process several databases
during the update process.

Additionally add some more debug logging.
2011-11-13 03:18:57 +00:00
Ed Maste
574280af1a Report the amount of memory from smbios data if provided.
This should get the correct memory size even if a 32-bit image is running
on a machine with > 4GB of memory.  This can be useful is using a 32-bit
installer on a machine which will eventually run a 64-bit image.

Reviewed by:	kmoore
2011-11-12 19:02:55 +00:00
Eitan Adler
14517324d0 - add a missing "be" and "in"
- fix other errors introduced when committing r226436
- add 'function' to a sentence where it makes sense

Submitted by:	delphij
Submitted by:	dougb
Submitted by:	jhb
Approved by:	dougb
Approved by:	jhb
2011-11-11 22:27:09 +00:00
Ryan Stone
2e0aa47581 The generated Makefile for the kernel was not running ctfconvert on
object files corresponding to source files that had the compile-with
option set in conf/files.  This means that any fbt probes for functions
in that object file would not have correct argument types.

The fix is to run ctfconvert on any target file that does not have the
no-obj option set in files.

PR:		bin/160275
Reported by:	Paul Ambrose (ambrosehua AT gmail DOT com)
MFC after:	1 week
2011-11-10 21:07:14 +00:00
Josh Paetzel
6376caed8e Welcome the initial patches for OSX bootcamp support!!!
This should let you select the ada0p3 hybrid MBR/GPT partition, and do an installation to it.

Approved by:	kib (mentor)
Obtained from:	kris@pcbsd.org
MFC after:	3 days
2011-11-08 23:44:26 +00:00
Andrey V. Elsukov
2a9cd9b3a1 Remove a note about disabling of GEOM protection mechanism.
boot0cfg should work without such hack.

MFC after:	3 days
2011-11-07 09:29:10 +00:00
Andrey V. Elsukov
7411f128dd Reorganize write_mbr() function to be able write bootcode with different
ways. Improve error reporting and also fix indenting.
Now we are trying to write bootcode:
 1. Directly to provider (if we can open it for writing);
 2. Via GEOM_PART (if it is available);
 3. Via GEOM_MBR.

MFC after:	2 weeks
2011-11-07 09:21:18 +00:00
Andrey V. Elsukov
395a625c6d Add reference to gpart(8).
MFC after:	3 days
2011-11-06 20:42:32 +00:00
Ed Schouten
3a01367a9b Mark global functions and/or variables in spray(8) static where possible.
This allows compilers and static analyzers to do more thorough analysis.
2011-11-06 19:02:49 +00:00
Ed Schouten
f69e32f1cd Mark global functions and/or variables in snapinfo(8) static where possible.
This allows compilers and static analyzers to do more thorough analysis.
2011-11-06 19:02:43 +00:00
Ed Schouten
0aa42e81b2 Mark global functions and/or variables in rmt(8) static where possible.
This allows compilers and static analyzers to do more thorough analysis.
2011-11-06 19:02:37 +00:00
Ed Schouten
d1931b8065 Mark global functions and/or variables in rip6query(8) static where possible.
This allows compilers and static analyzers to do more thorough analysis.
2011-11-06 19:02:31 +00:00
Ed Schouten
4da4d0013d Mark global functions and/or variables in pwd_mkdb(8) static where possible.
This allows compilers and static analyzers to do more thorough analysis.
2011-11-06 19:02:25 +00:00
Ed Schouten
7a106fe473 Mark global functions and/or variables in moused(8) static where possible.
This allows compilers and static analyzers to do more thorough analysis.
2011-11-06 19:02:20 +00:00
Ed Schouten
4d4fda8051 Mark global functions and/or variables in mixer(8) static where possible.
This allows compilers and static analyzers to do more thorough analysis.
2011-11-06 19:02:13 +00:00
Ed Schouten
6ea612c7ab Mark global functions and/or variables in memcontrol(8) static where possible.
This allows compilers and static analyzers to do more thorough analysis.
2011-11-06 19:01:59 +00:00
Ed Schouten
d938340a93 Mark global functions and/or variables in fdread(8) static where possible.
This allows compilers and static analyzers to do more thorough analysis.
2011-11-06 19:01:54 +00:00
Ed Schouten
e8f386b409 Mark global functions and/or variables in devinfo(8) static where possible.
This allows compilers and static analyzers to do more thorough analysis.
2011-11-06 19:01:48 +00:00
Ed Schouten
d35fcc6826 Mark global functions and/or variables in chown(8) static where possible.
This allows compilers and static analyzers to do more thorough analysis.
2011-11-06 19:01:41 +00:00
Ed Schouten
e052b60b87 Mark global functions and/or variables in boot0cfg(8) static where possible.
This allows compilers and static analyzers to do more thorough analysis.
2011-11-06 19:01:35 +00:00
Ed Schouten
6f344d60d5 Mark global functions and/or variables in apm(8) static where possible.
This allows compilers and static analyzers to do more thorough analysis.
2011-11-06 19:01:30 +00:00
Ed Schouten
ee47d09921 Make all functions and global variables static for cdcontrol(8).
While there, replace __const by const, which seems to be our preference
nowadays. Also fix some style(9) bugs by adding newlines and removing
unneeded spaces from function declarations.
2011-11-06 16:52:26 +00:00
Ed Schouten
60bd06dafc Mark all global variables static for mptable(1).
While there, remove basetableEntryTypes, which became unused in r71209.
2011-11-06 16:47:50 +00:00
Ed Schouten
4c46bfb6dc Eliminate global variables.
There is no reason why these three variables should be declared as
global variables, while the others aren't. They are only used inside
main().
2011-11-06 16:40:17 +00:00
Ed Schouten
acd29a915f Simplify inclusion of the tsptype array a bit.
We don't need this array in timed.c -- only readmsg.c.
2011-11-06 16:37:15 +00:00
Josh Paetzel
e4985e44df Roll up several patches used by PC-BSD.
- Fix an issue with gmirror.
- Allow IPv4 DHCP and IPv6 SLAAC concurrently.
- Fix zpool options using the wrong device name.

Approved by:	kib (mentor)
Obtained from:	kris@pcbsd.org
MFC after:	3 days
2011-11-05 19:25:21 +00:00
Doug Barton
b90270a146 1. Add a new option, --run-updates, to always or never run the newalises,
pwd_mkdb, etc. updates at the end of the comparison.

2. Add an update to the end to handle /etc/localtime, if it exists.
   If /var/db/zoneinfo exists, automatically update /etc/localtime,
   which should (hopefully) be safe to do. If not, prompt the user
   to run tzsetup.

3. Update run_it_now(), the function that handles input for the updates,
   to make sure that we got a valid answer, and to handle the --run-updates
   option if supplied.
2011-11-02 07:40:23 +00:00
Doug Barton
983ac1b7fc If the user is moving from any other time zone to UTC we need
to delete any old /var/db/zoneinfo file that may exist so that
tzsetup -r does the right thing.
2011-11-02 04:21:20 +00:00
Fabien Thomas
66ce99369a Two bugs fixed:
- Do not close stdout or stderr when redirecting to file.
- Correctly handle error code to detect when no buffer available.

MFC after:	1 month
2011-11-01 09:28:47 +00:00
Nathan Whitehorn
41f2f866d0 Provide an error message and error handling if there are no network
interfaces in the system. This is a non-fatal error except when doing a
network installation.

PR:		bin/161950
MFC after:	3 days
2011-10-25 16:35:48 +00:00
Nathan Whitehorn
07d7662678 Provide an error message instead of silent failure if no disks are present
in the system.

PR:		bin/161950
MFC after:	3 days
2011-10-25 16:30:16 +00:00
Gleb Smirnoff
b8e20190a3 Protect NIS server with madvise(2) since this daemon is required
for succesful authentication of users.
2011-10-25 10:33:26 +00:00
Andrey V. Elsukov
9f772ce219 Fix argument name. This fixes EINVAL when boot0cfg uses GEOM_PART'
control interface.

MFC after:	3 days
2011-10-25 04:15:45 +00:00
Xin LI
5b1fd5dbbf Staticify elide_root() for now to fix build. 2011-10-24 21:38:25 +00:00
Ed Maste
6f8193d2c4 Avoid printing // for packages that install to /
I have some packages that install to / (for whatever reason).  Right now we
print entries of the form //path/to/file when listing files (pkg_info -L,
pkg_info -g etc.)  This change avoids printing the redundant / .
2011-10-24 18:29:50 +00:00
Gleb Smirnoff
5838507bd7 Protect NIS client with madvise(2) since this daemon is required
for succesful authentication of users.
2011-10-24 14:35:31 +00:00
Ivan Voras
1c4edd12cd Apparently, "ada" drives are better treated similarly to "da" drives. 2011-10-24 12:59:39 +00:00
Ivan Voras
9601613ecd It seems that the warning is much less severe than its message says. The
device is certainly added to the list after the first pass.
2011-10-24 12:43:20 +00:00
Ivan Voras
e9e42921af Fix typo
MFC after:	1 month
2011-10-24 12:21:58 +00:00
Nathan Whitehorn
987415b113 Avoid some "Invalid argument" errors in the installer.
PR:		bin/161926
MFC after:	5 days
2011-10-23 16:57:10 +00:00
Colin Percival
97d4be7ebc Add '%' and '@' to the set of characters which can appear in path names.
Without this change, freebsd-update refuses to accept 9.0 metadata files.
2011-10-23 06:23:11 +00:00
Fabien Thomas
dceed24a7c Add a flush of the current PMC log buffer before displaying the next top.
As the underlying block is 4KB if the PMC throughput is low the measurement
will be reported on the next tick. pmcstat(8) use the modified flush API to
reclaim current buffer before displaying next top.

MFC after:	1 month
2011-10-18 15:25:43 +00:00
Ken Smith
22a84ec9b9 Escape the newline so we get a proper line continuation. Without this
the text of the menu selections doesn't get displayed properly and it
makes the installer appear to lock up for no obvious reason.

Reviewed by:	nwhitehorn
2011-10-18 11:29:10 +00:00
Eitan Adler
6b15a26aa6 - remove device keyword from makefs manpage
PR:		docs/144408
Submitted by:	gcooper
Approved by:	gjb
Approved by:	sahil (mentor)
MFC after:	1 week
2011-10-17 21:31:03 +00:00
Hans Petter Selasky
6a3b2e7773 Make the usbdump utility work again by using the correct BPF structures.
MFC after:	3 days
2011-10-17 15:54:20 +00:00
Nathan Whitehorn
5d920ef704 Place quotes around the output of kbdmap(1), designed to be pasted into
/etc/rc.conf.

PR:		bin/161711
Submitted by:	manolis
MFC after:	1 week
2011-10-16 16:05:23 +00:00
Eitan Adler
36daf0495a - change "is is" to "is" or "it is"
- change "the the" to "the"

Approved by:	lstewart
Approved by:	sahil (mentor)
MFC after:	3 days
2011-10-16 14:30:28 +00:00
Craig Rodrigues
8d1a3b6998 Add a "kern.features.ata_cam" sysctl in the kernel when the ATA_CAM kernel
option is defined.  This sysctl can be queried by feature_present(3).

Query for this feature in /sbin/atacontrol and /usr/sbin/burncd.
If these utilities detect that ATA_CAM is enabled, then these utilities
will error out.  These utilities are compatible with the old ATA
driver, but are incomptible with the new ATA_CAM driver.  By erroring out,
we give end-users an idea as to what remedies to use, and reduce the need for them
to file PR's.  For atacontrol, camcontrol must be used instead,
and for burncd, alternative utilties from the ports collection must be used
such as sysutils/cdrtools.

In future, maybe someone can re-write burncd to work with ATA_CAM,
but at least for now, we give a somewhat useful error message to end users.

PR:		160979
Reviewed by:	jh, Arnaud Lacombe <lacombar at gmail dot com>
Reported by:	Joe Barbish <fbsd8 at a1poweruser dot com>
MFC after:	3 days
2011-10-09 21:42:02 +00:00
Nathan Whitehorn
703d6e3e8d Add support to makefs(8) to add UFS labels to images.
Submitted by:	avg
MFC after:	3 days
2011-10-09 16:22:31 +00:00
Nathan Whitehorn
7899c6c10f Avoid magicking into existence sub-partitions due to leftover blocks when
creating new ones by destroying any geom that may have come into
existence immediately after adding a partition. The EBR partition scheme
is particularly enthusiastic about false positives in this case.

MFC after:	3 days
2011-10-08 16:45:03 +00:00
Nathan Whitehorn
a780c996f4 Usability enhancements: do not allow setting a mountpoint on bsdlabel
container partitions, which didn't do anything anyway, and check for
an existing freebsd-boot partition before bothering the user to make one.

PR:		bin/160931
MFC after:	3 days
2011-10-08 14:59:12 +00:00
Nathan Whitehorn
f36a5e0f34 Work around some behavior of gpart that I absolutely do not understand in
order to make every operation of the partition editor fully revertable.
Under *no circumstances* will it any longer touch the disks until the user
presses Finish and confirms it.

MFC after:	3 days
2011-10-07 01:40:30 +00:00
Nathan Whitehorn
ab9a96be12 Move "Exit" to the first entry in the list, so that it is the default
choice.

PR:		bin/160913
MFC after:	3 days
2011-10-06 14:24:37 +00:00
Nathan Whitehorn
77d0854ba5 Ask if you want to set the keymap before invoking kdbmap to prevent
confusion.

PR:		bin/160913
MFC after:	3 days
2011-10-06 14:22:38 +00:00
Jilles Tjoelker
b77e3cbad1 portsnap: Detect error immediately if we can't fetch the snapshot metadata.
Also add some quotes around command substitution where useful and possible.

Reviewed by:	cperciva
MFC after:	1 week
2011-10-04 22:28:06 +00:00
Nathan Whitehorn
e59e2d8ec7 Farewall, sysinstall! You served us well for many years, but 10.0 is one
digit beyond your time.

Various sysinstall dependencies (e.g. libftpio, libdisk, libodialog, etc.)
will be cleaned up in coming days. Some will take longer than others due to
a few other consumers (tzsetup and sade).
2011-10-03 15:13:09 +00:00
Ed Schouten
9f365aa1d6 Get rid of major/minor number distinction.
As of FreeBSD 6, devices can only be opened through devfs. These device
nodes don't have major and minor numbers anymore. The st_rdev field in
struct stat is simply based a copy of st_ino.

Simply display device numbers as hexadecimal, using "%#jx". This is
allowed by POSIX, since it explicitly states things like the following
(example taken from ls(1)):

	"If the file is a character special or block special file, the
	size of the file may be replaced with implementation-defined
	information associated with the device in question."

This makes the output of these commands more compact. For example, ls(1)
now uses approximately four columns less. While there, simplify the
column length calculation from ls(1) by calling snprintf() with a NULL
buffer.

Don't be afraid; if needed one can still obtain individual major/minor
numbers using stat(1).
2011-09-28 18:53:36 +00:00
Ed Maste
b08d3049f0 Improve battery capacity reporting
When a status pointer is passed in mfi_dcmd_command does not return an
errno (if the ioctl is successful), so move the test for NO_HW_PRESENT
outside of the error case.  This should fix incorrect reporting for
systems with a dead or no battery.

Additionally, handle error codes other than NO_HW_PRESENT by omitting
the battery capacity display.  LSI's supercap-based parts (CV series)
report their data using the same interface as battery-based parts,
except that they do not include the capacity stats (state of charge,
cumulative charge cycles, etc.)

Reviewd by:   jhb, bz
Tested by:    pluknet@, Garrett Cooper
PR:           bin/160581
MFC after:    1 week
2011-09-27 14:28:07 +00:00
Ken Smith
8a3b6cc1e1 Shift head from 9.0-CURRENT to 10.0-CURRENT in preparation for releasing
it from the 9.0-RELEASE release cycle code freeze.

Approved by:	re (implicit)
2011-09-26 02:27:04 +00:00
Hiroki Sato
8cdd0a8091 Remove RA timer on an interface with !IFF_UP actively after starting to send
clean-up RA messages for shutting down.  The RA timers could prevent the rtadvd
daemon from shutting down because ra_output() just ignored !IFF_UP interfaces
and TRANSITIVE->UNCONFIGURED state transition never happened due to it.

Spotted by:	kib
Approved by:	re (bz)
2011-09-20 00:32:30 +00:00
Josh Paetzel
c49e3f837c Fix a logic bug in pc-sysinstall creating partitions.
Improve exit when an error occurs.
Fix parsing to grab values which contain extra '=' signs.
Fix a bug setting the timezone properly.
Fix a usage bug when setting up with gmirror.
Allow a uzip file from local media to be used.
Allow specifying flags for "newfs" when using UFS as the file system.
Run custom commands after doing final cleanup / fstab generation
and such. Also fix using relative path for config file.

Approved by:	re (bz)
2011-09-19 05:12:53 +00:00
Nathan Whitehorn
6d02d4cbc5 Inquire about terminal type if starting from a serial console and do
not configure the host's networking if netbooted [1]. Also fix FTP
installations behind some firewalls [2].

PR:		bin/159583 [2]
Reported by:	stas [1]
Approved by:	re (kib)
2011-09-17 09:25:45 +00:00
Nathan Whitehorn
0d49c6d5c1 Fix a typo introduced in r219892 that prevented file system options from
being set correctly.

Approved by:	re (kib)
2011-09-16 09:38:01 +00:00
Nathan Whitehorn
3d50f9421e Fix WPA setup broken by changes to shell argument passing inside the
installer network configuration.

PR:		bin/159558
Approved by:	re (kib)
2011-09-16 09:37:13 +00:00
Sergey Kandaurov
566dafa360 Print the package name on deletion errors.
It appears this was already done in NetBSD a decade ago, hence
I just reuse the change (except our code is bad styled).

PR:		bin/160516
Approved by:	portmgr
Approved by:	re (kib)
Obtained from:	NetBSD
2011-09-16 09:09:58 +00:00
Christian Brueffer
a4de89de11 Allow WPA PSKs up to 63 characters, the max length according to
wpa_supplicant.conf(5).  Up to now, the PSK was truncated
to 15 characters (the length of the input field).

PR:		159559
Submitted by:	Gavin Chappell <gavin.chappell@gmail.com>
Approved by:	re (kib)
2011-09-13 21:39:26 +00:00
Hiroki Sato
489e04d0da - Add ":origin" label to the interface id for resolvconf(8). (r223149)
- Add -u option to enable adding :[RA-source-address] to the interface id.
  (r223149)
- s/INET6_ADDRSTRLEN/sizeof(ntopbuf)/  (r223149)
- Fix a bug that can prevent -D from being overridden by -d. (r223149)
- /-P pidfile/-p pidfile/ for consistency with rtadvd(8). (r223149)
- Fix -F flag handling to support receiving RAs even when ip6.forwarding=1.
  (r225150)

Approved by:	re (kib)
2011-09-12 23:55:23 +00:00
Hiroki Sato
aed378729e - Fix a bug that can lead to displaying an incorrect value. (r224210)
- Fix an abnormal termination caused by twice of "rtadvctl disable". (r224303)
- Use poll() to wait for the control message socket instead of a spin loop.
  (r224304)
- s/cmsg_/cm_/ to avoid conflict with CMSG_* symbols for struct cmsghdr.
  (r224619)
- Ignore an interface that never sent RAs for graceful shut-down. (r224620)
- Refine log messages. (r225148)
- Fix SIGSEGV when receiving RAs that contain RDNSS and/or DNSSL options.
  (r225149)

Approved by:	re (kib)
2011-09-12 23:52:55 +00:00
Christian Brueffer
c9c00408c5 Add ftp4.se.freebsd.org to the IPv4 and IPv6 mirror lists.
PR:		157210, 157211
Submitted by:	Niclas Zeising <zeising@lysator.liu.se>
Approved by:	re (kib)
2011-09-10 09:40:00 +00:00
Bjoern A. Zeeb
092b5f7c3f Correct a typo.
Submitted by:	gcooper
Reviewed by:	nwhitehorn
Approved by:	re (kib)
2011-09-07 00:48:58 +00:00
Bjoern A. Zeeb
5b046b47ec Fix two problems:
1) if no default gateway is given the route command will fail
   and the script will abort with an error leading to an endless
   loop unless configuration is cancelled or changed. [1]
2) In the IPv6 case add -inet6 to not alter the legacy IP default
   route.

Reported by:	Oleg Ginzburg (olevole olevole.ru) [1]
Tested by:	Oleg Ginzburg (olevole olevole.ru) [1]
Approved by:	re (kib)
2011-09-07 00:45:15 +00:00
Doug Barton
6fae67da24 Upgrade to BIND version 9.8.1. Release notes at:
https://deepthought.isc.org/article/AA-00446/81/
or
/usr/src/contrib/bind9/

Approved by:	re (kib)
2011-09-03 07:13:45 +00:00
John Baldwin
2e5df98a18 Move the logic to parse volume cache commands out into a separate function
and use a loop so that multiple cache commands can be strung together on
the command line into a single update to the volume's properties.

Reviewed by:	bz
Approved by:	re (kib)
MFC after:	1 week
2011-09-02 16:00:51 +00:00
Nathan Whitehorn
f68ebb0eec Swap FTP paths to be MACHINE/MACHINE_ARCH instead of MACHINE_ARCH/MACHINE.
This follows what the output of make targets looks like, and reduces the
number of directories needed on the FTP server, since we now have only one
architecture with multiple machine types (i386, which has i386 and pc98),
but 3 machines with 9 architectures between them (powerpc, mips, and arm).

Requested by:	kensmith, bz
Approved by:	re(kensmith)
2011-08-30 18:23:36 +00:00
Bjoern A. Zeeb
64371599f0 If a drive is not part of the array (i.e. missing) we need to print the
new line after the pd state information as well, so move it to the outside
of the block.

Submitted by:	Mark Johnston at Sandvine Inc
MFC atfer:	3 days
Approved by:	re (kib)
2011-08-25 08:47:38 +00:00
Martin Matuska
b958f4853c Fix buffer overflow and possible ISO image corruption in wrong
handling of "." character case in makefs ISO level 1 and 2 filename
conversion.

Filed as NetBSD PR #45285
http://gnats.netbsd.org/cgi-bin/query-pr-single.pl?number=45285

Reviewed by:	Christos Zoulas <christos@netbsd.org>
Approved by:	re (kib)
MFC after:	3 days
2011-08-23 19:49:06 +00:00