summaryrefslogtreecommitdiffstats
path: root/lib
Commit message (Collapse)AuthorAgeFilesLines
* Merge from vmcontentionattilio2013-03-076-54/+153
|\
| * MFCattilio2013-03-076-54/+153
| |\
| | * 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
* | | Merge from vmcontentionattilio2013-03-043-0/+107
|\ \ \ | |/ /
| * | MFCattilio2013-03-043-0/+107
| |\ \ | | |/
| | * 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
* | | Merge from vmcontentionattilio2013-03-036-71/+232
|\ \ \ | |/ /
| * | MFCattilio2013-03-036-71/+232
| |\ \ | | |/
| | * - 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.
* | | Merge from vmcontentionattilio2013-03-0217-168/+748
|\ \ \ | |/ /
| * | MFCattilio2013-03-0217-168/+748
| |\ \ | | |/
| | * 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
| | |
* | | MFCattilio2013-02-285-1/+640
|\ \ \ | |/ /
| * | MFCattilio2013-02-285-1/+640
| |\ \ | | |/
| | * 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
| * | MFCattilio2013-02-262-3/+4
| | |
* | | Merge from vmcontentionattilio2013-02-262-3/+4
| | |
* | | Merge from vmcontentionattilio2013-02-263-32/+46
|\ \ \ | |/ /
| * | MFCattilio2013-02-263-32/+46
| |\ \ | | |/
| | * 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.
* | | Merge from vmcontentionattilio2013-02-2414-334/+1039
|\ \ \ | |/ /
| * | MFCattilio2013-02-2414-334/+1039
| |\ \ | | |/
| | * Merge part of r1712 from elftoolchain, making it possible to resize ELFmarkj2013-02-241-127/+181
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | sections and indirectly change the layout of an ELF file when ELF_F_LAYOUT is not set. PR: bin/167103 Approved by: rstone (co-mentor) Obtained from: elftoolchain MFC after: 2 weeks
| | * Now that qsort(3) has a sample comparison function, point to thatkeramida2013-02-231-1/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | example from bsearch(3) too, so that we don't have to duplicate the example code in both places. PR: docs/176197 Reviewed by: stefanf Approved by: remko (mentor), gjb (mentor) MFC after: 1 week
| | * Sort sections.joel2013-02-201-6/+6
| | |
| | * Various improvements to the qsort(3) usage example:keramida2013-02-201-14/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | - Remove unused #include. - Do not cast away const. - Use the canonical idiom to compare two numbers. - Use proper type for sizes, i.e. size_t instead of int. - Correct indentation. - Simplify printf("\n") to puts(""). - Use return instead of exit() in main(). Submitted by: Christoph Mallon, christoph.mallon at gmx.de Approved by: gjb (mentor) Reviewed by: stefanf MFC after: 1 week
| | * Add a sample program that shows how a custom comparison function andkeramida2013-02-191-1/+47
| | | | | | | | | | | | | | | | | | | | | | | | | | | qsort(3) can work together to sort an array of integers. PR: docs/176197 Submitted by: Fernando, fapesteguia at opensistemas.com Approved by: gjb (mentor) MFC after: 1 week
| | * Fix includes for use in libstand.kientzle2013-02-191-3/+1
| | |
OpenPOWER on IntegriCloud