A light-weight process isolation tool, making use of Linux namespaces and
seccomp-bpf syscall filters (with help of the kafel bpf language)
+%package test
+Summary: Tizen nsjail test programs
+Group: System/Other
+Requires: %{name} = %{version}-%{release}
+
+%description test
+Tizen simple test programs to check nsjail execution validation in Tizen platform
+
%prep
%setup -q
export CXXFLAGS="$CXXFLAGS -DTIZEN"
make %{?_smp_mflags}
+pushd test
+make %{?_smp_mflags}
+popd test
+
%install
mkdir -p %{buildroot}/%{_bindir}/
+mkdir -p %{buildroot}/%{_bindir}/nsjail_test/
+
cp nsjail %{buildroot}/%{_bindir}/
+cp -a test/*_test %{buildroot}/%{_bindir}/nsjail_test/
%files
%license LICENSE
%{_bindir}/nsjail
+%files test
+%{_bindir}/nsjail_test/*
+
%changelog
* Mon Jul 7 2021 Baik
- Initial import of version latest version of nsjail - 2021-07-07 version
--- /dev/null
+#
+# nsjail - Makefile
+# -----------------------------------------
+#
+# Copyright 2014 Google Inc. All Rights Reserved.
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+
+PKG_CONFIG=$(shell command -v pkg-config 2> /dev/null)
+ifeq ($(PKG_CONFIG),)
+$(error "Install pkg-config to make it work")
+endif
+
+CC ?= gcc
+CXX ?= g++
+
+COMMON_FLAGS += -O2 -c \
+ -D_GNU_SOURCE -D_FILE_OFFSET_BITS=64 \
+ -fPIE \
+ -Wformat -Wformat-security -Wno-format-nonliteral \
+ -Wall -Wextra -Werror
+
+CXXFLAGS += $(USER_DEFINES) $(COMMON_FLAGS) \
+ -std=c++11 -fno-exceptions -Wno-unused -Wno-unused-parameter
+LDFLAGS += -pie -Wl,-z,noexecstack -lpthread
+
+BIN1 = jail_mem_syscall_test
+SRCS1_CXX = memory_syscall_test.cc
+OBJS1 = $(SRCS1_CXX:.cc=.o)
+
+ifdef DEBUG
+ CXXFLAGS += -g -ggdb -gdwarf-4
+endif
+
+.PHONY: all clean indent
+
+.cc.o: %.cc
+ $(CXX) $(CXXFLAGS) $< -o $@
+
+all: $(BIN1)
+
+$(BIN1): $(OBJS1)
+ $(CXX) -o $(BIN1) $(OBJS1) $(LDFLAGS)
+
+
+.PHONY: clean
+clean:
+ $(RM) core Makefile.bak $(OBJS1) $(BIN1)
+
+
+.PHONY: indent
+indent:
+ clang-format -style="{BasedOnStyle: google, IndentWidth: 8, UseTab: Always, IndentCaseLabels: false, ColumnLimit: 100, AlignAfterOpenBracket: false, AllowShortFunctionsOnASingleLine: false}" -i -sort-includes *.h $(SRCS_CXX)
+
+# DO NOT DELETE THIS LINE -- make depend depends on it.
+
+jail_mem_syscall_test.o:
+