mirror of
https://github.com/MasterAcnolo/Freedom-Loader.git
synced 2026-07-29 18:25:47 +02:00
feat: support Linux. Refactor resources architecture. Create build script
Currently, themes are disabled and firefox notification too.
This commit is contained in:
@@ -62,10 +62,19 @@ function validateDownloadPath(userPath) {
|
||||
* Required to prevent path traversal or alias bypass.
|
||||
*/
|
||||
const resolved = fs.realpathSync(path.resolve(userPath));
|
||||
|
||||
if (!fs.existsSync(resolved)) {
|
||||
fs.mkdirSync(resolved, { recursive: true });
|
||||
logger.info(`Download folder created: ${resolved}`);
|
||||
}
|
||||
|
||||
const real = fs.realpathSync(resolved);
|
||||
|
||||
if (!isSafePath(resolved)) {
|
||||
throw new Error("Path not allowed: system folders are blocked!");
|
||||
}
|
||||
return resolved;
|
||||
|
||||
return real;
|
||||
}
|
||||
catch (err) {
|
||||
|
||||
|
||||
Reference in New Issue
Block a user