util.startup: Don't create installer plugin path (as root)
authorKim Alvefur <zash@zash.se>
Sun, 24 Jan 2021 15:57:48 +0100
changeset 11308 c022b582d312
parent 11307 0d932bf3a0f7
child 11309 cd8516a77255
util.startup: Don't create installer plugin path (as root) Since this runs before dropping root, the directory ends up being owned by root, resulting in luarocks failing to install anything, since by then it would be running as the prosody user. luarocks creates this directory if needed, so creating it during startup is not necessary. One potential issue is if the directory is somewhere where Prosody can't write, but then you will simply have to create it yourself with the appropriate permissions.
util/startup.lua
--- a/util/startup.lua	Thu Jan 21 23:38:44 2021 +0100
+++ b/util/startup.lua	Sun Jan 24 15:57:48 2021 +0100
@@ -271,8 +271,6 @@
 	local path_sep = package.config:sub(3,3);
 	-- TODO Figure out what this should be relative to, because CWD could be anywhere
 	installer_plugin_path = config.resolve_relative_path(require "lfs".currentdir(), installer_plugin_path);
-	-- TODO Can probably move directory creation to the install command
-	require "lfs".mkdir(installer_plugin_path);
 	require"util.paths".complement_lua_path(installer_plugin_path);
 	-- luacheck: ignore 111
 	CFG_PLUGINDIR = installer_plugin_path..path_sep..(CFG_PLUGINDIR or "plugins");