Commit Graph

12817 Commits

Author SHA1 Message Date
Ed Maste
adbb8a93d6 make vi message catalogues build independent of locale
r275234 addressed sort automatically converting 8-bit locales to UTF-8
by using "LANG=C sort", but LC_ALL overrides LANG if set, so the issue
may still be present depending on the user's environment. Use LC_ALL=C
instead.

Reported by:	tests.reproducible-builds.org
Reviewed by:	bapt
MFC after:	1 week
Sponsored by:	The Linux Foundation / Core Infrastructure Initiative
Differential Revision:	https://reviews.freebsd.org/D9765
2017-02-23 14:39:51 +00:00
Baptiste Daroussin
0064a5b36d Better fix for r314098
The actual issue was the fact that if - was used then some restriction were
already set to stdin when we were applying caph_limit_stdio which was failing
due to the fact the fd was the fd was already restricted to lower rights.

Restricting stdio before actually opening the files prevent trying to raise the
right and fixes the issue.

And this allows to keep failing the program if restriction failed

Approved by:	allanjude
Differential Revision:	https://reviews.freebsd.org/D9723
2017-02-22 16:37:45 +00:00
Allan Jude
e872af3a64 lam(1): Failing to restrict stdin/stdout/stderr should not be fatal
When fed from a pipe, lam(1) would sometimes fail:
lam: unable to limit stdio: Capabilities insufficient

fixed regression in portsnap(8) introduced in r313938

This broke portsnap(8), the app that the capsicumization of lam(1) was
meant to secure.

# portsnap fetch update
Looking up portsnap.FreeBSD.org mirrors... 6 mirrors found.
Fetching snapshot tag from ec2-eu-west-1.portsnap.freebsd.org... done.
Fetching snapshot metadata... done.
Updating from Tue Feb 21 16:05:39 MSK 2017 to Tue Feb 21 16:59:30 MSK 2017.
Fetching 5 metadata patches.lam: unable to limit stdio: Capabilities insufficient
 done.
Applying metadata patches... done.
Fetching 5 metadata files... lam: unable to limit stdio: Capabilities insufficient
/usr/sbin/portsnap: cannot open 8c94d2c3f8fcea20eb1fd82021566c99c63a010e6b3702ee11e7a491795bcfb8.gz: No such file or directory
metadata is corrupt.

Reported by:	Vladimir Zakharov <zakharov.vv@gmail.com>, Ben Woods <woodsb02@gmail.com>
2017-02-22 15:30:57 +00:00
Renato Botelho
27569d019d Fix style(9)
Reviewed by:	ngie, tuexen, vangyzen, allanjude
Approved by:	allanjude
MFC after:	1 week
Sponsored by:	Rubicon Communications (Netgate)
Differential Revision:	https://reviews.freebsd.org/D9588
2017-02-21 12:37:59 +00:00
Bryan Drewery
7ad0d03d2b Make it more clear that -k sends SIGKILL, not the -s signal.
MFC after:	1 week
2017-02-21 01:11:18 +00:00
Ed Maste
6b91f51703 bsdgrep: document ignored option -u
MSDOS and Windows GNU grep uses -u to mean "print byte offsets as if
running on an UNIX system." The option has no effect on systems that
do not use CRLF line endings.

PR:		171200
Submitted by:	deeptech71@gmail.com, Anders Jensen-Waud
MFC after:	1 month
2017-02-19 17:40:24 +00:00
Ed Maste
5dff7be120 bsdgrep: fix EOF handling with --mmap
Rework part of the loop in grep_fgetln to return the rest of the line
and ensure that we still advance the buffer by the length of the rest
of the line.

PR:		165471
Submitted by:	Kyle Evans <kevans91@ksu.edu>
MFC after:	1 month
2017-02-19 17:23:27 +00:00
Allan Jude
ba0320553c Capsicum-ize lam(1)
lam(1) is used in portsnap(8), so lock it down

