aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKim Alvefur <zash@zash.se>2024-04-06 14:31:28 +0200
committerKim Alvefur <zash@zash.se>2024-04-06 14:31:28 +0200
commit0987a0113d46e4b7ec102db4e5eac2796ff44f64 (patch)
treed038c869b8895db9a651c7bc037fd3bbfa74a1c1
parent5550be6381760d973ff94a22cbb1111b545b212d (diff)
downloadprosody-0987a0113d46e4b7ec102db4e5eac2796ff44f64.tar.gz
prosody-0987a0113d46e4b7ec102db4e5eac2796ff44f64.zip
mod_version: Handle access denied from uname()
Discovered while experimenting with a stricter SystemCallFilter setting See man:systemd.exec(5)
-rw-r--r--plugins/mod_version.lua7
1 files changed, 6 insertions, 1 deletions
diff --git a/plugins/mod_version.lua b/plugins/mod_version.lua
index d9d3844c..8c221c0d 100644
--- a/plugins/mod_version.lua
+++ b/plugins/mod_version.lua
@@ -22,7 +22,12 @@ if not module:get_option_boolean("hide_os_type") then
local os_version_command = module:get_option_string("os_version_command");
local ok, pposix = pcall(require, "prosody.util.pposix");
if not os_version_command and (ok and pposix and pposix.uname) then
- platform = pposix.uname().sysname;
+ local ok, uname = pposix.uname();
+ if not ok then
+ module:log("debug", "Could not retrieve OS name: %s", uname);
+ else
+ platform = uname.sysname;
+ end
end
if not platform then
local uname = io.popen(os_version_command or "uname");