summaryrefslogtreecommitdiffstats
path: root/lib
Commit message (Collapse)AuthorAgeFilesLines
* Compile contrib/tzcode/stdtime/localtime.c with -fwrapv, since it reliesdim2013-03-241-0/+3
| | | | | | | | | | | | | on signed integer overflow wrapping. Otherwise mktime(3) and timegm(3) can hang, in case the timestamp passed in struct tm is not representable in a time_t. Specifically, any timestamp after 2038-01-19 03:14:07, in combination with a 32-bit time_t. Note that it would be better to change the code to not rely on undefined behaviour, but it is contributed code, and it is not entirely trivial to fix the issue properly. MFC after: 3 days
* libdwarf: anonymous types are expected to have empty type names...avg2013-03-231-3/+1
| | | | | | | or no type attributes at all. This is according to DWARF specification. MFC after: 13 days
* MFV r248590,248594:mm2013-03-223-11/+69
| | | | | | | | | | | Update libarchive to 3.1.2 Some of new features: - support for lrzip and grzip compression - support for writing tar v7 format - b64encode and uuencode filters - support for __MACOSX directory in Zip archives - support for lzop compresion (external utility)
* Document chflagsat(2).pjd2013-03-213-3/+54
| | | | Obtained from: jilles
* Implement chflagsat(2) system call, similar to fchmodat(2), but operates onpjd2013-03-211-0/+1
| | | | | | | file flags. Reviewed by: kib, jilles Sponsored by: The FreeBSD Foundation
* - Make 'flags' argument to chflags(2), fchflags(2) and lchflags(2) of typepjd2013-03-211-3/+3
| | | | | | | | | | | u_long. Before this change it was of type int for syscalls, but prototypes in sys/stat.h and documentation for chflags(2) and fchflags(2) (but not for lchflags(2)) stated that it was u_long. Now some related functions use u_long type for flags (strtofflags(3), fflagstostr(3)). - Make path argument of type 'const char *' for consistency. Discussed on: arch Sponsored by: The FreeBSD Foundation
* Allow O_CLOEXEC in posix_openpt() flags.jilles2013-03-211-2/+7
| | | | | PR: kern/162374 Reviewed by: ed
* Implement SOCK_CLOEXEC, SOCK_NONBLOCK and MSG_CMSG_CLOEXEC.jilles2013-03-193-4/+27
| | | | | | | | | | | | | | | | | | | This change allows creating file descriptors with close-on-exec set in some situations. SOCK_CLOEXEC and SOCK_NONBLOCK can be OR'ed in socket() and socketpair()'s type parameter, and MSG_CMSG_CLOEXEC to recvmsg() makes file descriptors (SCM_RIGHTS) atomically close-on-exec. The numerical values for SOCK_CLOEXEC and SOCK_NONBLOCK are as in NetBSD. MSG_CMSG_CLOEXEC is the first free bit for MSG_*. The SOCK_* flags are not passed to MAC because this may cause incorrect failures and can be done later via fcntl() anyway. On the other hand, audit is expected to cope with the new flags. For MSG_CMSG_CLOEXEC, unp_externalize() is extended to take a flags argument. Reviewed by: kib
* There are actually two different cases when mlock(2) returnsglebius2013-03-191-2/+7
| | | | | | ENOMEM. Clarify this, taking text from SUS. Reviewed by: kib
* Simplify the assignment of memory to virtual machines by requiring a singleneel2013-03-182-21/+95
| | | | | | | | | | | | | | | | | | command line option "-m <memsize in MB>" to specify the memory size. Prior to this change the user needed to explicitly specify the amount of memory allocated below 4G (-m <lowmem>) and the amount above 4G (-M <highmem>). The "-M" option is no longer supported by 'bhyveload' and 'bhyve'. The start of the PCI hole is fixed at 3GB and cannot be directly changed using command line options. However it is still possible to change this in special circumstances via the 'vm_set_lowmem_limit()' API provided by libvmmapi. Submitted by: Dinakar Medavaram (initial version) Reviewed by: grehan Obtained from: NetApp
* Add restrict keyword to realpath manpage.kevlo2013-03-181-1/+1
|
* Add a note to the HISTORY section about lchflags(2) being introduced inpjd2013-03-161-0/+4
| | | | FreeBSD 5.0.
* Make this more compilable.glebius2013-03-151-8/+7
|
* Update to the latest (un)vis(3) sources from NetBSD. This addsbrooks2013-03-142-2/+18
| | | | | | | | | | | | | multibyte support[0] and the new functions strenvisx and strsenvisx. Add MLINKS for vis(3) functions add by this and the initial import from NetBSD[1]. PR: bin/166364, bin/175418 Submitted by: "J.R. Oldroyd" <fbsd@opal.com>[0] stefanf[1] Obtained from: NetBSD MFC after: 2 weeks
* When pidptr was passed as NULL to pidfile_open(3), we were returningpjd2013-03-141-13/+18
| | | | | | | | | EAGAIN/EWOULDBLOCK when another daemon was running and had the pidfile open. We should return EEXIST in that case, fix it. Reported by: Dirk Engling <erdgeist@erdgeist.org> Reviewed by: jhb, Dirk Engling <erdgeist@erdgeist.org> MFC after: 1 week
* libc: Avoid SIGPIPE when nscd closes the connection unexpectedly.jilles2013-03-131-4/+5
| | | | | | | | | It is almost always a bug if nscd closes the connection unexpectedly but programs should not be killed with SIGPIPE for it. Reviewed by: bushman Tested by: Jan Beich MFC after: 1 week
* Link getcontextx(3) to getcontext(3).pluknet2013-03-131-0/+1
| | | | | Reviewed by: kib MFC after: 1 week
* Add the getcontextx prototype to SYNOPSIS.pluknet2013-03-131-1/+3
| | | | | Reviewed by: kib MFC after: 1 week
* - Make the FreeBSD's USB library compile under Linux.hselasky2013-03-1314-30/+151
| | | | | | | - Fix a compile warning where the return value of a call to a write() function was ignored. - Remove redundant include files from userland USB header files. - Add some now needed include files to various C-files.
* Fix for quite a special case when userland emulates a netgraph node, andglebius2013-03-111-1/+1
| | | | | | | | userland can reply to a message with NGM_HASREPLY bit set. In this case we should not wait for a response to a responce. PR: 176771 Submitted by: Keith Reynolds <keith.reynolds tidalscale.com>
* commit correct tested fix for gr_util.cdb2013-03-091-46/+58
| | | | Approved by: theraven
* Garbage collect NWFS and NCP bits which are now completely disconnectedattilio2013-03-0918-4292/+0
| | | | | | from the tree since few months. This patch is not targeted for MFC.
* Cleanup gr_add() so it does not leak memdb2013-03-072-53/+86
| | | | | | | | | This is part of ongoing work on sbin/pw M libutil.h M gr_util.c Approved by: theraven
* Add __clzsi2 and ctzsi2. They are required on ARMv4 and ARMv5 to implementandrew2013-03-071-0/+3
| | | | a number of builtin functions.
* Create a symlink from strchrnul.3 to strchr.3.zeising2013-03-061-1/+2
| | | | | | This was forgotten in the initial commit of strchrnul() Approved by: theraven
* Add a stub manpage modeled over the libexpat one to explain to users not to usebapt2013-03-052-0/+62
| | | | | | this library outside of base. Requested by: simon
* Import libyaml as libbsdyml (private brand name)bapt2013-03-043-0/+107
| | | | | | | LibYAML is a YAML 1.1 parser and emitter under MIT license which will soon be used by the pkg boostrap (usr.bin/pkg) and bhyve Reviewed by: roberto, antoine
* libedit: Revert r247683 to fix buildworld.jilles2013-03-031-0/+1
| | | | | I think r247683 is wrong because libedit.so actually uses symbols from libcurses.so. Since it breaks the build, revert it now.
* libedit does not need to be linked with ncursespfg2013-03-031-1/+0
| | | | | | | | libedit uses the terminfo headers but doesn't really need to be linked with ncurses. Discussed with: christos@NetBSD MFC after; 3 days
* - Implement two new system calls:pjd2013-03-025-0/+232
| | | | | | | | | | | | | | | | | | | | | | | | | int bindat(int fd, int s, const struct sockaddr *addr, socklen_t addrlen); int connectat(int fd, int s, const struct sockaddr *name, socklen_t namelen); which allow to bind and connect respectively to a UNIX domain socket with a path relative to the directory associated with the given file descriptor 'fd'. - Add manual pages for the new syscalls. - Make the new syscalls available for processes in capability mode sandbox. - Add capability rights CAP_BINDAT and CAP_CONNECTAT that has to be present on the directory descriptor for the syscalls to work. - Update audit(4) to support those two new syscalls and to handle path in sockaddr_un structure relative to the given directory descriptor. - Update procstat(1) to recognize the new capability rights. - Document the new capability rights in cap_rights_limit(2). Sponsored by: The FreeBSD Foundation Discussed with: rwatson, jilles, kib, des
* Garbage collect NTFS bits which are now completely disconnected fromattilio2013-03-021-71/+0
| | | | | | the tree since few months. This patch is not targeted for MFC.
* mdoc: remove superfluous paragraph macro.joel2013-03-023-3/+0
|
* Make this WARNS=9 clean on i386 w/ clang.marcel2013-03-021-15/+14
|
* Fix warnings (control reaches end of non-void function).marcel2013-03-021-1/+2
|
* Fix nandfs support by providing the same crc32 function as is usedmarcel2013-03-021-2/+23
| | | | | | in newfs_nandfs. In libstand we get crc32 from libz. The polynomial is not the same as used for nandfs, which is the crc32 used in the kernel.
* Merge Capsicum overhaul:pjd2013-03-0210-146/+584
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | - Capability is no longer separate descriptor type. Now every descriptor has set of its own capability rights. - The cap_new(2) system call is left, but it is no longer documented and should not be used in new code. - The new syscall cap_rights_limit(2) should be used instead of cap_new(2), which limits capability rights of the given descriptor without creating a new one. - The cap_getrights(2) syscall is renamed to cap_rights_get(2). - If CAP_IOCTL capability right is present we can further reduce allowed ioctls list with the new cap_ioctls_limit(2) syscall. List of allowed ioctls can be retrived with cap_ioctls_get(2) syscall. - If CAP_FCNTL capability right is present we can further reduce fcntls that can be used with the new cap_fcntls_limit(2) syscall and retrive them with cap_fcntls_get(2). - To support ioctl and fcntl white-listing the filedesc structure was heavly modified. - The audit subsystem, kdump and procstat tools were updated to recognize new syscalls. - Capability rights were revised and eventhough I tried hard to provide backward API and ABI compatibility there are some incompatible changes that are described in detail below: CAP_CREATE old behaviour: - Allow for openat(2)+O_CREAT. - Allow for linkat(2). - Allow for symlinkat(2). CAP_CREATE new behaviour: - Allow for openat(2)+O_CREAT. Added CAP_LINKAT: - Allow for linkat(2). ABI: Reuses CAP_RMDIR bit. - Allow to be target for renameat(2). Added CAP_SYMLINKAT: - Allow for symlinkat(2). Removed CAP_DELETE. Old behaviour: - Allow for unlinkat(2) when removing non-directory object. - Allow to be source for renameat(2). Removed CAP_RMDIR. Old behaviour: - Allow for unlinkat(2) when removing directory. Added CAP_RENAMEAT: - Required for source directory for the renameat(2) syscall. Added CAP_UNLINKAT (effectively it replaces CAP_DELETE and CAP_RMDIR): - Allow for unlinkat(2) on any object. - Required if target of renameat(2) exists and will be removed by this call. Removed CAP_MAPEXEC. CAP_MMAP old behaviour: - Allow for mmap(2) with any combination of PROT_NONE, PROT_READ and PROT_WRITE. CAP_MMAP new behaviour: - Allow for mmap(2)+PROT_NONE. Added CAP_MMAP_R: - Allow for mmap(PROT_READ). Added CAP_MMAP_W: - Allow for mmap(PROT_WRITE). Added CAP_MMAP_X: - Allow for mmap(PROT_EXEC). Added CAP_MMAP_RW: - Allow for mmap(PROT_READ | PROT_WRITE). Added CAP_MMAP_RX: - Allow for mmap(PROT_READ | PROT_EXEC). Added CAP_MMAP_WX: - Allow for mmap(PROT_WRITE | PROT_EXEC). Added CAP_MMAP_RWX: - Allow for mmap(PROT_READ | PROT_WRITE | PROT_EXEC). Renamed CAP_MKDIR to CAP_MKDIRAT. Renamed CAP_MKFIFO to CAP_MKFIFOAT. Renamed CAP_MKNODE to CAP_MKNODEAT. CAP_READ old behaviour: - Allow pread(2). - Disallow read(2), readv(2) (if there is no CAP_SEEK). CAP_READ new behaviour: - Allow read(2), readv(2). - Disallow pread(2) (CAP_SEEK was also required). CAP_WRITE old behaviour: - Allow pwrite(2). - Disallow write(2), writev(2) (if there is no CAP_SEEK). CAP_WRITE new behaviour: - Allow write(2), writev(2). - Disallow pwrite(2) (CAP_SEEK was also required). Added convinient defines: #define CAP_PREAD (CAP_SEEK | CAP_READ) #define CAP_PWRITE (CAP_SEEK | CAP_WRITE) #define CAP_MMAP_R (CAP_MMAP | CAP_SEEK | CAP_READ) #define CAP_MMAP_W (CAP_MMAP | CAP_SEEK | CAP_WRITE) #define CAP_MMAP_X (CAP_MMAP | CAP_SEEK | 0x0000000000000008ULL) #define CAP_MMAP_RW (CAP_MMAP_R | CAP_MMAP_W) #define CAP_MMAP_RX (CAP_MMAP_R | CAP_MMAP_X) #define CAP_MMAP_WX (CAP_MMAP_W | CAP_MMAP_X) #define CAP_MMAP_RWX (CAP_MMAP_R | CAP_MMAP_W | CAP_MMAP_X) #define CAP_RECV CAP_READ #define CAP_SEND CAP_WRITE #define CAP_SOCK_CLIENT \ (CAP_CONNECT | CAP_GETPEERNAME | CAP_GETSOCKNAME | CAP_GETSOCKOPT | \ CAP_PEELOFF | CAP_RECV | CAP_SEND | CAP_SETSOCKOPT | CAP_SHUTDOWN) #define CAP_SOCK_SERVER \ (CAP_ACCEPT | CAP_BIND | CAP_GETPEERNAME | CAP_GETSOCKNAME | \ CAP_GETSOCKOPT | CAP_LISTEN | CAP_PEELOFF | CAP_RECV | CAP_SEND | \ CAP_SETSOCKOPT | CAP_SHUTDOWN) Added defines for backward API compatibility: #define CAP_MAPEXEC CAP_MMAP_X #define CAP_DELETE CAP_UNLINKAT #define CAP_MKDIR CAP_MKDIRAT #define CAP_RMDIR CAP_UNLINKAT #define CAP_MKFIFO CAP_MKFIFOAT #define CAP_MKNOD CAP_MKNODAT #define CAP_SOCK_ALL (CAP_SOCK_CLIENT | CAP_SOCK_SERVER) Sponsored by: The FreeBSD Foundation Reviewed by: Christoph Mallon <christoph.mallon@gmx.de> Many aspects discussed with: rwatson, benl, jonathan ABI compatibility discussed with: kib
* Provide cap_sandboxed(3) function, which is a wrapper around cap_getmode(2)pjd2013-03-025-0/+124
| | | | | | | | | | | system call, which has a nice property - it never fails, so it is a bit easier to use. If there is no support for capability mode in the kernel the function will return false (not in a sandbox). If the kernel is compiled with the support for capability mode, the function will return true or false depending if the calling process is in the capability mode sandbox or not respectively. Sponsored by: The FreeBSD Foundation
* Fix assignment of maximum bounadary.delphij2013-03-011-1/+1
| | | | | | Submitted by: Sascha Wildner <saw online de> Obtained from: DragonFly rev fd39c81ba220f7ad6e4dc9b30d45e828cf58a1ad MFC after: 2 weeks
* Assign the len field of the netbuf structure to the current length ofkevlo2013-03-011-1/+1
| | | | | | a sockaddr. Obtained from: NetBSD
* Fixed documented prototype of kinfo_getproc(3).ru2013-03-011-2/+2
|
* mdoc: add missing El.joel2013-02-271-0/+1
|
* Add an implementation of open_memstream() and open_wmemstream(). Thesejhb2013-02-275-1/+639
| | | | | | | | | routines provide write-only stdio FILE objects that store their data in a dynamically allocated buffer. They are a string builder interface somewhat akin to a completely dynamic sbuf. Reviewed by: bde, jilles (earlier versions) MFC after: 1 month
* no one bothered to write the iconv.9 man page... If it appears wejmg2013-02-261-2/+1
| | | | | | can readd the xref... MFC: 1 week
* Add support for good old 8192Hz profiling clock to software PMC.mav2013-02-261-1/+3
| | | | Reviewed by: fabient
* Update base system libexpat to 2.1.0.delphij2013-02-262-7/+20
|\ | | | | | | MFC after: 3 days
| * Vendor import of expat 2.1.0 (trimmed).delphij2013-02-266-163/+283
| |
| * Apply a vendor fix (rev 1.165): Don't update next pointer since it coulddelphij2009-12-111-1/+0
| | | | | | | | | | | | | | confuse tokenizer. Obtained from: expat CVS Security: CVE-2009-3720
| * Correct a DoS issue when processing XML document with malformeddelphij2009-12-101-1/+1
| | | | | | | | | | | | | | UTF-8 sequences. Obtained from: expat CVS (revisions 1.14 and 1.15) Security: CVE-2009-3560
| * Flattern all tags and dist tree for expat.delphij2009-12-1018-0/+13268
|
* libc/opendir: Improve behaviour of union uniquifier:jilles2013-02-241-25/+26
| | | | | | | | | * Reopen the directory using openat(fd, ".", ...) instead of opening the pathname again. This fixes a race condition where the meaning of the pathname changes and allows a reopen with fdopendir(). * Always reopen the directory for union stacks, not only when DTF_REWIND is passed. Applications should be able to fchdir(dirfd(dir)) and *at(dirfd(dir), ...). DTF_REWIND now does nothing.
OpenPOWER on IntegriCloud