-
Notifications
You must be signed in to change notification settings - Fork 1
/
vely.sel
executable file
·42 lines (34 loc) · 1023 Bytes
/
vely.sel
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
#!/bin/bash
#SPDX-License-Identifier: EPL-2.0
#Copyright 2019 DaSoftver LLC. Written by Sergio Mijatovic.
#Licensed under Eclipse Public License - v 2.0. See LICENSE file.
#On the web https://vely.dev/ - this file is part of Vely framework.
#generate SELinux policies
#$1 is lib dir, $2 is data dir, $3 is bindir
LDIR="$1"
DDIR="$2"
BDIR="$3"
cd $LDIR
mkdir -p tmp
cp -f vv.te vv.fc vely.te tmp/
cd tmp
make -f /usr/share/selinux/devel/Makefile vv.pp
install -D -m 0600 vv.pp -t $DDIR/selinux/packages/
checkmodule -M -m -o vely.mod vely.te
semodule_package -o vely.pp -m vely.mod
install -D -m 0600 vely.pp -t $DDIR/selinux/packages/ ;
if (( $EUID == 0 )); then
semodule -n -i "$DDIR/selinux/packages/vv.pp"
semodule -n -i "$DDIR/selinux/packages/vely.pp"
fi
if [ -d "/var/lib/vv" ]; then
if /usr/sbin/selinuxenabled ; then
if (( $EUID == 0 )); then
load_policy
restorecon -R /var/lib/vv
restorecon -R $BDIR/vf
fi
fi
fi
cd $LDIR
rm -rf tmp