Commit Graph

11874 Commits

Author SHA1 Message Date
Edward Tomasz Napierala
d051ac804a Make it clear that 'swapuse' is swap reservation and not actual swap usage.
MFC after:	1 month
Sponsored by:	The FreeBSD Foundation
2015-09-14 15:37:19 +00:00
Mark Johnston
9eddb899d9 Use a common subroutine to fetch and zero protocol stats instead of
duplicating roughly similar code for each protocol.

MFC after:	2 weeks
2015-09-11 04:37:01 +00:00
Mark Johnston
2bdd6ea2ad Remove prototypes for undefined functions from netstat.h. 2015-09-11 04:02:05 +00:00
Mark Johnston
d73ce4c698 Remove the v_cache_min and v_cache_max sysctls. They are unused and have
no effect.

Reviewed by:	alc
Sponsored by:	EMC / Isilon Storage Division
2015-09-11 03:00:20 +00:00
Xin LI
60b0aa6a8f login.c doesn't really need libutil.h, don't include it.
login_fbtab.c includes paths.h and pathnames.h, and pathnames.h includes
paths.h.  Eliminate the paths.h inclusion in login_fbtab.c.

MFC after:	2 weeks
2015-09-10 22:25:40 +00:00
Xin LI
1e902b3b7e - 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.

MFC after:	2 weeks
2015-09-10 22:07:52 +00:00
Xin LI
ab9cee11d6 w(1) is not setgid binary since r53279, so remove the setgid() call.
Reviewed By:	wollman
MFC after:	2 weeks
Differential Revision: https://reviews.freebsd.org/D3541
2015-09-09 05:17:04 +00:00
Allan Jude
dafe59a9ec Fix inverted output re: stack protection no-execute flag in procstat(1)
PR:		196110
Submitted by:	Joerg Pernfuss <code.jpe@gmail.com>
Approved by:	bapt (mentor)
MFC after:	2 weeks
Differential Revision:	https://reviews.freebsd.org/D3576
2015-09-06 17:47:03 +00:00
Allan Jude
3491f5d422 Fix build error on gcc platforms
Approved by:	bapt (mentor)
2015-09-05 19:28:41 +00:00
Allan Jude
474b62b876 Introduce libxo to procstat(1)
Reviewed by:	rodrigc, bapt
Approved by:	marcel (mentor)
Relnotes:	yes
Sponsored by:	ScaleEngine Inc.
Differential Revision:	https://reviews.freebsd.org/D2446
2015-09-05 17:02:01 +00:00
Marcelo Araujo
aa44f2ed5e Rename YP to NIS in the manpages.
Approved by:		bapt (mentor)
Differential Revision:	D3555
2015-09-03 07:18:52 +00:00
Hiroki Sato
81dacd8beb Simplify kvm symbol resolution and error handling. The symbol table
nl_symbols will eventually be organized into several modules depending
on MK_* variables.
2015-09-02 18:51:36 +00:00
Hiroki Sato
a261e36179 Divide statistics in the number of packets with 1000 instead of 1024
in human-readable form.

PR:	183598
2015-09-02 18:42:35 +00:00
Hiroki Sato
10d5269ff9 - Add -W flag support for network column in intpr() (-i flag) and
routepr() (-r flag).  It is too narrow to show an IPv6 prefix
  in most cases.

- Accept "local" as a synonym of "unix" in protocol family name.

- Show a prefix length in CIDR notation when name resolution failed in
  netname().

- Make routename() and netname() AF-independent and remove
  unnecessary typecasting from struct sockaddr.

- Use getnameinfo(3) to format L2 addr in intpr().

- Fix a bug which showed "Address" when -A flag is specfied in pr_rthdr().

- Replace cryptic GETSA() macro with SA_SIZE().

- Fix declarations shadowing local variables with the same names.

- Add more static, remove unused header files and variables.

MFC after:	1 week
2015-09-01 08:42:04 +00:00
Xin LI
0a107daff7 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.

MFC after:	3 days
2015-09-01 06:28:16 +00:00
Xin LI
a4a889a0ef Failure of dropping privilege should be fatal, so test and bail out
when setgid() fails.

