diff options
author | Kevin Krakauer <krakauer@google.com> | 2019-11-14 15:55:07 -0800 |
---|---|---|
committer | gVisor bot <gvisor-bot@google.com> | 2019-11-14 16:08:34 -0800 |
commit | 339536de5eefe782813aabae4aeeb312b3c4dde7 (patch) | |
tree | 65a862e9b16cc15d7edd249444c2c355a2bb16db /test/util/pty_util.h | |
parent | 1e1f5ce08210af6211bcb1c8da293a63a79165fe (diff) |
Check that a file is a regular file with open(O_TRUNC).
It was possible to panic the sentry by opening a cache revalidating folder with
O_TRUNC|O_CREAT.
Avoids breaking php tests.
PiperOrigin-RevId: 280533213
Diffstat (limited to 'test/util/pty_util.h')
-rw-r--r-- | test/util/pty_util.h | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/test/util/pty_util.h b/test/util/pty_util.h index 367b14f15..0722da379 100644 --- a/test/util/pty_util.h +++ b/test/util/pty_util.h @@ -24,6 +24,9 @@ namespace testing { // Opens the slave end of the passed master as R/W and nonblocking. PosixErrorOr<FileDescriptor> OpenSlave(const FileDescriptor& master); +// Get the number of the slave end of the master. +PosixErrorOr<int> SlaveID(const FileDescriptor& master); + } // namespace testing } // namespace gvisor |