Commit Graph

11156 Commits

Author SHA1 Message Date
delphij
d812607618 MFC r287633:
- Avoid accessing window properties directly, instead, use accessors.
   This should be no-op for now, but allows the code to work if we
   move to NCURSES_OPAQUE.
 - Use calloc() instead of malloc+bzero.
2015-09-24 00:50:17 +00:00
delphij
0e2b30291c MFC r287590:
w(1) is not setgid binary since r53279, so remove the setgid() call.

Reviewed By:	wollman
2015-09-23 01:07:45 +00:00
pfg
af1f6583e1 MFC r286891, r286893:
calendar(1): add a few more dates to the Christian calendar

Bring some well established holidays that also happen to be legal
holidays in many Catholic countries.
2015-09-17 00:36:18 +00:00
delphij
9a0c37807b MFC r287320:
- uri is expected to be nul-terminated (strchr used later),
   so use strlcpy instead of strncpy.
 - replace the other two cases of strncpy+\0 with strlcpy.
2015-09-14 18:57:50 +00:00
delphij
3908360148 MFC r287319:
Constify opt_f and opt_t and eliminate unneeded copying.  This fixes
memory leaks.

Reported by:	clang static analyzer
2015-09-14 18:52:41 +00:00
hrs
c02639b794 MFC r287406:
Divide statistics in the number of packets with 1000 instead of 1024
in human-readable form.

PR:	183598
2015-09-09 08:40:17 +00:00
delphij
19493aa167 MFC r287123:
Finish r89633 and completely remove the remaining of VERSION.

PR:		bin/202308
Submitted by:	John Hein <z7dr6ut7gs snkmail com>
2015-09-08 02:02:08 +00:00
delphij
1d0f985306 MFC r287345:
Drop group privileges after opening the kvm descriptor, otherwise, the code
would not drop privileges as expected.

While there also add checks for the drop and bail out immediately if we
failed.
2015-09-04 00:41:29 +00:00
bapt
326626fa22 MFC: r268745,r268746,r268747,r268748,r268749,r268861,r268750,r268751,r268763
r273769,r273771,r276771,r278810

New BSDL timeout(1) utility compatible with GNU timeout

Relnotes:	yes
2015-09-02 05:45:47 +00:00
emaste
509a57d66e MFC r285844: ar: add -U (unique) option to disable -D (deterministic) mode
This is required in order for us to support deterministic mode by
default.  If multiple -D or -U options are specified on the command
line, the final one takes precedence.  GNU ar also uses -U for this.

PR:		196929
Sponsored by:	The FreeBSD Foundation
2015-08-31 17:30:13 +00:00
jilles
461d06c693 MFC r286344: find: Fix segfault with very long path in -exec/-ok ... {} \;.
If the resulting argument is longer than MAXPATHLEN, realloc() was called to
extend the space, but the new pointer was not correctly stored.

Different from what OpenBSD has done, rewrite brace_subst() to calculate the
necessary space first and realloc() at most once.

As before, the e_len fields are not updated in case of a realloc.
Therefore, a following long argument will do another realloc.

PR:		201750
2015-08-28 20:53:08 +00:00
delphij
aea92d2f4a MFC r281800 (pfg):
patch(1): small include changes.

Mostly to match OpenBSD, no functional change.

MFC r286601 + 286617:

use posix_spawn(3) instead of fork() and exec() manually as suggested
by jmg@.
2015-08-27 21:52:09 +00:00
marcel
d53cfebe2f MFC r286660, r286419, r286417, r286395, r286215, r284883
-   Add the ntfs alias
-   Fix the dynamic VHD format to work with qemu
-   Update manpage

MFH:
Differential Revision:
2015-08-25 04:03:51 +00:00
ed
473deb7c5c MFC r285742:
Unbreak "last reboot".

  According to the last(1) man page, the "reboot" pseudo-user should print
  all system reboot entries. This got broken by the utmpx import, as
  records are typed.

  Re-add support for "last reboot" by specifically matching against
  SHUTDOWN_TIME and BOOT_TIME records.