Reported by:	clang static analyzer
MFC after:	2 weeks
2015-09-01 06:05:43 +00:00
Ed Maste
a1f0b4cf95 vtfontcvt: fix buffer overflow for non-default size .hex fonts
Sponsored by:	The FreeBSD Foundation
2015-09-01 01:35:43 +00:00
Ed Maste
2e268aa950 vtfontcvt: introduce xmalloc to abort on out-of-memory
Sponsored by:	The FreeBSD Foundation
2015-08-31 23:08:39 +00:00
Ed Maste
a84c4d189b ar: Deobfuscate a while loop 2015-08-31 18:07:17 +00:00
Ed Maste
a64a36e280 ar: fix deterministic mode when running as ranlib
This was broken by r286024.

PR:		202741
Submitted by:	fk@fabiankeil.de
Obtained from:	ElectroBSD
2015-08-31 12:28:13 +00:00
Xin LI
32e49abef0 - uri is expected to be nul-terminated (strchr used later),
so use strlcpy instead of strncpy.
 - unroll the other two cases of strncpy+\0 to strlcpy.

MFC after:	2 weeks
2015-08-31 06:11:39 +00:00
Xin LI
670f01434e Constify opt_f and opt_t and eliminate unneeded copying. This fixes
memory leaks.

Reported by:	clang static analyzer
MFC after:	2 weeks
2015-08-31 05:57:26 +00:00
Michael Tuexen
0835304fea Use the userland exported states and handle them completely. 2015-08-29 09:27:29 +00:00
Michael Tuexen
c1eb13c74c Report CLOSED as state for bound sockets for consistency with
netstat and the way TCP is handled.

PR:		201585
MFC after:	3 weeks
2015-08-29 09:10:52 +00:00
John-Mark Gurney
e7ae88eeda add documentation for timers that silby added in r197244, almost 6 years
ago...
2015-08-27 19:12:42 +00:00
Ed Schouten
bc1ace0b96 Decompose linkat()/renameat() rights to source and target.
To make it easier to understand how Capsicum interacts with linkat() and
renameat(), rename the rights to CAP_{LINK,RENAME}AT_{SOURCE,TARGET}.

This also addresses a shortcoming in Capsicum, where it isn't possible
to disable linking to files stored in a directory. Creating hardlinks
essentially makes it possible to access files with additional rights.

Reviewed by:	rwatson, wblock
Differential Revision:	https://reviews.freebsd.org/D3411
2015-08-27 15:16:41 +00:00
Alexander Kabaev
93f422607b Unbreak nvi message catalog generation for 8 bit locales.
Feeding any file encoded in 8 bit locales such as KOI8-RU
to sort utility running under UTF-8 locale produces astonishing
result of recoding the output to UTF-8. To counter that, just
run sort under 'C' locale for now.
2015-08-27 14:00:16 +00:00
Michael Tuexen
6414db1bc4 Add SCTP support.
PR:		201585
MFC after:	3 weeks
2015-08-26 23:45:06 +00:00
Michael Tuexen
6eb1d5ba64 Remove a variable which is set but never used.
PR:		201585
MFC after:	3 weeks
2015-08-26 22:52:18 +00:00
Michael Tuexen
4e13a5b043 Print the status on the first line of a socket description, not at
the last one. This doesn't matter for TCP, but it does for the upcoming
SCTP support.

PR:		201585
MFC after:	3 weeks
2015-08-26 22:50:53 +00:00
Sergey Kandaurov
d7deff23cd Fix SEE ALSO.
The history mechanism applies to csh.

Sponsored by:	Nginx, Inc.
2015-08-26 11:54:40 +00:00
Marcelo Araujo
58458d066f Sync ypwhich(1) code with the OpenBSD version that is more modern.
Update the BSD LICENSE and remove the 3rd clause.

Reviewed by:	rodrigc, kib, bapt
Approved by:	bapt (mentor)
Obtained from:	OpenBSD
Differential Revision:	D3249
2015-08-25 15:27:32 +00:00
Xin LI
f2f9b434b6 Finish r89633 and completely remove the remaining of VERSION.
PR:		bin/202308
Submitted by:	John Hein <z7dr6ut7gs snkmail com>
MFC after:	2 weeks
2015-08-25 05:31:00 +00:00
Marcel Moolenaar
d1a0d267b7 Upgrade libxo to 0.4.5.
Local changes incorporated by 0.4.5: r284340
Local changes retained: r276260, r282117

