fix: remove uid downgrade on server load

This commit is contained in:
Alexis Tyler
2021-03-05 15:26:52 +10:30
parent c22ba036cd
commit c804dcb305

View File

@@ -189,16 +189,7 @@ export const server = {
server: stoppableServer,
async start() {
// Start http server
return stoppableServer.listen(port, () => {
// Downgrade process user to owner of this file
fs.stat(__filename, (error, stats) => {
if (error) {
throw error;
}
process.setuid(stats.uid);
});
});
return stoppableServer.listen(port);
},
stop(callback?: () => void) {
// Stop http server from accepting new connections and close existing connections