Reviewed by:	emaste, cem, jonathan
Sponsored by:	ScaleEngine Inc.
Differential Revision:	https://reviews.freebsd.org/D8076
2017-02-19 06:02:41 +00:00
Pedro F. Giffuni
759a9a9d24 sort(1): Remove unneeded initializations.
Found by:	Clang static analyzer
2017-02-17 19:53:20 +00:00
Baptiste Daroussin
02db5d1d66 Use full name for the month
Reported by:	brueffer
2017-02-17 11:31:27 +00:00
Baptiste Daroussin
0150ca6914 Also add vsevolod@ in the authors 2017-02-17 11:26:03 +00:00
Baptiste Daroussin
9a00b6c855 Add history and Authors section in the manpage
Submitted by:	dteske
MFC after:	2 days
Differential Revision:	https://reviews.freebsd.org/D9419
2017-02-17 11:17:56 +00:00
Dimitry Andric
23cba92bd3 Fix build of BSD dtc when NDEBUG is defined (MK_ASSERT_DEBUG=no):
* Initialize correct parent in binary_operator's constructor.
* Include <errno.h> explicitly, otherwise errno is undefined (without
  NDEBUG, this is accidentally 'fixed' by including <iostream>).

Reported by:	matteo
MFC after:	3 days
2017-02-13 20:56:53 +00:00
Enji Cooper
ad68ac431b Use SRCTOP/OBJTOP relative paths where possible; use :H manipulation in lieu
of ../ elsewhere

This simplifies pathing in make/displayed output

MFC after:	1 week
Sponsored by:	Dell EMC Isilon
2017-02-12 08:36:47 +00:00
Baptiste Daroussin
f59f9337b6 Remove spaces at end of line
Reported by:	make manlint
MFC after:	2 days
2017-02-11 23:45:50 +00:00
Baptiste Daroussin
dae6dcb78a Remove useless Li macro
Reported by:	make manlint
MFC after:	2 days
2017-02-11 23:45:10 +00:00
Baptiste Daroussin
25748e92e0 Use correct date format
Reported by:	make manlint
MFC after:	2 days
2017-02-11 23:44:37 +00:00
Baptiste Daroussin
042e4ab355 Escape Sm to avoid confusion with Sm macro
Reported by:	make manlint
MFC after:	2 days
2017-02-11 23:43:12 +00:00
Baptiste Daroussin
d51868a30a Properly use .An macro before Authors name
Reported by:	make manlint
MFC after:	2 days
2017-02-11 23:42:33 +00:00
Baptiste Daroussin
0e630e32be Add missing section in manpage reference
Reported by:	make manlint
MFC after:	2 days
2017-02-11 23:41:38 +00:00
Baptiste Daroussin
b7dd44ebcf Remove spaces at EOL and sort correctly the SEE ALSO section
Reported by:	make manlint
MFC after:	2 days
2017-02-11 23:40:57 +00:00
Baptiste Daroussin
de5d5e9997 Remove empty space at EOL and escept Ed
Reported by:	make manlint
MFC after:	2 days
2017-02-11 23:39:56 +00:00
Baptiste Daroussin
42ced26621 Remove useless .Pp after the .Sh macro and remove empty line
Reported by:	make manlint
MFC after:	2 days
2017-02-11 23:39:14 +00:00
Baptiste Daroussin
e7e1f7e394 Escape No to avoid confusion with the No macro
Reported by:	make manlint
MFC after:	2 days
2017-02-11 23:38:28 +00:00
Baptiste Daroussin
686e56957e Add missing section after .Xr reference
Reported by:	make manlint
MFC after:	2 days
2017-02-11 23:37:48 +00:00
Baptiste Daroussin
d10807ecab Add missing -width after -Bl -tag
Reported by:	make manlint
MFC after:	2 days
2017-02-11 23:36:52 +00:00
Baptiste Daroussin
95a27780e2 Escape Ss to avoid confusion by mdoc parser with the Ss macro
Reported by:	make manlint
MFC after:	2 days
2017-02-11 23:14:28 +00:00
Enji Cooper
32fbf9b347 Use SRCTOP to define .include with usr.bin/Makefile.inc
MFC after:	1 week
Sponsored by:	Dell EMC Isilon
2017-02-11 20:27:53 +00:00
Enji Cooper
272a2acfef Use SRCTOP to refer to awk source in contrib/awk and remove unnecessary AWKSRC prefix
for maketab.c

The former simplifies pathing in make/displayed output, whereas the latter was just
unnecessarily superfluous since .PATH referenced the path to maketab.c earlier on in
the Makefile.