Obtained from:	https://github.com/Juniper/libxo
2015-08-24 16:26:20 +00:00
Xin LI
9242719ed3 Although the website [1] says US-ASCII is accepted, ISO-8859-1 seems to
be the only accepted character that is close enough to US-ASCII (and
this is also done on OpenBSD; the alternative would be to use UTF-8).

[1] http://www.denic.de/en/domains/technik/denic_whois-server/index.html

MFC after:	2 weeks
2015-08-23 08:22:00 +00:00
Enji Cooper
46e352ca51 Fix the racy xargs -P0 -n2 test added in r286289
Sort the output obtained from xargs and the expected output
to ensure the end result versus the input file is stable

Differential Revision: D3432
Submitted by: Nikolai Lifanov <lifanov@mail.lifanov.com>
2015-08-21 18:42:57 +00:00
Enji Cooper
3cfe782429 Disable the -P0 test
It's unreliable (sometimes it passes, sometimes it fails)

Reported by: Jenkins (many times over the past few weeks)
2015-08-21 17:47:17 +00:00
John Baldwin
68055893c1 Handle the conditional decoding of execve() argument and environment
arrays generically rather than duplicating a hack in all of the backends.
- Add two new system call argument types and use them instead of StringArray
  for the argument and environment arguments execve and linux_execve.
- Honor the -a/-e flags in the handling of these new types.
- Instead of printing "<missing argument>" when the decoding is disabled,
  print the raw pointer value.
2015-08-20 14:51:11 +00:00
John Baldwin
890843c15b Rework the argv and env string fetching for execve to be more robust.
Before truss would fetch 100 string pointers and happily walk off the end
of the array if it never found a NULL.  This also means for a short argv
list it could fail entirely if the 100 string pointers spanned into an
unmapped page.

Instead, fetch page-aligned blocks of string pointers in a loop fetching
each string until a NULL is found.

While here, make use of the open memstream file descriptor instead of
allocating a temporary array.  This allows us to fetch each string once
instead of twice.
2015-08-20 14:33:30 +00:00
John Baldwin
b38fbc2e54 ino_t is unsigned, so use uintmax_t instead of intmax_t when printing it.
Submitted by:	bde (sort of)
2015-08-19 20:10:58 +00:00
John Baldwin
a143677385 Always use %j with an intmax_t cast to print time_t values. time_t is
longer than long on 32-bit platforms with a 64-bit time_t.

Inspired by:	mail from bde
2015-08-19 20:09:14 +00:00
John Baldwin
4e3da534fc Various style and whitespace fixes. 2015-08-19 20:02:03 +00:00
John Baldwin
9346bf6f4a Use nitems(). 2015-08-19 19:59:42 +00:00
John Baldwin
c915ff0349 Expand the decoding of kevent structures.
- Print the ident value as decimal instead of hexadecimal for filter types
  that use "small" values such as file descriptors and PIDs.
- Decode NOTE_* flags in the fflags field of kevents for several system
  filter types.
2015-08-19 01:44:56 +00:00
John Baldwin
f083f6894c Change the argument formatting function to use a stdio FILE object opened
with open_memstream() to build the string for each argument.  This allows
for more complicated argument building without resorting to intermediate
malloc's, etc.

Related, the strsig*() functions no longer return allocated strings but
use a static global buffer instead.
2015-08-19 00:49:50 +00:00
Pedro F. Giffuni
c8060fafd4 Correct All Saints' day.
Thanks to:	zec
X-MFC with:	r286891
2015-08-18 15:50:02 +00:00
Pedro F. Giffuni
b542033478 Calendar: add a few more dates to the Christian calendar
The many christian denominations have different dates for their
celebrations and controversies are likely to be always.

These are well established and happen to be holidays in many
Catholic countries.

MFC after:	1 month
2015-08-18 15:11:41 +00:00
Christian Brueffer
520bb99704 RIP Stefan Farfeleder (stefanf), committer since 2004.
You will be missed!
2015-08-18 12:27:21 +00:00
John Baldwin
e462b12755 Use an xlat table and xlookup() instead of a home-rolled version for the
sigprocmask operation type.
2015-08-17 19:08:48 +00:00
John Baldwin
fb7eabb0bf Tidy the linux_socketcall decoding:
- Don't exit if get_struct() fails, instead print the raw pointer value to
  match all other argument decoding cases.
- Use an xlat table instead of a home-rolled switch for the operation name.
- Display the nested socketcall args structure as a structure instead of as
  two inline arguments.
2015-08-17 18:47:39 +00:00