Skip to content

Same agent Smaller bill. The tools and infrastructure to get more work from your AI. Fewer tokens. Less compute. Lower cost.

fix: handle special characters in cron metadata safely (#1045)

Rin4843df38bb83
diff --git a/src/client/src/helpers/server/cron.ts b/src/client/src/helpers/server/cron.ts
index cc644d50..e35a859d 100644
--- a/src/client/src/helpers/server/cron.ts
+++ b/src/client/src/helpers/server/cron.ts
@@ -84,8 +84,8 @@ export default class Cron {
].join("\n");
}
- // Apply the new crontab
- execSync(`echo "${newCrontab}" | crontab -`);
+ // Apply the new crontab safely using stdin
+ execSync("crontab -", { input: newCrontab, encoding: "utf-8" });
} catch (error) {
throw error;
}
@@ -115,7 +115,8 @@ export default class Cron {
...lines.slice(endIdx),
].join("\n");
- execSync(`echo "${newCrontab}" | crontab -`);
+ // Apply the new crontab safely using stdin
+ execSync("crontab -", { input: newCrontab, encoding: "utf-8" });
} catch (error) {
throw error;
}