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

stopping spatch from creating the output automatically in the directory of the input c file #338

Open
justfeelix opened this issue Dec 5, 2023 · 0 comments

Comments

@justfeelix
Copy link

Hello everyone,

I am trying to inject faults into c files with the help of coccinelle spatch.
I ran into this problem that the benchmarking framework that I am using, runs the tools (coccinelle) in a containerized environment with READ_ONLY permissions to the input file's directory.
The issue is that when running the command (within the container):
spatch template.cocci example.c -o /target
It writes the output not only in the desired target directory but also in the same directory as the input files which is leading to permission issues.

is there a way to change that behaviour of spatch? and to create the output only in the desired target directory?
this is the output.txt that I get:

cat cvt-output/coccinelle-default/3cb48d4b-12bb-41bc-85b0-23c1f3f28a48/output.txt 
/usr/local/bin/spatch ../../../tmp/program.c ../../../tmp/template.cocci


--------------------------------------------------------------------------------


init_defs_builtins: /usr/local/lib/coccinelle/standard.h
warning: r1: metavariable s7 not used in the - or context code
warning: r1: metavariable s6 not used in the - or context code
Using native version of ocamlc/ocamlopt/ocamldep
ocamlopt.opt -shared -o /tmp/ocaml_cocci_32fd62.cmxs -g -I /usr/local/lib/coccinelle/ocaml  -I /usr/lib/ocaml /tmp/ocaml_cocci_32fd62.ml
Compilation OK!
Loading ML code of the SP...
HANDLING: ../../../tmp/program.c
cp: cannot create regular file '../../../tmp/program_1.c': Read-only file system
1 pending new file instances
0 pending original file instances

Fatal error: exception Sys_error("../../../tmp/program_1.c: No such file or directory")
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

No branches or pull requests

1 participant