Commit Graph

11066 Commits

Author SHA1 Message Date
delphij
ff89014ed1 MFC r275918:
Sync with NetBSD, mainly address NetBSD bug #43355:

Fix valid_format() to be more careful about allowing only valid
printf formats.

Obtained from:        NetBSD
2015-01-23 18:42:05 +00:00
pfg
de76b0c7d4 MFC r276832 (partial), r277099
Avoid a warning from gcc48.
Replace __inline GNUism with the standard inline.
2015-01-22 21:41:41 +00:00
trasz
45a21be73d MFC r275510:
Move iscsi.conf.5 from sbin/iscontrol/ to usr.bin/iscsictl/, as the
former is obsolete.

Sponsored by:	The FreeBSD Foundation
2015-01-14 11:29:16 +00:00
dchagin
427a8ba83f MFC r273048 by jhb:
Fix most of the warnings in kdump(1).

    r276758:

Eliminate new clang warnings.
2015-01-13 06:23:38 +00:00
jkim
b42ae9a022 MFC: r274460, r274475
Increase MAXTABLE to the maxmimum possible value and regen test cases.
2015-01-12 20:14:31 +00:00
pfg
881f69699c MFC r276218:
patch: Bring in xstrdup and use it when appropriate.

The function savestr allows NULL return values during Plan A patching so in
case of out of memory conditions, Plan B can step in.  In many cases, NULL
value is not properly handled, so use xstrdup here (it's outside Plan A/B
patching, which means that even Plan B relies on successful operations).

Clean up some whitespaces while here

Obtained from:	OpenBSD
2015-01-08 03:44:54 +00:00
pfg
1bedd19baf MFC r276472:
Minor fixes to exit status.

Exit with EXIT_FAILURE for invalid arguments.
Fixes NetBSD-PR 43517.

Print version string to stdout instead of stderr;
it is user-requested and not an error.

Obtained from:	NetBSD
2015-01-05 16:09:51 +00:00
ngie
0971283da1 MFC r272777,r272779,r272780,r272781,r272782,r272783,r272784,r272787,r272788:
r272777:

  Integrate usr.sbin/nmtree/tests from NetBSD into atf/kyua

  In collaboration with: pho
  Sponsored by: EMC / Isilon Storage Division

r272779:

  Integrate usr.sbin/basename/tests from NetBSD into atf/kyua

  In collaboration with: pho
  Sponsored by: EMC / Isilon Storage Division

r272780:

  Integrate usr.bin/cmp/tests from NetBSD into atf/kyua

  In collaboration with: sjg
  Sponsored by: EMC / Isilon Storage Division

r272781:

  Integrate usr.bin/dirname/tests from NetBSD into atf/kyua

  In collaboration with: pho, sjg
  Sponsored by: EMC / Isilon Storage Division

r272782:

  Integrate bin/sleep/tests from NetBSD into atf/kyua

  Sponsored by: EMC / Isilon Storage Division

r272783:

  Integrate usr.bin/cut/tests from NetBSD into atf/kyua

  Sponsored by: EMC / Isilon Storage Division

r272784:

  Integrate usr.bin/grep/tests from NetBSD into atf/kyua

  Sponsored by: EMC / Isilon Storage Division

r272787:

  Integrate usr.bin/diff/tests from NetBSD into atf/kyua at gnu/usr.bin/diff/tests

  Sponsored by: EMC / Isilon Storage Division

r272788:

  Integrate usr.bin/gzip/tests from NetBSD into atf/kyua

  Sponsored by: EMC / Isilon Storage Division
2015-01-01 02:04:44 +00:00
ngie
d4c625976a MFC r264400,r265836:
r264400:

  NO_MAN= has been deprecated in favor of MAN= for some time, go ahead
  and finish the job. ncurses is now the only Makefile in the tree that
  uses it since it wasn't a simple mechanical change, and will be
  addressed in a future commit.

r265836:

  Remove last two NO_MAN= in the tree. In both of these cases, MAN= is
  what is needed.
2014-12-31 23:25:37 +00:00
ngie
6d931c08fa MFC r266074,r266104,r266147:
r266074:

  Move old fmake tests into bmake and hook them to the build.

  This first step is mostly to prevent the code from rotting even further
  and to ensure these do not get wiped when fmake's code is removed from
  the tree.

  These tests are currently being skipped because they detect the underlying
  make is not fmake and thus disable themselves -- and the reason is that
  some of the tests fail, possibly due to legitimate bugs.  Enabling them to
  run against bmake will come separately.

  Lastly, it would be ideal if these tests were fed upstream but they are
  not ready for that yet.  In the interim, just put them under usr.bin/bmake/
  while we sort things out.  The existence of a different unit-tests directory
  within here makes me feel less guilty about this.

  Change confirmed working with a clean amd64 build.

r266104:

  Undo changes to the generated Makefile. Move tests directory to proper
  location, including updating the test to work in the more-fragile
  fmake -> bmake bootstrap environment.

r266147:

  Makefile.inc is also included by the tests subdirectory, which results
  in SUBDIRS having tests added to it, which fails. Work around this by
  checking to make sure tests exists before adding it to subdirs and
  work to get the generated file fixed so we can rename Makefile.inc to
  something else so it isn't automatically included by subdirs...
2014-12-30 02:32:48 +00:00
marcel
3ba73f92a6 MFC r275721:
The size of the first level reference count table is given in terms of the
number of clusters it occupies.

Bump the version number of mkimg.
2014-12-28 18:43:39 +00:00
ngie
8add61763b MFC bmake changes to stable/10 (r255285,r255916,r258113,r258114,r261212,r266760,r268437)
Discussed with: sjg

r255285:

  If MAKE_JOB_ERROR_TOKEN is set to false, do not put an error token ("E")
  into the job queue.
  This avoids closing down an entire build on failure of one branch.
  Probably has no use outside the context of universe/tinderbox.

  Reviewed by:	obrien

r255916:

  Fix Fx syntax.

  PR: 182269
  Approved by: re@

r258113:

  Avoid SEGV when passed NULL for list

r258114:

  Don't SEGV when Hash_Table is uninitialized

r261212:

  Merge bmake-20140101 from vendor

r266760:

  Portmgr no longer need the UL hack.

  Reviewed by: obrien

r268437:

  Update to bmake-20140620
  Main change is detection of malformed variable references.

  Reviewed by:	obrien
2014-12-27 16:43:22 +00:00
pfg
7b207849cb MFC r275838;
sed: Bounds check the file path used in the 'w' command.

Modified version of a diff from Sebastien Marie to prevent a crash found
with the afl fuzzer.

Obtained from:	OpenBSD (CVS Rev. 1.37)
2014-12-23 02:46:00 +00:00
trasz
5654688c96 MFC r274549:
Make it possible to do "iscsictl -Rt xxx -p yyy", to remove a session
that matches both -t and -p.

Sponsored by:	The FreeBSD Foundation
2014-12-21 10:56:06 +00:00
brueffer
f419d174a9 MFC: r274960 (slightly modified)
Limit descriptors and enter capability mode.  Since the header was renamed in HEAD, this
commit includes sys/capability.h.

Differential:	D1009
Reviewed by:	jonathan, pjd
Relnotes:	yes
2014-12-19 23:18:22 +00:00
jhb
9adaeb5452 MFC 273053:
Decode the arguments passed to _umtx_op().  In particular, decode the
opcode.
2014-12-16 21:57:55 +00:00
pfg
7cc43d5ff8 MFC r275553, r275612;
patch(1): Bring fixes from OpenBSD

Check fstat return value.  Use off_t for file size and offsets.
Avoid iterating over end of string.

Introduce strtolinenum to properly check line numbers while parsing:
no signs, no spaces, just digits, 0 <= x <= LONG_MAX

Properly validate line ranges supplied in diff file to prevent overflows.
Also fixes an out of boundary memory access because the resulting values
are used as array indices.

PR:		195436
Obtained from:	OpenBSD
2014-12-16 21:13:55 +00:00
pfg
8631101d5a MFC r275531, r275581, r275582;
patch(1): Small changes to sync with OpenBSD

Update OpenBSD CVS revision tag for our r255232.
Prefer setvbuf() to setlinebuf().
Small space changes, mostly to keep in sync with OpenBSD

Obtained from:	OpenBSD
2014-12-16 21:05:28 +00:00
trasz
8a9a84f3d8 MFC r274495:
Add missing commas to .Xr.

Sponsored by:	The FreeBSD Foundation
2014-12-14 11:03:22 +00:00
jilles
26dad09e50 MFC r267265: truncate: Detect integer overflow, fix relative sizes, add tests.
The change to expand_number (r204654) broke detection of too large sizes and
relative sizes ('+'/'-').

Also add some tests.

The usr.bin/truncate/Makefile is slightly different in the MFC because
src.opts.mk does not exist in stable/10.

PR:		190735
Submitted by:	Kirk Russell
2014-12-07 22:30:54 +00:00
kevlo
a97617028a MFC r275162:
Init array field in the proper place.

Obtained from:	OpenBSD
2014-12-01 02:59:05 +00:00
trasz
59965706b2 MFC r273822:
Fix iscsictl(8) and ctld(8) to correctly handle Windows newlines
(CRLF) in iscsi.conf and ctl.conf.

Sponsored by:	The FreeBSD Foundation
2014-11-29 15:39:31 +00:00
dteske
7230e71362 MFC r274116:
Add new libraries/utilities for data throughput visualization.
dpv(3): dialog progress view library
dpv(1): stream data from stdin or multiple paths with dialog progress view
figpar(3): configuration file parsing library