PR:           168844
Submitted by: matthew@
2015-08-20 08:34:13 +00:00
emaste
5264296ce4 MFC r285842: truss: follow pdfork()ed descendents with -f 2015-08-14 21:44:42 +00:00
pfg
2df02110dd MFC r286615:
Clean up some externally visible "more then" occurences
2015-08-14 02:45:22 +00:00
delphij
b64e10546f Fix patch(1) shell injection vulnerability via ed(1). [SA-15:18]
Fix routed remote denial of service vulnerability. [SA-15:19]
2015-08-05 22:05:02 +00:00
pfg
d396e4d373 MFC r286102:
Buffer overflow in wall(1).

This affected syslogd, wall and talkd.
Detected by FORTIFY_SOURCE GSoC (with clang).

Submitted by:		Oliver Pinter
Differential Revision:	https://reviews.freebsd.org/D3254
Reviewed by:		delphij, jmg
2015-08-04 03:06:23 +00:00
markj
25eb055781 MFC r285782:
Fix counter reads on platforms where sizeof(uint64_t) != sizeof(uint64_t *).

PR:	201700
2015-07-31 00:21:40 +00:00
delphij
d3ecbb9019 Fix patch(1) shell injection vulnerability. [SA-15:14]
Fix resource exhaustion in TCP reassembly. [SA-15:15]

Fix OpenSSH multiple vulnerabilities. [SA-15:16]
2015-07-28 19:58:44 +00:00
emaste
c94b5252c8 MFC r285248: lldb: use .PATH to find man page instead of symlinking it 2015-07-28 12:46:37 +00:00
hrs
881bea3791 MFC r284636:
- Add SOCK_SEQPACKET support in UNIX-domain socket.
- Display zoneid using % notation in an IPv6 address.
- Use nitems().
- Use sstos{in,in6,un} macros to simplify casts.
- style(9).

Approved by:	re (gjb)
2015-07-23 20:00:20 +00:00
gjb
70968cfdb6 MFC r285253 (hrs):
- Add IPv6 support in quota(1).  While rpc.rquotad has supported
   PF_INET6 for a long time, quota(1) utility supported only PF_INET.
 - Clean up confusing changes in f_mntfromname.
 - Add an entry for rquotad with rpc/udp6 to inetd.conf.

PR:		194084
Approved by:	re (kib)
Sponsored by:	The FreeBSD Foundation
2015-07-20 21:52:05 +00:00
brueffer
332926e663 MFC: r285457
Don't claim c99 is a wrapper around gcc; it's a wrapper around the system
cc.

PR:             201303
Submitted by:   Bruce Cran
Approved by:    re (gjb)
2015-07-20 14:40:34 +00:00
brueffer
82ebd585a4 MFC: r285028
Add the year to the VAX-11/780 announcement entry.

PR:		200961
Submitted by:	John Marshall
Approved by:	re (gjb)
2015-07-13 13:42:05 +00:00
bapt
2ba8e41f9e MFC: r279597 (and 259152,259219 as dependency)
Make calendar(1) usable again. rework the calendar parser so that it is
compatible with documented format:

Support includes surrounded by '"' or '<' '>'
Print warnings about bad syntax
Correctly navigate through include directories to find calendar files
Correctly support multiple includes

While here:

MFC: 262011 (by eadler)

calendar(1): don't segfault in invalid input

When the user supplies an invalid number of days provide a useful error message
instead of segfaulting.

Approved by:	re (gjb)
2015-07-08 21:06:19 +00:00
emaste
46c04bda42 MFC r284928: speed up ar(1) on UFS file systems
Fault in the buffer prior to writing to workaround poor performance due
to interaction with kernel fs deadlock avoidance code. See the comment
prior to vn_io_fault_doio() in sys/kern/vfs_vnops.c for details of the
issue.

On my stable/10 desktop with a 16MB obj.o and "ar r out.a obj.o" I see
the following run times (seconds):

