This commit is contained in:
Louis Mazin 2026-04-15 00:23:03 +02:00
parent 9aca4c7995
commit 2170374134

View File

@ -122,7 +122,25 @@ async function runPlayersDeleter({ levelSavPath, uids }) {
args.push('--allow-zlib-fallback');
}
const { stdout, stderr } = await execFileAsync(execPath, args, { timeout: 10 * 60 * 1000 });
// Best effort: ensure the binary has execute permission on Linux containers.
await fs.chmod(execPath, 0o755).catch(() => {});
let stdout = '';
let stderr = '';
try {
const result = await execFileAsync(execPath, args, { timeout: 10 * 60 * 1000 });
stdout = result.stdout;
stderr = result.stderr;
} catch (error) {
if (error && error.code === 'EACCES') {
throw new Error(
`Impossible d'exécuter players-deleter (${execPath}): permission refusée (EACCES). ` +
`Vérifie que le fichier est exécutable (chmod +x) et que le filesystem n'est pas monté en noexec. ` +
`Tu peux aussi définir PLAYERS_DELETER_PATH vers une commande exécutable.`
);
}
throw error;
}
const out = String(stdout || '').trim();
if (out) {