lablup / backend.ai-jail

A programmable security sandbox for Backend.AI kernels

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Generic stdin support

achimnol opened this issue · comments

It is difficult to have language-by-language stdin overrides.
Could we just override the read() syscall with stdin (file descriptor zero)?

Things to test/consider:

  • check if overriding read() with fd zero really works
  • what happens if the stdin file descriptor is duplicated via dup(), dup2()? Is there any language that use them? (i.e., should we keep track of such syscalls and target/returned file descriptors?)
  • check if redirection interferes with read() overriding -- maybe we need to check isatty()for the stdin fd?

This is now deprecated in favor of lablup/backend.ai-agent#93.