x ar.r284891
+ ar.patched
+----------------------------------------------------------------------+
|+                                                                     |
|+                                                                    x|
|+                                                                   xx|
|A                                                                   |A|
+----------------------------------------------------------------------+
    N         Min          Max        Median           Avg        Stddev
x   3       1.307        1.321         1.315     1.3143333  0.0070237692
+   3       0.020        0.023         0.022   0.021666667  0.0015275252
Difference at 95.0% confidence
        -1.29267 +/- 0.0115203
        -98.3515% +/- 0.876513%
        (Student's t, pooled s = 0.00508265)

Thanks to kib for diagnosing and explaining the issue and suggesting
the workaround.

Approved by:	re (gjb)
Sponsored by:	The FreeBSD Foundation
2015-07-07 02:17:24 +00:00
garga
d2118e7c17 MFC r265096:
Fix "netstat -gW" behavior broken in r259638.
netstat has two options for printing multicast tables:
sysctl (the default one for live systems) and kvm-based one (for cores).
It looks like kvm-based one hasn't been working since it's been introduced
in r190012 due to absence of mfctablesize kernel symbol.
Check for all ipv4-multicast symbols being correctly resolved was introduced
in r259638 regardless of 'live' value leading to "No IPv4 MROUTING" error
message.

Reported by:	Olivier Cochard-Labbé
Approved by:	melifaro@
Sponsored by:	Netgate
2015-07-02 10:31:08 +00:00
des
1bc136b874 MFH (r277695): allow tracing dlfunc() / dlsym() events 2015-06-30 14:17:02 +00:00
marcel
c8b4a5d462 MFC r284269, r284270, r284655, r284656, r284658:
VHD fixes for Microsoft Azure:
1.  Round the image size to the VHD geometry and then round to a
    multiple of 1MB.
2.  Change the creator OS from "FBSD" to "Wi2k". It matters...
3.  Bump the VHD tool version and the mkimg version.

Approved by:	re (gjb)
2015-06-24 18:40:34 +00:00
brueffer
cb122c6c8e MFH: r284249
Correct Hawaii's admission day.

PR:		192651
2015-06-24 12:19:11 +00:00
tuexen
167ded8010 MFC r284604:
Don't leak sockets.

Reported by:	Coverity
CID:		1306785
2015-06-22 05:36:08 +00:00
tuexen
a42ec2035f MFC r284547:
Fix a bug reported by coverity. Since AF_UNIX sockets don't
have multiple addresses, the problem didn't show up during testing.

Reported by:	Coverity
CID:		1306787
2015-06-22 05:31:29 +00:00
trasz
88bb9f05c4 MFC r283285:
Advertise ctlstat(8) a little better.

Sponsored by:	The FreeBSD Foundation
2015-06-21 06:54:54 +00:00
trasz
1b7df0d462 MFC r282238:
Remove spurious period.

Sponsored by:	The FreeBSD Foundation
2015-06-21 06:44:32 +00:00
trasz
d057adeb92 MFC r282236:
Make rctl(8) more user-friendly when RACCT/RCTL is disabled for some reason.

Sponsored by:	The FreeBSD Foundation
2015-06-21 06:40:43 +00:00
trasz
e1055c772b MFC r282213:
Add kern.racct.enable tunable and RACCT_DISABLED config option.
The point of this is to be able to add RACCT (with RACCT_DISABLED)
to GENERIC, to avoid having to rebuild the kernel to use rctl(8).

MFC r282901:

Build GENERIC with RACCT/RCTL support by default.  Note that it still
needs to be enabled by adding "kern.racct.enable=1" to /boot/loader.conf.

Note those two are MFC-ed together, because the latter one changes the
name of RACCT_DISABLED option to RACCT_DEFAULT_TO_DISABLED.  Should have
committed the renaming separately...

Relnotes:	yes
Sponsored by:	The FreeBSD Foundation
2015-06-21 06:28:26 +00:00
marcel
e4538d7f16 MFC 279125, 279126, 279128, 279139:
Add the -c option for specifying the capacity of the disk image.
  Bump the version to 20150222.
2015-06-17 19:03:32 +00:00
marcel
a0f8d115dc MFC 284165:
Move contrib/top/top.X to contrib/top/top.xs and move
contrib/top/top.local.H to contrib/top/top.local.hs.
Change the makefile accordingly.
2015-06-17 02:30:12 +00:00
tuexen
07668b4c17 MFC r284351:
Simplify printaddr(). No functional change.

MFC r284352:
Allow more than one socket entry for a file descriptor. This is needed
for supporting 1-to-many style SCTP sockets. For other sochets, there
is no functional change.

MFC r284353:
Allow more than one local or remote address per socket. This is needed to
support SCTP (and MPTCP in the future). No functional change for existing
protocols.

MFC r284354:
Add support for SCTP.

MFC r284355:
When using -L the code skips a socket if the local or foreign
address is loopback. So it is shown if both are not loopback.
The man page says that it is shown if the local or foreign
address is not loopback. Change the man page to reflect the
code.
2015-06-16 08:36:57 +00:00
eadler
557b40c187 MFC r283001:
ssh-copy-id: Add missing line continuation

PR:		194301
Requested by:	tuexen
2015-06-10 01:17:14 +00:00
jhb
017f11d1f3 MFC 281887:
Reassign copyright statements on several files from Advanced
Computing Technologies LLC to Hudson River Trading LLC.
2015-06-02 19:20:39 +00:00
jhb
cb2edec922 MFC 281266:
Move the 32-bit compatible procfs types from freebsd32.h to <sys/procfs.h>
and export them to userland.
- Define __HAVE_REG32 on platforms that define a reg32 structure and check
  for this in <sys/procfs.h> to control when to export prstatus32, etc.
- Add prstatus32_t and prpsinfo32_t typedefs for the 32-bit structures.
  libbfd looks for these types, and having them fixes 'gcore' in gdb of a
  32-bit process on a 64-bit platform.
- Use the structure definitions from <sys/procfs.h> in gcore's elf32 core
  dump code instead of duplicating the definitions.
2015-06-02 14:54:53 +00:00
jhb
c89b9bba43 MFC 269128:
Create 32-bit core files for 32-bit processes on 64-bit machines.
The 64-bit machine supported right now is amd64, but it's not too
hard to add powerpc64.
2015-06-02 13:07:22 +00:00
tuexen
1fcb0f4ab0 MFC r281202:
The code says "or", not "either or". So fix the documentation.
2015-05-29 13:30:37 +00:00
emaste
0895f35cb3 MFC r276774: ar: Avoid null pointer deref while reading corrupt archives
ELF Tool Chain ticket #467

Reported by:	Alexander Cherepanov <cherepan@mccme.ru>
Sponsored by:	The FreeBSD Foundation
2015-05-21 13:30:10 +00:00
delphij
8786fdbe9d MFC r281959,282885 (fanf, partial),282888 (fanf):
Try alternate addresses more agressively.

PR:             158125
Submitted by:   Mark Andrews <marka isc org> (with changes from me)

whois: code cleanup

Use pedantically correct types.

whois: do not clobber command-line flags when tweaking O_NONBLOCK

This can make whois fail to follow referrals when it should.
The bug was introduced in r281959.
2015-05-18 21:27:46 +00:00
trasz
0cc31562c3 MFC r274720:
Fix improper .Fx macro usage.

Sponsored by:	The FreeBSD Foundation
2015-05-15 09:56:59 +00:00
bapt
922efd3e5f MFC: r282437, r282438, r282439, r282462, r282463, r282464, r282466, r282467,
r282468, r282609

Update the list of known roff commands (both from NetBSD and heirloom doctools)
Improve memory checking
Remove limitation on input lines by using getline(3)
2015-05-15 09:00:20 +00:00
bapt
f6f70cc6de MFC: r282449, r282450, r282451, r282452, r282453, r282454, r282455, r282457,
r282459, r282460, r282461

Modernize code: ansification, use c99 features
Improve style(9)
Better memory checking
2015-05-15 08:53:52 +00:00