policychecker: add more types of privileges 45/190545/1
authorAdrian Szyndela <adrian.s@samsung.com>
Wed, 3 Oct 2018 13:52:22 +0000 (15:52 +0200)
committerAdrian Szyndela <adrian.s@samsung.com>
Wed, 3 Oct 2018 13:57:41 +0000 (15:57 +0200)
Added three more types of privileges.
Requested by bro kim.

Change-Id: I3219a7b10cd4b5c784a88abe1fb034dde10bb0ff

policychecker/check.in

index da5b3ad0fbab7968f106287cf254c2f5a909dc8a..84c0c6150df2a0b932357f25ac41b35e4da54435 100755 (executable)
@@ -34,8 +34,15 @@ if [ ! -d /var/cynara/db ]; then
        exit 1
 fi
 
+PRIVILEGES=("http://tizen.org/privilege"
+               "http://samsung.com/tizen/privilege"
+               "http://developer.samsung.com/tizen/privilege"
+               "http://developer.samsung.com/privilege")
+
 # TEST 1/3: check cynara privileges existence (there are too many to perform this check using xsltproc)
-grep "http://tizen.org/privilege" /var/cynara/db/* | sed -e "s/;[^;]*;$//g" -e "s/.*http/http/g" | uniq > $system_privileges_file
+for p in ${PRIVILEGES[@]}; do
+       grep $p /var/cynara/db/* | sed -e "s/;[^;]*;$//g" -e "s/.*http/http/g" | uniq >> $system_privileges_file
+done
 $xslt_processor $checker_dir/extract_privilege.xsl $config_file | uniq > $conf_privileges_file
 grep -Fxv -f $system_privileges_file $conf_privileges_file | while read line ; do echo "FAILED(cynara) no privilege in cynara db: $line" ; exit 1; done