MFC after:	1 week
Sponsored by:	Dell EMC Isilon
2017-02-11 20:27:06 +00:00
Enji Cooper
15212f7a83 Use SRCTOP instead of .CURDIR relative paths with ".."
This simplifies pathing in make/displayed output

MFC after:	1 week
Sponsored by:	Dell EMC Isilon
2017-02-11 20:19:04 +00:00
Enji Cooper
ebbfcada38 Use SRCTOP instead of .CURDIR relative paths with ".."
This simplifies pathing in make/displayed output

MFC after:	1 week
Sponsored by:	Dell EMC Isilon
2017-02-11 20:18:24 +00:00
Mahdi Mokhtari
701dacac99 Adding myself to committers-ports.dot and calendar.freebsd
Submitted by:	mmokhi
Approved by:	feld, mat (mentors)
Differential Revision:	https://reviews.freebsd.org/D9528
2017-02-11 05:19:45 +00:00
Piotr Pawel Stefaniak
61fd3be0b0 indent(1): add regression test cases
These examples show expected behavior of indent(1). They are meant to be used
together with a regression test mechanism, either Kyua, a Makefile or perhaps
something else. The mechanism should in essence do this:
  indent -P${test}.pro < ${test}.0 > ${test}.0.run
and compare ${test}.0.stdout to ${test}.0.run. If the files differ or the exit
status isn't 0, the test failed.

* ${test}.pro is an indent(1) profile: a list of options passed through a file.
  The program doesn't complain if the file doesn't exist.
* ${test}.0 is a C source file which acts as input for indent(1). It doesn't
  have to have any particular formatting, since it's the output that matters.
* ${test}.0.stdout contains expected output. It doesn't have to be formatted in
  Kernel Normal Form as the point of the tests is to check for regressions in
  the program and not to check that it always produces KNF.

Reviewed by:	ngie
Approved by:	pfg (mentor)
Differential Revision:	https://reviews.freebsd.org/D9007
2017-02-10 09:31:39 +00:00
John Baldwin
3ff519254c Trim trailing whitespace (mostly introduced in r313407).
Sponsored by:	DARPA / AFRL
2017-02-08 17:45:23 +00:00
Enji Cooper
67c58b9926 MFhead@r313433 2017-02-08 08:55:05 +00:00
John Baldwin
885f13dc96 Copy the e_machine and e_flags fields from the binary into an ELF core dump.
In the kernel, cache the machine and flags fields from ELF header to use in
the ELF header of a core dump. For gcore, the copy these fields over from
the ELF header in the binary.

This matters for platforms which encode ABI information in the flags field
(such as o32 vs n32 on MIPS).

Reviewed by:	kib
Sponsored by:	DARPA / AFRL
Differential Revision:	https://reviews.freebsd.org/D9392
2017-02-07 20:34:03 +00:00
Enji Cooper
4a2dbde724 MFhead@r313398 2017-02-07 18:47:16 +00:00
Enji Cooper
e58164041c Don't expect :inplace_symlink_src to fail anymore (post-r313277)
The S_ISREG check was restored, such that the code will again fail with
in-place replacements on symlinks

MFC after:	12 days
X-MFC with:	r313277
Sponsored by:	Dell EMC Isilon
2017-02-07 18:23:44 +00:00
Enji Cooper
15df32b48d MFhead@r313360 2017-02-07 01:33:39 +00:00
Andrey V. Elsukov
fcf596178b Merge projects/ipsec into head/.
Small summary
 -------------

o Almost all IPsec releated code was moved into sys/netipsec.
o New kernel modules added: ipsec.ko and tcpmd5.ko. New kernel
  option IPSEC_SUPPORT added. It enables support for loading
  and unloading of ipsec.ko and tcpmd5.ko kernel modules.
o IPSEC_NAT_T option was removed. Now NAT-T support is enabled by
  default. The UDP_ENCAP_ESPINUDP_NON_IKE encapsulation type
  support was removed. Added TCP/UDP checksum handling for
  inbound packets that were decapsulated by transport mode SAs.
  setkey(8) modified to show run-time NAT-T configuration of SA.
o New network pseudo interface if_ipsec(4) added. For now it is
  build as part of ipsec.ko module (or with IPSEC kernel).
  It implements IPsec virtual tunnels to create route-based VPNs.
