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
{
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');"
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