-
Notifications
You must be signed in to change notification settings - Fork 8
Installing and Running Lind
Pull the image from DockerHub, if you haven't already
docker pull securesystemslab/lind
Creating a new container:
docker run --privileged --ipc=host --cap-add=SYS_PTRACE -it securesystemslab/lind /bin/bash
You cannot directly use gcc
to compile programs for Lind. Instead, you can run the tool lindsh
first, and use the commands compile
, gcc
, or cc
in this special compiler.
Compile the hello.c
file under the /home/lind/lind_project/tests/test_cases/
directory
$ lindsh
@[/home/lind/lind_project] lind> compile [absolutepath]/path/to/hello.c -o /home/lind/lind_project/hello.nexe
If you’re inside lindsh:
cp /home/lind/lind_project/hello.nexe hello.nexe
From container:
lindfs cp ~/the/path/ /home/lind/lind_project/hello.nexe hello.nexe
The first argument is where your executable file is located in the container. The second argument is where you want to put your executable in the Lind file system. Note you have to give the executable file a name in the Lind file system.
The cp
command can also recursively copy directories--if your second argument is a directory, it will copy the directory and any of its contents recursively, their paths are still relative to the first argument.
After exiting lindsh
you can use the lindfs
tool to check if it exists in the lind filesystem.
lindfs find | grep 'hello'
Alternatively, you can use lindsh ls /[path]/
to run a ls command and locate the file.
If you see your executable file is under the path you designated before, it means that you have successfully copied the file into the Lind file system.
You can run the executable with lind /[path]/hello.nexe
or run /hello.nexe
if you are in lindsh
(alternate aliases for this command are r
, exec
, and execute
).