mirror of
https://github.com/EnterpriseDB/repmgr.git
synced 2026-03-24 07:36:30 +00:00
repmgr: escape parameter values in primary_conninfo, if required
Addresses GitHub #253.
This commit is contained in:
18
strutil.c
18
strutil.c
@@ -118,3 +118,21 @@ appendShellString(PQExpBuffer buf, const char *str)
|
||||
|
||||
appendPQExpBufferChar(buf, '\'');
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* Escape a string for use as a parameter in recovery.conf
|
||||
* Caller must free returned value
|
||||
*/
|
||||
char *
|
||||
escape_recovery_conf_value(const char *src)
|
||||
{
|
||||
char *result = escape_single_quotes_ascii(src);
|
||||
|
||||
if (!result)
|
||||
{
|
||||
fprintf(stderr, _("%s: out of memory\n"), progname());
|
||||
exit(ERR_INTERNAL);
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user