o The network stack now invokes IPsec functions using special
  methods. The only one header file <netipsec/ipsec_support.h>
  should be included to declare all the needed things to work
  with IPsec.
o All IPsec protocols handlers (ESP/AH/IPCOMP protosw) were removed.
  Now these protocols are handled directly via IPsec methods.
o TCP_SIGNATURE support was reworked to be more close to RFC.
o PF_KEY SADB was reworked:
  - now all security associations stored in the single SPI namespace,
    and all SAs MUST have unique SPI.
  - several hash tables added to speed up lookups in SADB.
  - SADB now uses rmlock to protect access, and concurrent threads
    can do SA lookups in the same time.
  - many PF_KEY message handlers were reworked to reflect changes
    in SADB.
  - SADB_UPDATE message was extended to support new PF_KEY headers:
    SADB_X_EXT_NEW_ADDRESS_SRC and SADB_X_EXT_NEW_ADDRESS_DST. They
    can be used by IKE daemon to change SA addresses.
o ipsecrequest and secpolicy structures were cardinally changed to
  avoid locking protection for ipsecrequest. Now we support
  only limited number (4) of bundled SAs, but they are supported
  for both INET and INET6.
o INPCB security policy cache was introduced. Each PCB now caches
  used security policies to avoid SP lookup for each packet.
o For inbound security policies added the mode, when the kernel does
  check for full history of applied IPsec transforms.
o References counting rules for security policies and security
  associations were changed. The proper SA locking added into xform
  code.
o xform code was also changed. Now it is possible to unregister xforms.
  tdb_xxx structures were changed and renamed to reflect changes in
  SADB/SPDB, and changed rules for locking and refcounting.

Reviewed by:	gnn, wblock
Obtained from:	Yandex LLC
Relnotes:	yes
Sponsored by:	Yandex LLC
Differential Revision:	https://reviews.freebsd.org/D9352
2017-02-06 08:49:57 +00:00
Allan Jude
39f8282b48 Remove bdes(1)
The use of DES for anything is discouraged, especially with a static IV of 0

If you still need bdes(1) to decrypt Kirk's video lectures, see
security/bdes in ports.

This commit brought to you by the FOSDEM DevSummit and the
"remove unneeded dependancies on openssl in base" working group

Reviewed by:	bapt, brnrd
Relnotes:	yes
Sponsored by:	FOSDEM DevSummit
Differential Revision:	https://reviews.freebsd.org/D9424
2017-02-06 08:27:19 +00:00
Xin LI
b8fe1f690c Reflect actual NetBSD revision we already have.
MFC after:	3 days
2017-02-06 07:02:17 +00:00
Xin LI
8e2106f0cb Restore r312404:
Use S_ISREG instead of manual & (also it's better to compare the
result from & and the pattern instead of just assuming it's one bit
value).

Pointed out by Tianjie Mao <tjmao tjmao com>.

MFC after:	2 weeks
Differential Revision:	https://reviews.freebsd.org/D4827
2017-02-05 08:51:41 +00:00
Enji Cooper
9b3ece1c2e MFhead@r313243 2017-02-04 18:06:09 +00:00
Jung-uk Kim
b3d5213675 Update byacc regression tests to match 20170201. 2017-02-02 20:01:54 +00:00
Enji Cooper
dad206bd67 Update MACHINE/MACHINE_ARCH examples to use arm64/aarch64 instead of i386/pc98
pc98 support was removed in r312910
2017-01-29 00:24:34 +00:00
Baptiste Daroussin
b4b4b5304b Revert crap accidentally committed 2017-01-28 16:31:23 +00:00
Baptiste Daroussin
814aaaa7da Revert r312923 a better approach will be taken later 2017-01-28 16:30:14 +00:00
Yoshihiro Takahashi
2b375b4edd Remove pc98 support completely.
I thank all developers and contributors for pc98.

Relnotes:	yes
2017-01-28 02:22:15 +00:00
Ed Maste
f52e4bdfd7 Rename LLD_AS_LD to LLD_IS_LD, for consistency with CLANG_IS_CC
Reported by:	Dan McGregor <dan.mcgregor usask.ca>
2017-01-27 01:59:12 +00:00