Security upgrade: always set dummy_file mode/label 08/269608/1 submit/tizen_6.5/20220119.062442
authorKonrad Lipinski <k.lipinski2@samsung.com>
Mon, 17 Jan 2022 13:22:41 +0000 (14:22 +0100)
committerTomasz Swierczek <t.swierczek@samsung.com>
Wed, 19 Jan 2022 06:23:34 +0000 (06:23 +0000)
Prior to this commit, the script only changed the mode/label if the file
has not existed before. If the script ever managed to touch the file and
then got killed, the file's mode/label would never get properly adjusted
when running the script again.

Change-Id: I707870eea9abb63ccf10e8c54fb3ca984e92196a
(cherry picked from commit 67162fda11a656c2568ffd75e24d379db1ea48a2)

upgrade/201.security_upgrade.sh

index 8aae0859d8f319a196cd1e643dda503e15fcec9d..7a7a2d94501144b8744b07acb53e423d5b41978f 100644 (file)
@@ -29,9 +29,9 @@ sqlite3 /opt/dbspace/.policy.db "UPDATE prevent_list SET UID=$global_uid WHERE U
 if [ ! -e /opt/share/security-config/dummy_file ]
 then
        touch /opt/share/security-config/dummy_file
-       chmod 600 /opt/share/security-config/dummy_file
-       chsmack -a "_" /opt/share/security-config/dummy_file
 fi
+chmod 600 /opt/share/security-config/dummy_file
+chsmack -a "_" /opt/share/security-config/dummy_file
 
 # start cynara & security-manager
 systemctl start security-manager-rules-loader