mirror of
https://github.com/balena-os/balena-supervisor.git
synced 2025-04-15 23:16:34 +00:00
Sanitize output when writing to redsocks.conf
Properties with values including quotes (`"`) would not get sanitized and written verbatim on the config file, causing redsocks to fail. Closes: #2072
This commit is contained in:
parent
0605e996c9
commit
77cd15f131
@ -117,7 +117,8 @@ function generateRedsocksConfEntries(conf: ProxyConfig): string {
|
||||
let v = conf[field];
|
||||
if (v != null) {
|
||||
if (isAuthField(field)) {
|
||||
v = `"${v}"`;
|
||||
// Escape any quotes in the field value
|
||||
v = `"${v.toString().replace(/"/g, '\\"')}"`;
|
||||
}
|
||||
val += `\t${field} = ${v};\n`;
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user