[Nut-upsuser] Publish UPS status to MQTT broker in 60 lines of Rust

2024-06-03 Thread Hank Barta via Nut-upsuser
But... I cheated. I looked at some projects on Github that do this and they usually link to the NUT and MQTT libraries. While I've done that in the past, more recently I delegated the actual publishing to the Mosquitto client `mosquitto_pub` thinking much more thought has gone into that than

[Nut-upsuser] Harden NUT work with strings where dynamic formatting strings are used

2024-06-03 Thread Jim Klimov via Nut-upsuser
Hello all, During discussion for development of a new driver, an old thought came to my attention that we have a potentially insecure approach with some parts of the codebase working with string and "var arg list" manipulation, which use dynamic `char *` variables instead of fixed strings (or