Security upgrade: always set dummy_file mode/label 15/269515/1 submit/tizen/20220119.054430
authorKonrad Lipinski <k.lipinski2@samsung.com>
Mon, 17 Jan 2022 13:22:41 +0000 (14:22 +0100)
committerKonrad Lipinski <k.lipinski2@samsung.com>
Mon, 17 Jan 2022 13:29:40 +0000 (14:29 +0100)
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

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