Compare commits

..

No commits in common. "f4576cf7ea3315627ceb58c07c205e13d4ea410d" and "112d514f59f61d02b19f48653ee97e7cf4e740f1" have entirely different histories.

5 changed files with 21 additions and 56 deletions

5
.gitignore vendored
View File

@ -3,9 +3,6 @@ build/*
.cache
test/protected/*
test/.pt.db
*compile_commands.json
compile_commands.json
test/perf*
test/callgraph*
src/gui/ui/*
src/gui/*.o
src/gui/icfs_dialogue

View File

@ -2,17 +2,9 @@ SHELL=/bin/bash
# configurable options
ifndef ($(SOURCES_DIR))
SOURCES_DIR := ./src
endif
ifndef ($(TESTS_DIR))
TESTS_DIR := ./tests
endif
ifndef ($(BUILD_DIR))
BUILD_DIR := ./build
endif
SOURCES_DIR := ./src
TESTS_DIR := ./tests
BUILD_DIR := ./build
CC := gcc
CXX := g++
@ -57,18 +49,12 @@ ifeq ($(TEST), 1)
TARGETS += icfs_test
endif
ifneq ($(DIALOGUE), 0)
TARGETS += $(BUILD_DIR)/icfs_dialogue
endif
# build!
default: $(TARGETS)
.PHONY: clean icfs_test clean-icfs clean-icfs_dialogue
$(BUILD_DIR)/icfs_dialogue:
make -C $(SOURCES_DIR)/gui TEST=$(TEST) DEBUG=$(shell realpath $(DEBUG)) SOURCES_DIR=$(shell realpath $(SOURCES_DIR)/gui) BUILD_DIR=$(shell realpath $(BUILD_DIR)) TESTS_DIR=$(shell realpath $(TESTS_DIR))
.PHONY: clean
$(BUILD_DIR)/icfs: $(BUILD_DIR)/main.o $(BUILD_DIR)/fuse_operations.o $(BUILD_DIR)/sourcefs.o $(BUILD_DIR)/ui-socket.o $(BUILD_DIR)/temp_permissions_table.o $(BUILD_DIR)/perm_permissions_table.o
$(CC) $(CFLAGS) $^ $(LDFLAGS) -o $(BUILD_DIR)/icfs
@ -97,16 +83,6 @@ $(BUILD_DIR)/temp_permissions_table.o: $(SOURCES_DIR)/temp_permissions_table.c $
$(BUILD_DIR)/perm_permissions_table.o: $(SOURCES_DIR)/perm_permissions_table.c $(SOURCES_DIR)/perm_permissions_table.h
$(CC) $(CFLAGS) -c $< $(LDFLAGS) -o $@
CLEAN_TARGETS=clean-icfs
ifneq ($(DIALOGUE), 0)
CLEAN_TARGETS += clean-icfs_dialogue
endif
clean: $(CLEAN_TARGETS)
clean-icfs:
rm $(BUILD_DIR)/*.o $(BUILD_DIR)/icfs
clean-icfs_dialogue:
make -C $(SOURCES_DIR)/gui clean SOURCES_DIR=$(shell realpath $(SOURCES_DIR)/gui) BUILD_DIR=$(shell realpath $(BUILD_DIR)) TESTS_DIR=$(shell realpath $(TESTS_DIR))
clean:
rm $(BUILD_DIR)/*.o $(BUILD_DIR)/icfs*

View File

@ -2,17 +2,9 @@ SHELL=/bin/bash
# configurable options
ifndef ($(SOURCES_DIR))
SOURCES_DIR := .
endif
ifndef ($(TESTS_DIR))
TESTS_DIR := .
endif
ifndef ($(BUILD_DIR))
BUILD_DIR := .
endif
SOURCES_DIR := .
TESTS_DIR := .
BUILD_DIR := .
CC := gcc
CXX := g++
@ -51,10 +43,10 @@ endif
# set up targets
TARGETS := $(BUILD_DIR)/icfs_dialogue
TARGETS := $(BUILD_DIR)/zenity
ifeq ($(TEST), 1)
TARGETS += icfs_dialogue_test
TARGETS += zenity_test
endif
@ -62,16 +54,16 @@ endif
default: $(TARGETS)
.PHONY: clean icfs_dialogue_test
.PHONY: clean zenity_test
icfs_dialogue_test: $(BUILD_DIR)/icfs_dialogue
$(BUILD_DIR)/icfs_dialogue 666 cat /home/fedir /Downloads
zenity_test: $(BUILD_DIR)/zenity
./zenity 666 cat /home/fedir Downloads
$(BUILD_DIR)/icfs_dialogue: $(BUILD_DIR)/icfs_dialogue.o
$(CC) $(CFLAGS) $^ $(LDFLAGS) -o $(BUILD_DIR)/icfs_dialogue
$(BUILD_DIR)/zenity: $(BUILD_DIR)/zenity.o
$(CC) $(CFLAGS) $^ $(LDFLAGS) -o $(BUILD_DIR)/zenity
$(BUILD_DIR)/icfs_dialogue.o: $(SOURCES_DIR)/icfs_dialogue.c
$(CC) $(CFLAGS) -c $< $(LDFLAGS) -o $(BUILD_DIR)/icfs_dialogue.o
$(BUILD_DIR)/zenity.o: $(SOURCES_DIR)/zenity-clone.c
$(CC) $(CFLAGS) -c $< $(LDFLAGS) -o $(BUILD_DIR)/zenity.o
clean:
rm $(BUILD_DIR)/*.o $(BUILD_DIR)/icfs_dialogue
rm $(BUILD_DIR)/*.o $(BUILD_DIR)/zenity

View File

@ -28,7 +28,7 @@ if [[ $1 == "--setuid" ]]; then
else
echo "Database protection will not be tested due to the lack of setuid capabilites."
echo "To test it, run this script with '--setuid'."
valgrind --leak-check=full -s ../build/icfs -o default_permissions ./protected ./.pt.db &
valgrind -s ../build/icfs -o default_permissions ./protected ./.pt.db &
sleep 5
fi