File tree Expand file tree Collapse file tree 1 file changed +23
-0
lines changed Expand file tree Collapse file tree 1 file changed +23
-0
lines changed Original file line number Diff line number Diff line change @@ -240,3 +240,26 @@ function execute()
240
240
241
241
return $job_rc
242
242
}
243
+
244
+ function setup_test_dbus_policy() {
245
+ local config_file=' /etc/dbus-1/system.d/test.org.usbguard1.conf'
246
+ if [[ -e " ${config_file} " ]]; then
247
+ return
248
+ fi
249
+
250
+ sudo -n tee " ${config_file} " << EOF
251
+ <?xml version="1.0" encoding="UTF-8"?>
252
+ <!DOCTYPE busconfig PUBLIC
253
+ "-//freedesktop//DTD D-BUS Bus Configuration 1.0//EN"
254
+ "http://www.freedesktop.org/standards/dbus/1.0/busconfig.dtd">
255
+ <busconfig>
256
+ <policy user="root">
257
+ <allow own="org.usbguard1"/>
258
+ </policy>
259
+ </busconfig>
260
+ EOF
261
+ sudo -n dbus-send --system --dest=org.freedesktop.DBus --type=method_call \
262
+ /org org.freedesktop.DBus.ReloadConfig
263
+ }
264
+
265
+ setup_test_dbus_policy
You can’t perform that action at this time.
0 commit comments