Skip to content

Commit b5612ad

Browse files
authored
webui/kpm: escape shell for ctl0 argument (#36)
Fix #34
1 parent a4ee412 commit b5612ad

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

webui/page/kpm.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import { exec, spawn, toast } from 'kernelsu-alt';
2-
import { modDir, persistDir, initInfo, MAX_CHUNK_SIZE, linkRedirect } from '../index.js';
2+
import { modDir, persistDir, initInfo, MAX_CHUNK_SIZE, escapeShell, linkRedirect } from '../index.js';
33
import { getString } from '../language.js';
44
import { setupPullToRefresh } from '../pull-to-refresh.js';
55

@@ -67,7 +67,7 @@ async function getKpmList() {
6767
}
6868

6969
async function controlModule(moduleName, action) {
70-
const result = await exec(`kpatch kpm ctl0 "${moduleName}" ${action}`, { env: { PATH: `${modDir}/bin` } });
70+
const result = await exec(`kpatch kpm ctl0 "${moduleName}" ${escapeShell(action)}`, { env: { PATH: `${modDir}/bin` } });
7171
toast(result.errno === 0 ? result.stdout : result.stderr);
7272
}
7373

0 commit comments

Comments
 (0)