diff options
author | Zach Koopmans <zkoopmans@google.com> | 2021-06-11 20:30:41 -0700 |
---|---|---|
committer | gVisor bot <gvisor-bot@google.com> | 2021-06-11 20:33:58 -0700 |
commit | b92e8ee8d6744d81383f4265faa008ccce894f5e (patch) | |
tree | 6b1d0d398fe3c0464d39a5a32c5444a7d218f932 /pkg/sleep/sleep_test.go | |
parent | ec6a7ebc75f714e9ac8ae1dc785304661f6e63b4 (diff) |
Fix //test/syscalls:exec_test_native
Later kernels add empty arguments to argv, throwing off return values for the
exec_basic_workload.cc binary. This is result of a bug introduced by
ccbb18b67323b "exec/binfmt_script: Don't modify bprm->buf and then return -
ENOEXEC". Before this change, an empty interpreter string was reported if the
first non-space/non-tab character after "#!" was '\0' (end of file, previously-
overwritten trailing space or tab, or previously-overwritten first newline).
After this change, an empty interpreter string is reported if all characters
after "#!" are spaces or tabs, or the first non-space non-tab character is at
i_end, which is the position of the first newline after "#!". However, if
there is no newline after "#!" (as in ExecTest.InterpreterScriptNoPath),
then i_end = buf_end (= bprm->buf + sizeof(bprm->buf) - 1, the last possible
byte in the buffer) and neither condition holds.
Change white space for script inputs to take into account the above bug.
Co-authored-by: Andrei Vagin <avagin@gmail.com>
PiperOrigin-RevId: 378997171
Diffstat (limited to 'pkg/sleep/sleep_test.go')
0 files changed, 0 insertions, 0 deletions