summaryrefslogtreecommitdiffstats
path: root/lib/libc/sys/dup.2
Commit message (Collapse)AuthorAgeFilesLines
* Add man page dup3(3).jilles2013-08-161-1/+2
|
* dup(2): Clarify return value, in particular of dup2().jilles2013-05-311-4/+5
|
* dup(2): Remove incorrect sentence about getdtablesize().jilles2013-04-211-4/+1
| | | | | | | | | There are no getdtablesize() bounds on the file descriptor to be duplicated; it only has to be open. If the RLIMIT_NOFILE rlimit was decreased after opening the file descriptor, it may be greater than or equal to getdtablesize() but still valid. MFC after: 1 week
* Merge Capsicum overhaul:pjd2013-03-021-6/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | - 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
* Add missing .Pp macro.zeising2012-08-211-0/+1
| | | | | | PR: docs/170380 Submitted by: Garrett Cooper <yanegomi@gmail.com> Approved by: joel (mentor)
* Return EBADF instead of EMFILE from dup2 when the second argument iseadler2012-04-111-5/+12
| | | | | | | | | | outside the range of valid file descriptors PR: kern/164970 Submitted by: Peter Jeremy <peterjeremy@acm.org> Reviewed by: jilles Approved by: cperciva MFC after: 1 week
* Cross-reference cap_new(2) from dup(2), as they have similar functionality.rwatson2011-08-141-1/+7
| | | | Approved by: re (kib)
* Per Regents of the University of Calfornia letter, remove advertisingimp2007-01-091-4/+0
| | | | | | clause. # If I've done so improperly on a file, please let me know.
* Mechanically kill hard sentence breaks.ru2004-07-021-2/+4
|
* mdoc(7) police: "The .Fa argument.".ru2002-12-191-1/+3
|
* mdoc(7) police: Tidy up the syscall language.ru2002-12-181-9/+9
| | | | | | | | | | Stop calling system calls "function calls". Use "The .Fn system call" a-la "The .Nm utility". When referring to a non-BSD implementation in the HISTORY section, call syscall a function, to be safe.
* The .Fn function.keramida2002-07-151-3/+6
|
* Remove the internal implementation details of wrapping syscalls,ru2001-10-261-46/+0
| | | | | | which do not match the reality anyway. Approved by: deischen, bde
* mdoc(7) police: Use the new .In macro for #include statements.ru2001-10-011-1/+1
|
* mdoc(7) police: join split punctuation to macro calls.ru2001-08-101-1/+1
|
* Remove whitespace at EOL.dd2001-07-151-2/+2
|
* mdoc(7) police: removed HISTORY info from the .Os call.ru2001-07-101-1/+1
|
* mdoc(7) police: remove extraneous .Pp before and/or after .Sh.dd2001-07-091-1/+0
|
* Replace .Va, .Ar and .Nm with .Fa or .Va where necessary, examples:chris2000-06-231-6/+6
| | | | | | ``.Ar errno'' -> ``.Va errno'' ``.Nm ops'' -> ``.Fa ops'' ``.Va fd'' -> ``.Fa fd''
* Introduce ".Lb" macro to libc manpages.phantom2000-04-211-0/+2
| | | | More libraries manpages updates following.
* $Id$ -> $FreeBSD$peter1999-08-281-1/+1
|
* Clarified the behaviour of dup2(fd1,fd2) when fd1==fd2 and when fd1 is invalid.mckay1997-03-091-4/+21
| | | | Safe for 2.2!
* Revert $FreeBSD$ to $Id$peter1997-02-221-1/+1
|
* Sort cross references.wosch1997-01-201-3/+3
|
* Make the long-awaited change from $Id$ to $FreeBSD$jkh1997-01-141-1/+1
| | | | | | | | This will make a number of things easier in the future, as well as (finally!) avoiding the Id-smashing problem which has plagued developers for so long. Boy, I'm glad we're not using sup anymore. This update would have been insane otherwise.
* upgrade STANDARDS from POSIX 1003.1-88 to 1003.1-90 using .St macrowosch1996-12-021-5/+5
| | | | | | use ``is expected to conform to'' phrase, not ``conforms to'' Pointed out by: Bruce->NIST-PCTS
* function appeared in Version 7 AT&T UNIXwosch1996-08-291-0/+8
| | | | Obtained from: ftp://netlib.att.com/netlib/att/cs/v7man/man2
* Reviewed by: julian and (hsu?)julian1996-01-221-0/+47
| | | | | | Submitted by: John Birrel(L?) changes for threadsafe operations
* BSD 4.4 Lite Lib Sourcesrgrimes1994-05-271-0/+132
OpenPOWER on IntegriCloud