Commit Graph

7705 Commits

Author SHA1 Message Date
Craig Rodrigues
7ca26e3831 Add missing include to eliminate -Wmissing-prototypes warnings 2015-09-20 03:49:08 +00:00
Craig Rodrigues
cfb65fa249 Add missing includes to eliminate -Wmissing-prototypes warnings 2015-09-20 03:45:57 +00:00
Hiroki Sato
bb957021d7 Add PF_LOCAL support in getaddrinfo(3) and getnameinfo(3):
- In a PF_LOCAL address, "hostname" must begins with '/' and "servname"
  is always NULL.  All of ai_flags are ignored.

- PF_UNSPEC matches PF_LOCAL.  EAI_SERVICE is not returned to make
  AF-independent programming easier; "servname" is always ignored
  in PF_LOCAL.  In practice, PF_INET* and PF_LOCAL are
  mutually-exclusive because a hostname which begins with '/' is invalid
  in PF_INET*.  No domain name resolution is performed for a PF_LOCAL address.

Differential Revision:	https://reviews.freebsd.org/D3634
2015-09-20 01:09:23 +00:00
Jilles Tjoelker
1c0046d792 libc: Consistently call _ioctl() internally, not ioctl(). 2015-09-19 20:27:09 +00:00
Xin LI
ac1a32b454 There is no HP 300 support in FreeBSD anymore, so remove the obsolete
BUGS section.

While I'm there also bump Dd date.

MFC after:	2 weeks
2015-09-18 20:28:37 +00:00
Edward Tomasz Napierala
0d3d0cc358 Kernel part of reroot support - a way to change rootfs without reboot.
Note that the mountlist manipulations are somewhat fragile, and not very
pretty.  The reason for this is to avoid changing vfs_mountroot(), which
is (obviously) rather mission-critical, but not very well documented,
and thus hard to test properly.  It might be possible to rework it to use
its own simple root mount mechanism instead of vfs_mountroot().

Reviewed by:	kib@
MFC after:	1 month
Sponsored by:	The FreeBSD Foundation
Differential Revision:	https://reviews.freebsd.org/D2698
2015-09-18 17:32:22 +00:00
Bryan Drewery
42c4cf86d4 Update META_MODE dependencies. 2015-09-17 05:06:34 +00:00
Craig Rodrigues
e263ec16a9 Use unsigned variables in a few places.
Eliminates gcc 4.9 warnings.
2015-09-14 18:59:01 +00:00
Craig Rodrigues
76470dd50e Use ANSI C prototypes.
Eliminates gcc 4.9 warnings.
2015-09-14 18:44:13 +00:00
Jilles Tjoelker
636b8d937e db/recno: Open with close-on-exec like btree and hash do. 2015-09-13 17:17:52 +00:00
Jilles Tjoelker
6b46581ed9 setuid(2): Suggest O_CLOEXEC instead of fcntl(F_SETFD). 2015-09-13 14:00:49 +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
Michael Tuexen
14914827f0 Zero out a local variable also when PURIFY is not defined.
This silence a warning brought up by valgrind whenever if_nametoindex
is used. This was already discussed in PR 166483, but the code
committed in r234329 guards the initilization with #ifdef PURIFY.
Therefore, valgrind still complains. Since this code is not performance
critical, always zero out the local variable to silence valgrind.

PR:		166483
Discussed with:	eadler@
MFC after:	4 weeks
2015-09-10 10:23:23 +00:00
Hiroki Sato
f9f9625d18 - Fix SIGSEGV when sa == NULL. NULL check in getnameinfo_inet()
did not work as expected.

- Simplify afdl table lookup.

MFC after:	3 days
2015-09-09 09:19:07 +00:00
Andrew Turner
b5e4c5c456 Enable mincore_test on arm64, we now have a working pmap_mincore.
PR:		202307
Obtained from:	ABT Systems Ltd
Sponsored by:	The FreeBSD Foundation
2015-09-08 18:44:12 +00:00
Edward Tomasz Napierala
45d55945fd Make it possible to use acl_create_entry_np(3) to use first entry to an
empty ACL, and to append an entry to an ACL.

Submitted by:	sef@
MFC after:	1 month
Sponsored by:	The FreeBSD Foundation
2015-09-08 14:52:14 +00:00
Xin LI
28ffe927c2 Expose an interface to determine if an ACE is inherited.
Submitted by:	sef
Reviewed by:	trasz
MFC after:	2 weeks
Differential Revision:	https://reviews.freebsd.org/D3540
2015-09-04 00:14:20 +00:00
Edward Tomasz Napierala
8e6acc531a Fix acl_strip_np(3) breakage introduced in r279962.
MFC after:	1 month
Sponsored by:	The FreeBSD Foundation
2015-09-03 11:31:34 +00:00
Edward Tomasz Napierala
b0f957f94a Fix the way acl_init(3) uses posix_memalign(3) - the latter doesn't
set errno.

