From: jin-gyu.kim Date: Tue, 16 Jul 2019 02:34:24 +0000 (+0900) Subject: Skip checking dbus service which has 'SystemdService' option. X-Git-Tag: submit/tizen/20190716.062812^0 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=2f63b2b2fc76c2630a03fee037e4da1a153b6550;p=platform%2Fcore%2Fsecurity%2Fsecurity-config.git Skip checking dbus service which has 'SystemdService' option. - Enable checking dbus service again. - If it has 'SystemdService' option, will be launched by systemd service. - No need to check 'User' and 'Group' option in this case. Change-Id: I6be8eaae4f17ef69a5dfaaf810fd6054d8a945a1 --- diff --git a/test/new_service_test/check_new_service.sh b/test/new_service_test/check_new_service.sh index 83ea36c..103d360 100644 --- a/test/new_service_test/check_new_service.sh +++ b/test/new_service_test/check_new_service.sh @@ -7,6 +7,8 @@ log_file="/opt/share/security-config/log/new_service.log" dbus_service_list="/usr/share/security-config/test/new_service_test/dbus_service.list" systemd_service_list="/usr/share/security-config/test/new_service_test/systemd_service.list" not_permitted_service_path="/opt/share/security-config/not_permitted_service/" +systemd_service_dir="/usr/lib/systemd/system" +dbus_service_dir="/usr/share/dbus-1/system-services" # function to check whether it is included in list files # args : $1 - service file, $2 - uid, $3 - gid, $4 - smacklabel, $5 - service list @@ -49,6 +51,11 @@ function find_service { for line in `find "$1" -type f -name "*service" 2> /dev/null` do + # skip dbus service which has SystemdService option. + if [ "$1" = "$dbus_service_dir" ] && [ "$(cat $line | grep 'SystemdService=')" != "" ] + then + continue + fi uid=";$(cat $line | grep "User=" | grep -v "#" | cut -d "=" -f2 | tr -d '\015')" gid=";$(cat $line | grep "Group=" | grep -v "#" | cut -d "=" -f2 | tr -d '\015')" smacklabel=";$(cat $line | grep "SmackProcessLabel=" | grep -v "#" | cut -d "=" -f2 | tr -d '\015');" @@ -69,8 +76,8 @@ then fi # Run Test -find_service "/usr/lib/systemd/system" "$systemd_service_list" -#find_service "/usr/share/dbus-1/system-services" "$dbus_service_list" +find_service "$systemd_service_dir" "$systemd_service_list" +find_service "$dbus_service_dir" "$dbus_service_list" if [ ! -e $log_file ] then