File: selinux-policy-upgrade

package info (click to toggle)
selinux-basics 0.6.0
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 144 kB
  • sloc: python: 280; sh: 120; perl: 95; makefile: 2
file content (28 lines) | stat: -rwxr-xr-x 544 bytes parent folder | download | duplicates (4)
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
#!/bin/sh
set -e

if [ "$1" != "" ]; then
  SELINUXTYPE="$1"
else
  . /etc/selinux/config
fi

cd /usr/share/selinux/${SELINUXTYPE}

echo "Updating \"${SELINUXTYPE}\" policy"

# remove obsolete modules
for n in procmail tmpreaper ; do
  semodule -l |grep -q $n && semodule -r $n
done

semodule -b $(test -e base.pp && echo base.pp || echo base.pp.bz2) $(for n in $(semodule -s ${SELINUXTYPE} -l | cut -f1); do
  if [ -e $n.pp ]; then
    echo -n " -i $n.pp"
  else
      if [ -e $n.pp.bz2 ]; then
	  echo -n " -i $n.pp.bz2"
      fi
  fi
done
)