PATH=/bin:/usr/bin:/sbin:/usr/sbin
ONLYCAP_LIST="/etc/smack/onlycap"
+INITIAL_BOOT_FLAG="/opt/share/security-config/.smack_pre_labeling"
# check initial boot
function check_init_boot
{
- if [ ! -e /opt/share/security-config/.smack_pre_labeling ]
+ if [ ! -e $INITIAL_BOOT_FLAG ]
then
- touch /opt/share/security-config/.smack_pre_labeling
return 1
fi
return 0
}
+# set initial boot flag
+function set_init_boot
+{
+ touch $INITIAL_BOOT_FLAG
+ chsmack -a "_" $INITIAL_BOOT_FLAG
+}
+
# Set default smack label for the specific file or folder
function set_smack_label
{
if [ "$?" == 1 ] # Init boot case
then
set_smack_label
+ set_init_boot
fi
echo $(cat $ONLYCAP_LIST) > /sys/fs/smackfs/onlycap