MFC after:	1 month
Sponsored by:	The FreeBSD Foundation
2015-09-03 11:30:39 +00:00
Hiroki Sato
34e38a56b0 - snprintf() returns at most size-1 of the chars printed into
the buffer.  (n == hostlen) also means the buffer length was
  too short.

- Use sdl->sdl_data only when (sdl->sdl_nlen > 0 && sdl->sdl_alen == 0)
  to prevent redundant output.
2015-09-02 16:50:49 +00:00
Konstantin Belousov
3cc31a047e Fix t_spawnattr test for attributes handling by posix_spawn(3).
Connect it to the build.

The code assumed that SCHED_* constants form a contiguous set of
numbers, remove the assumption by using schedulers[] array in
get_different_scheduler().  This is no-op on FreeBSD, but improves
code portability.

The selection of different priority used the min/max priority range of
the current scheduler class, instead of the priority to be changed to.
The bug caused the test failure.

Remove duplication of POSIX_SPAWN_SETSIGDEF flag and now unused
duplications of MIN/MAX definitions.

Reviewed by:	jilles, pho
Sponsored by:	The FreeBSD Foundation
MFC after:	1 week
Differential Revision:	https://reviews.freebsd.org/D3533
2015-09-01 12:47:11 +00:00
Craig Rodrigues
5dfef00190 Use unsigned variable.
Eliminates gcc 4.9 compiler warning.
2015-09-01 09:22:24 +00:00
Craig Rodrigues
7760154342 Use ANSI C prototypes.
Eliminates gcc 4.9 warnings.
2015-09-01 08:34:44 +00:00
Hiroki Sato
27a1ccfc19 Print sdl->sdl_data when sdl->sdl_nlen > 0 as link_ntoa(3) does.
MFC after:	1 week
2015-09-01 08:29:39 +00:00
Craig Rodrigues
929d5af546 Use correct function prototype for signal handler.
Eliminates gcc 4.9 warning.
2015-09-01 07:33:36 +00:00
Craig Rodrigues
a7c2cd38d4 Use ANSI C prototypes.
Eliminates gcc 4.9 warnings.
2015-09-01 07:32:03 +00:00
Craig Rodrigues
084bc321f2 Mark unused parameters to reduce gcc 4.9 warnings. 2015-09-01 02:42:05 +00:00
Craig Rodrigues
68895e384f Use ANSI C prototypes.
Eliminates gcc 4.9 warnings.
2015-09-01 02:39:07 +00:00
Craig Rodrigues
695ba2f98a Include stdlib.h to get devname() prototype.
Eliminates -Wmissing-prototypes warnings with gcc
2015-08-31 19:40:54 +00:00
Konstantin Belousov
3ea917837d Fix a mistake in r287292. Despite correctly stating intent in the
comment above, POSIX_SPAWN_SETSIGMASK and POSIX_SPAWN_SETSIGDEF
handlers used libthr interposed functions instead of syscalls.

Noted by:	jilles
Sponsored by:	The FreeBSD Foundation
MFC after:	6 days
2015-08-30 04:46:44 +00:00
Konstantin Belousov
bd6060a1c6 Switch libc from using _sig{procmask,action,suspend} symbols, which
are aliases for the syscall stubs and are plt-interposed, to the
libc-private aliases of internally interposed sigprocmask() etc.

Since e.g. _sigaction is not interposed by libthr, calling signal()
removes thr_sighandler() from the handler slot etc.  The result was
breaking signal semantic and rtld locking.

The added __libc_sigprocmask and other symbols are hidden, they are
not exported and cannot be called through PLT.  The setjmp/longjmp
functions for x86 were changed to use direct calls, and since
PIC_PROLOGUE only needed for functional PLT indirection on i386, it is
removed as well.

The PowerPC bug of calling the syscall directly in the setjmp/longjmp
implementation is kept as is.

Reported by:	Pete French <petefrench@ingresso.co.uk>
Tested by:	Michiel Boland <boland37@xs4all.nl>
Reviewed by:	jilles (previous version)
Sponsored by:	The FreeBSD Foundation
MFC after:	1 week
2015-08-29 14:25:01 +00:00
Xin LI
cad56660e5 Replace strndup with OpenBSD's implementation.
MFC after:	2 weeks
2015-08-26 23:28:10 +00:00
Ed Schouten
57c69b1478 Make UTF-8 parsing and generation more strict.
- in mbrtowc() we need to disallow codepoints above 0x10ffff.
- In wcrtomb() we need to disallow codepoints between 0xd800 and 0xdfff.

Reviewed by:	bapt
Differential Revision:	https://reviews.freebsd.org/D3399
2015-08-25 09:16:09 +00:00
Xin LI
34103b3cac Instead of doing an no-op (|= 0), actually clear the flags in
acl_clear_flags_np.