MFC r274120, r274121, r274123, r274124, r274144, r274146, r274159, r274192,
r274203, r274209, r274226, r274270, and r274851: Fixes following r274116

Reviews:        D714
Relnotes:       New libdpv/libfigpar and dpv(1) utility
Reviewed by:    jelischer, shurd
Discussed at:   MeetBSD California 2014 Vendor/Dev Summit
Discussed on:   -current
Thanks to:      ngie, ian, jelischer, shurd, bapt
2014-11-25 13:47:53 +00:00
dim
88dda701c6 MFC r274847:
Fix the following -Werror warnings from clang 3.5.0, while building
usr.bin/locate:

usr.bin/locate/locate/util.c:249:29: error: taking the absolute value of unsigned type 'unsigned int' has no effect [-Werror,-Wabsolute-value]
                            MAXPATHLEN, abs(i) < abs(htonl(i)) ? i : htonl(i));
                                                 ^
usr.bin/locate/locate/util.c:249:29: note: remove the call to 'abs' since unsigned values cannot be negative
                            MAXPATHLEN, abs(i) < abs(htonl(i)) ? i : htonl(i));
                                                 ^~~
usr.bin/locate/locate/util.c:274:32: error: taking the absolute value of unsigned type 'unsigned int' has no effect [-Werror,-Wabsolute-value]
                            MAXPATHLEN, abs(word) < abs(htonl(word)) ? word :
                                                    ^
usr.bin/locate/locate/util.c:274:32: note: remove the call to 'abs' since unsigned values cannot be negative
                            MAXPATHLEN, abs(word) < abs(htonl(word)) ? word :
                                                    ^~~

The problem is that ntohl() always returns an unsigned quantity.  In
this case, it's expected to be cast back to a signed integer, but to
stop complaints about abs() we just store it into an integer, and don't
call ntohl() again.

Reviewed by:	ngie
Differential Revision: https://reviews.freebsd.org/D1196
2014-11-25 12:45:31 +00:00
trasz
38906efd97 MFC r273464:
Whitespace fixes.

Sponsored by:	The FreeBSD Foundation
2014-11-22 17:50:14 +00:00
emaste
3df6bbce99 bsdgrep: Work-around for segmentation fault.
Fix by David Carlier.

MFC of r272127
Obtained from:	HardenedBSD
PR:		167921
2014-11-20 19:35:29 +00:00
marcel
a6b76a0b4d MFC r274410: Fix for behaviour of SEEK_DATA on ZFS. 2014-11-17 17:17:10 +00:00
smh
f6482d9897 MFC r260800:
Fix a regression introduced in r237618

MFC r260801:
Re-work r260800 to include other signals which start with 'I'
such as ILL, INFO etc.

Sponsored by:	Multiplay
2014-11-13 16:40:15 +00:00
delphij
7ba4eeedbf MFC r273507: Sync with NetBSD. 2014-11-08 00:51:31 +00:00
emax
3f28cd3e4f MFC r273548
Change the code to use the openpty(3) API which uses the pts(4) driver
instead of the pty(4) driver.

PR:		184597
Submitted by:	tobias.rehbein
2014-11-06 16:32:00 +00:00
ngie
9a57ba8bbc MFC r270650 (this is what should have been committed in r273497):
Convert LIBCURSES to LIBNCURSES to fix "make checkdpadd"

  Also, add a missing LIBPANEL dependency for lldb

  Approved by: rpaulo (mentor)
  Suggested by: brooks
  Phabric: D675 (as part of a larger diff)
  PR: 192762
2014-10-23 00:43:08 +00:00
ngie
f3b7cba370 MFC r263264 (by glebius):
Make talk(1) capable of displaying UTF-8 characters.

  Sponsored by:	Nginx, Inc.
2014-10-23 00:39:19 +00:00
markj
7d81889ecb MFC r271692:
Fix a typo.
2014-10-22 23:55:08 +00:00
rodrigc
538d05fbcc Merge: r269884
Complete the usr.bin/yacc kyua integration work I originally
submitted via r268811

- Install the Kyuafile by adding FILES to FILESGROUPS
- Run the testcases with an unprivileged user

  Some of the testcases depend upon behavior that's broken when
  run as root on FreeBSD because of how permissions are treated
  with access(2) vs eaccess(2), open(2), etc

- Simplify the test driver to just inspect the exit code from
  run_test because it now exits with 0 if successful and exits
  with !0 if unsuccessful
- Don't do ad hoc temporary directory creation/deletion; let Kyua
  handle that
- Add entries for files removed in r268811 to
  OptionalObsoleteFiles.inc

