diff options
author | Bastien Nocera <hadess@hadess.net> | 2022-03-31 12:11:29 +0200 |
---|---|---|
committer | Bastien Nocera <hadess@hadess.net> | 2022-04-19 15:27:36 +0200 |
commit | d0ebbe32bb5cec06335a7bd0f11f8550deaec16e (patch) | |
tree | dc3b692019398284fac9034e4f2dd845ffeaa786 /libupower-glib | |
parent | 2f3ccee059f85888a6f77f1634ac55a871bc728c (diff) | |
download | upower-d0ebbe32bb5cec06335a7bd0f11f8550deaec16e.tar.gz |
device: Only handle Refresh() method if in debug mode
The Refresh D-Bus method could be used by clients to force re-reading
the state of batteries in the upower backends. This is not needed as
all the backends should be sending events when their states changes,
removing the need for an explicit refresh.
This is also a potential security problem if applications keep on
refreshing their data.
We now only allow access to the Refresh() method if the daemon was
started in debugging mode. This should make it clearer that it is a
debug tool.
Also remove a mention of the never implemented refresh-power-source
polkit authorisation.
Diffstat (limited to 'libupower-glib')
-rw-r--r-- | libupower-glib/up-device.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/libupower-glib/up-device.c b/libupower-glib/up-device.c index db0149f..d8978c4 100644 --- a/libupower-glib/up-device.c +++ b/libupower-glib/up-device.c @@ -408,7 +408,8 @@ up_device_to_text (UpDevice *device) * @error: a #GError, or %NULL. * * Refreshes properties on the device. - * This function is normally not required. + * This function is normally not required and will only return without + * an error if the daemon was started in debug mode. * * Return value: #TRUE for success, else #FALSE and @error is used * |