MFC after:	2 weeks
2015-08-24 04:49:20 +00:00
Marcelo Araujo
60ffbe65f7 Fix spelling.
Reviewed by:		wblock, pfg
Approved by:		bapt (mentor)
Differential Revision:	D3380
2015-08-24 01:53:18 +00:00
Marcelo Araujo
f0788bbfe1 Update bzero(3) manpage to following the Posix Standard.
Reviewed by:		wblock, pfg
Approved by:		bapt (mentor)
Differential Revision:	D3380
2015-08-24 01:51:10 +00:00
Benjamin Kaduk
328b9e0bca Editing pass on procctl.2
Spell "descendant" correctly.

Grammar fixes.

Use correct width argument to Bl.

Use Po and Pc to avoid leaving a dangling '(' on the end of a line.
2015-08-21 02:42:14 +00:00
Konstantin Belousov
41d50cd6b7 If process becomes reaper (procctl(PROC_REAP_ACQUIRE)) while already
having some children, the children' reaper is not reset to the parent.
This allows for the situation where reaper has children but not
descendands and the too strict asserts in the reap_status() fire.

Remove the wrong asserts, add some clarification for the situation to
the procctl(2) REAP_STATUS.

Reported and tested by:	feld
Sponsored by:	The FreeBSD Foundation
MFC after:	1 week
2015-08-20 22:44:26 +00:00
Andrew Turner
ccee502763 Add the definitions of __infinity and __nan. 2015-08-20 13:11:52 +00:00
Conrad Meyer
971c424c7e getrlimit.2: Document RSS, AS/VMEM limit behavior more clearly
Alphabetize the RLIMIT_ list while here.

Reviewed by:	jilles (previous version), wblock (previous version)
Approved by:	markj (mentor)
Sponsored by:	EMC / Isilon Storage Division
Differential Revision:	https://reviews.freebsd.org/D3433
2015-08-20 00:00:15 +00:00
Jilles Tjoelker
89cead337a wordexp(): Improve some error codes.
Distinguish between WRDE_BADVAL and WRDE_SYNTAX based on when the error
occurred (parsing or execution), not based on whether WRDE_UNDEF was passed.

Also, return WRDE_NOSPACE for a few more unexpected results from sh.
2015-08-19 20:31:03 +00:00
Xin LI
8823d24b48 - ANSIfy
- Remove the redundant _PATH_RSH definition (paths.h at r96194);
 - Use pid_t for PIDs
 - Note that we are at the same level of OpenBSD's counterpart of
   revision 1.7 (r94757).

No functional changes.

MFC after:	2 weeks
2015-08-18 22:37:25 +00:00
Jilles Tjoelker
2e8a071293 wordexp(3): Update man page for no longer using the wordexp builtin. 2015-08-18 20:13:36 +00:00
Jason Evans
902d2afd2a Add missing sdallocx updates and remove *allocm manpage links.
Submitted by:	jbeich
2015-08-18 08:18:28 +00:00
Jason Evans
d0e79aa362 Update jemalloc to version 4.0.0. 2015-08-18 00:21:25 +00:00
Ed Maste
5e3cac3e57 On arm64 disable three tests that hang or panic
Each issue has a PR open to track. This workaround allows us to run the
tests to investigate the failures and avoid any new regressions.

PR:		202304, 202305, 202307
Reviewed by:	ngie
Sponsored by:	The FreeBSD Foundation
Differential Revision:	https://reviews.freebsd.org/D3378
2015-08-17 23:19:36 +00:00
Jilles Tjoelker
842ad8ac0b wordexp(): Stop using the undocumented wordexp builtin.
The functionality of the wordexp builtin is easily replaced using normal
shell code, although performance is slightly worse.

This does not mean that wordexp() will remain shell-independent -- a fully
reliable implementation of WRDE_NOCMD is really only possible using
extensions to the shell, or by adding much of the shell's code to libc.
2015-08-16 19:42:15 +00:00
Pedro F. Giffuni
842898ceec Remove a stale comment and clarify the original where it was taken from
The comment in the libc/sys symbol map referenced the generated symbols
for the syscall trampolines. Such comment was out of place in the secure
symbol map so remove the stale comment and attempt to clarify the old one
to avoid risks of confusion.

Pointed out by:	kib
2015-08-14 14:58:04 +00:00
Pedro F. Giffuni
fe0d386cf3 Move the stack protector to a new "secure" directory
As part of the code refactoring to support FORTIFY_SOURCE we want
a new subdirectory "secure" to keep the files related to security.
Move the stack protector functions to this new directory.

No functional change.

Differential Review:	https://reviews.freebsd.org/D3333
2015-08-14 03:03:13 +00:00
Marcelo Araujo
6a182dddd9 Make clear the bcopy(3) manpage regards when it was marked as LEGACY
as well as when it was removed from POSIX specification.

Reviewed by:		theraven, wblock, bapt, rodrigc
Approved by:		bapt, rodrigc (mentor)
Differential Revision:	D3374
2015-08-14 01:27:30 +00:00