Module Name: src Committed By: pooka Date: Thu Feb 17 15:20:10 UTC 2011
Modified Files: src/lib/librumphijack: hijack.c Log Message: In case dup2(n, n+FDOFF) is done, the caller thinks there are two distinct file descriptors, but the rump kernel thinks they are both the same. Now, if either one is closed by the application, "both" will be closed in the rump kernel. To fix this, maintain an alias-mask. It's not a perfect solution, though (consider e.g. F_SETFL). Maybe we should actually dup the fd and maintain a mapping table? Also, prevent the host from opening file descriptors onto the places in the fd namespace that have been dupped. These together fix "cat < /rump/foo" in a hijacked /bin/sh. (the first one makes sure stdin is open in cat and the second one makes sure it doesn't try to cat something from /usr/share/locale instead of stdin) To generate a diff of this commit: cvs rdiff -u -r1.46 -r1.47 src/lib/librumphijack/hijack.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.