linrunner / TLP

TLP - Optimize Linux Laptop Battery Life
https://linrunner.de/tlp
GNU General Public License v2.0
2.51k stars 129 forks source link

Output with lack of privileges for 'tlp-stat -w' #706

Closed drws closed 9 months ago

drws commented 9 months ago

[x] I've read and accepted the Bug Reporting Howto [x] I've provided all required tlp-stat outputs via Gist (see below)

Describe the bug

When tlp-stat -w is run without dmesg/root privileges it prints a somewhat flawed output:

tlp-stat -w
--- TLP 1.6.0 --------------------------------------------

dmesg: read kernel buffer failed: Operation not permitted
No warnings detected.

The first issue with the output is obviously the No warnings detected. message which is technically correct, but could quickly mislead a less savvy user. The second issue is that behavior differs from other privilege-requiring operations, such as tlp-stat -b, which outputs:

Error: missing root privilege.

Expected behavior

All privilege-requiring operations to communicate the missing-privilege error in an uniform way.

To Reproduce

  1. Run tlp-stat -w as an unprivileged user
linrunner commented 9 months ago

Thanks for notifying. Even minor things can be improved.

Btw: It would be important to me that you answer my questions in #702.