PR: 191020
X-MFC with: r268811
Approved by: jmmv (mentor)
Reviewed by: bapt
Sponsored by: EMC / Isilon Storage Division
2014-10-11 23:31:44 +00:00
rodrigc
094ca4bfbc Merge: r258931
Add missing bits from the vendor's 2005-05-04 change to
contrib/byacc/makefile.in ("add YYPATCH here so it can be tested by
applications") so that applications have a hope of detecting newer
FreeBSD YACC output from an older one.

Submitted by: Juniper Networks
2014-10-11 23:02:03 +00:00
rodrigc
6fdcea3e5e Merge: r268811
Update to byacc 20140715

PR:             191020
Submitted by:   gcooper (yaneurabeya@gmail.com)
2014-10-11 19:18:00 +00:00
emaste
31f18a365b MFC r272762: Correct scale factor for T terabyte suffix
PR:		194250
2014-10-11 00:30:57 +00:00
hrs
a95d28f371 MFC r271410:
Fix header output when -P is specified and (ncpus - 1) != maxid.
2014-10-09 23:42:22 +00:00
hrs
afd3460b01 MFC r266177:
- Do not override sin6_scope_id in LLA when it is already set to non-zero.
    This fixes destination list in output of netstat -r.
  - Plug a memory leak.
  - Add RTM_VERSION check.
2014-10-09 23:23:12 +00:00
hrs
200a7a67a4 MFC r266494:
- Fix a bug which can make sysctl() fail when -F is specified.
  - Increase WID_IF_DEFAULT() from 6 to 8 (the default for AF_INET6) because
    we have interfaces with longer names than 6 chars like epairN{a,b}.
  - Style fixes.
2014-10-09 22:54:51 +00:00
ae
142c064467 MFC r271307:
Add the ability to set `prefer_source' flag to an IPv6 address.
  It affects the IPv6 source address selection algorithm (RFC 6724)
  and allows override the last rule ("longest matching prefix") for
  choosing among equivalent addresses. The address with `prefer_source'
  will be preferred source address.
2014-10-09 02:49:33 +00:00
marcel
4742b8fd12 MFC r272485: Fill cyclinder, head and sector fields for the EBR,
MBR and PC98 schemes.

Requested by: gjb
2014-10-08 22:13:18 +00:00
marcel
f816038a40 MFC 272384:
Improve performance of mking(1).

Requested by: gjb
2014-10-08 22:09:36 +00:00
marcel
27db89ec69 MFC 272198, 272217:
Add 3 long options (--version, --formats & --schemes) for getting
information about mkimg itself.

Requested by: gjb

Relnotes:	yes
2014-10-08 22:06:38 +00:00
marcel
951d95ff86 MFC 271965, 272072, 272086: Add QCOW v1 & v2 support
Requested by: gjb

Relnotes:	yes
2014-10-08 22:01:35 +00:00
bapt
2014ab0354 MFC: r272398
Make sure to not skip any argument when converting from deprecated
+POS1, -POS2 to -kPOS1,POS2, so that sort +0n gets translated to sort -k1,1n
as it is expected

PR:		193994
Submitted by:	rodrigo
MFC after:	3 days
2014-10-06 09:15:09 +00:00
delphij
28944a4ef0 MFC r272288,272289:
When setting environment variables in the atrun script, use the
"export foo=bar" form instead of "foo=bar; export foo" since the
former allows the shell to catch variable names that are not valid
shell identifiers.  This will cause /bin/sh to exit with an error
(which gets mailed to the at user) and it will not run the script.

Obtained from:	OpenBSD (r1.63 millert)
Approved by:	re (gjb)
2014-10-02 18:26:40 +00:00
marcel
0eb256ebfd MFC 271881: Fix partition alignment and image rounding when any of
-P (block size),  -T (track size) or -H (number of heads) is given.

Approved by:	re@ (gjb)
2014-09-23 16:05:23 +00:00
marcel
a6288e6f8d MFC 271482: Add support for adding empty partition entries.
Relnotes:	yes
Approved by:	re@ (gjb)
2014-09-22 15:22:57 +00:00
marcel
df98102783 Be compatible with boot code that starts right after the disk label in
the second sector by only clearing the amount of bytes needed for the
disklabel in the second sector. Previously we were clearing exactly 1
sector worth of bytes and as such writing over boot code that may have
been there.
Since we do support more than 8 partitions, make sure to set all fields
in d_partitions. For the first 8 partitions this is unneeded, but for
partitioons 9 and up this compensates for the fact that we don't clear
an entire sector anymore.
Obviously, one cannot use more than 8 partitions when using boot code
that starts right after the disk label.

Relevant GRNs:
107879 - Employ unused bytes after the disklabel in the second sector.
189500 - Revert the part of change 107879 that employs the unused bytes
	 after the disklabel in the 2nd sector for boot code.

Obtained from:	Juniper Networks, Inc.

Approved by:	re@ (gjb)
2014-09-18 22:27:02 +00:00