mirror of
https://github.com/checkpoint-restore/criu.git
synced 2026-07-20 16:51:37 +00:00
This test creates 2 users to check how secure is using criu with setuid bit set. Signed-off-by: Ruslan Kuprieiev <kupruser@gmail.com> Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
32 lines
537 B
Makefile
32 lines
537 B
Makefile
DIR := /tmp/criu-test
|
|
LOOP := $(DIR)/loop.sh
|
|
PIDFILE := $(DIR)/loop.pid
|
|
IMGS := $(DIR)/imgs
|
|
CRIU := $(DIR)/criu
|
|
|
|
ROOT :=root
|
|
USR1 :=criu-test-user1
|
|
USR2 :=criu-test-user2
|
|
|
|
export DIR LOOP PIDFILE IMGS CRIU ROOT USR1 USR2
|
|
|
|
run: testdir users
|
|
./run.sh
|
|
|
|
testdir: ../../criu
|
|
mkdir -p $(DIR)
|
|
mkdir -p $(IMGS)
|
|
cp ../../criu $(CRIU)
|
|
chmod u+s $(CRIU)
|
|
cp loop.sh $(LOOP)
|
|
chmod 777 $(DIR)
|
|
|
|
users:
|
|
useradd -M -U $(USR1)
|
|
useradd -M -U $(USR2)
|
|
usermod -a -G $(USR2) $(USR1)
|
|
|
|
clean:
|
|
rm -rf $(DIR)
|
|
-userdel -f $(USR1)
|
|
-userdel -f $(USR2)
|