diff options
author | Elliott Hughes <enh@google.com> | 2018-07-10 14:39:49 -0700 |
---|---|---|
committer | Elliott Hughes <enh@google.com> | 2018-07-11 12:15:26 -0700 |
commit | 468efc80da2504f4ae7de8b5e137426d44dda9d7 (patch) | |
tree | 464d20ef3a5ae493a9728ddc53629764b59f300d /libc/NOTICE | |
parent | f0296f35f67cf4c112b3ed407858999bdc2f33b0 (diff) | |
download | bionic-468efc80da2504f4ae7de8b5e137426d44dda9d7.tar.gz |
Reimplement popen(3)/pclose(3).
pclose(3) is now an alias for fclose(3). We could add a FORTIFY check
that you use pclose(3) if and only if you used popen(3), but there seems
little value to that when we can just do the right thing.
This patch also adds the missing locking to _fwalk --- we need to lock
both the global list of FILE*s and also each FILE* we touch. POSIX says
that "The popen() function shall ensure that any streams from previous
popen() calls that remain open in the parent process are closed in the
new child process", which we implement via _fwalk(fclose) in the child,
but we might want to just make *all* popen(3) file descriptors O_CLOEXEC
in all cases.
Ignore fewer errors in popen(3) failure cases.
Improve popen(3) test coverage.
Bug: http://b/72470344
Test: ran tests
Change-Id: Ic937594bf28ec88b375f7e5825b9c05f500af438
Diffstat (limited to 'libc/NOTICE')
-rw-r--r-- | libc/NOTICE | 32 |
1 files changed, 0 insertions, 32 deletions
diff --git a/libc/NOTICE b/libc/NOTICE index ae7da1875..744f42bb2 100644 --- a/libc/NOTICE +++ b/libc/NOTICE @@ -1813,38 +1813,6 @@ SUCH DAMAGE. ------------------------------------------------------------------- -Copyright (c) 1988, 1993 - The Regents of the University of California. All rights reserved. - -This code is derived from software written by Ken Arnold and -published in UNIX Review, Vol. 6, No. 8. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions -are met: -1. Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. -2. Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. -3. Neither the name of the University nor the names of its contributors - may be used to endorse or promote products derived from this software - without specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND -ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE -ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE -FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL -DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS -OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) -HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT -LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY -OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF -SUCH DAMAGE. - -------------------------------------------------------------------- - Copyright (c) 1989 The Regents of the University of California. All rights reserved. |