Skip to content

Commit

Permalink
Refactor exec command in server.js to use execFile for improved security
Browse files Browse the repository at this point in the history
  • Loading branch information
kroonen committed Sep 8, 2024
1 parent 115e728 commit 9952303
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion server.js
Original file line number Diff line number Diff line change
Expand Up @@ -664,7 +664,7 @@ async function initializeApiClients() {
function executeUpdateScript() {
return new Promise((resolve, reject) => {
const scriptPath = path.join(__dirname, "update_ollama_models.sh");
exec(`bash ${scriptPath}`, (error, stdout, stderr) => {
execFile('bash', [scriptPath], (error, stdout, stderr) => {
if (error) {
console.error(`Error executing update script: ${error}`);
reject(error);
Expand Down

0 comments on commit 9952303

Please sign in to comment.