Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

prevents overwriting of a file in the input channel redirection #1049

Merged
merged 1 commit into from
Feb 13, 2020

Conversation

ivg
Copy link
Member

@ivg ivg commented Feb 13, 2020

In Primus Lisp, we have channel redirection which makes files from the
host system visible to the emulation layer. Underneath the hood, we
use common OCaml channels to model files (and probably we should use
Unix file descriptors), and when a file is mapped, we open both input
and output channel. However, when we open the input channel, the file
is truncated, with all the ramifications.

The quickfix is to add the append flag. The long-term solution would
be switching to Unix file desciptors and passing flags to the open(2)
function, see #1050.

In Primus Lisp, we have channel redirection which makes files from the
host system visible to the emulation layer. Underneath the hood, we
use common OCaml channels to model files (and probably we should use
Unix file descriptors), and when a file is mapped, we open both input
and output channel. However, when we open the input channel, the file
is truncated, with all the ramifications.

The quickfix is to add the `append` flag. The long-term solution would
be switching to Unix file desciptors and passing flags to the `open(2)`
function.
@ivg ivg merged commit 692dd7d into BinaryAnalysisPlatform:master Feb 13, 2020
@ivg ivg deleted the fix-channel-redirections branch June 10, 2020 12:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants