Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit8adff37

Browse files
committed
Promote pg_dumpall shell/connstr quoting functions to src/fe_utils.
Rename these newly-extern functions with terms more typical of their newneighbors. No functional changes; a subsequent commit will use them inmore places. Back-patch to 9.1 (all supported versions). Back brancheslack src/fe_utils, so instead rename the functions in place; thesubsequent commit will copy them into the other programs using them.Security:CVE-2016-5424
1 parent2e5e90d commit8adff37

File tree

1 file changed

+11
-11
lines changed

1 file changed

+11
-11
lines changed

‎src/bin/pg_dump/pg_dumpall.c

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -49,8 +49,8 @@ static void makeAlterConfigCommand(PGconn *conn, const char *arrayitem,
4949
constchar*name2);
5050
staticvoiddumpDatabases(PGconn*conn);
5151
staticvoiddumpTimestamp(constchar*msg);
52-
staticvoiddoShellQuoting(PQExpBufferbuf,constchar*str);
53-
staticvoiddoConnStrQuoting(PQExpBufferbuf,constchar*str);
52+
staticvoidappendShellString(PQExpBufferbuf,constchar*str);
53+
staticvoidappendConnStrVal(PQExpBufferbuf,constchar*str);
5454

5555
staticintrunPgDump(constchar*dbname);
5656
staticvoidbuildShSecLabels(PGconn*conn,constchar*catalog_name,
@@ -214,7 +214,7 @@ main(int argc, char *argv[])
214214
case'f':
215215
filename=pg_strdup(optarg);
216216
appendPQExpBufferStr(pgdumpopts," -f ");
217-
doShellQuoting(pgdumpopts,filename);
217+
appendShellString(pgdumpopts,filename);
218218
break;
219219

220220
case'g':
@@ -251,7 +251,7 @@ main(int argc, char *argv[])
251251

252252
case'S':
253253
appendPQExpBufferStr(pgdumpopts," -S ");
254-
doShellQuoting(pgdumpopts,optarg);
254+
appendShellString(pgdumpopts,optarg);
255255
break;
256256

257257
case't':
@@ -287,13 +287,13 @@ main(int argc, char *argv[])
287287

288288
case2:
289289
appendPQExpBufferStr(pgdumpopts," --lock-wait-timeout ");
290-
doShellQuoting(pgdumpopts,optarg);
290+
appendShellString(pgdumpopts,optarg);
291291
break;
292292

293293
case3:
294294
use_role=pg_strdup(optarg);
295295
appendPQExpBufferStr(pgdumpopts," --role ");
296-
doShellQuoting(pgdumpopts,use_role);
296+
appendShellString(pgdumpopts,use_role);
297297
break;
298298

299299
default:
@@ -1726,9 +1726,9 @@ runPgDump(const char *dbname)
17261726
* string.
17271727
*/
17281728
appendPQExpBuffer(connstrbuf,"%s dbname=",connstr);
1729-
doConnStrQuoting(connstrbuf,dbname);
1729+
appendConnStrVal(connstrbuf,dbname);
17301730

1731-
doShellQuoting(cmd,connstrbuf->data);
1731+
appendShellString(cmd,connstrbuf->data);
17321732

17331733
if (verbose)
17341734
fprintf(stderr,_("%s: running \"%s\"\n"),progname,cmd->data);
@@ -2008,7 +2008,7 @@ constructConnStr(const char **keywords, const char **values)
20082008
appendPQExpBufferChar(buf,' ');
20092009
firstkeyword= false;
20102010
appendPQExpBuffer(buf,"%s=",keywords[i]);
2011-
doConnStrQuoting(buf,values[i]);
2011+
appendConnStrVal(buf,values[i]);
20122012
}
20132013

20142014
connstr=pg_strdup(buf->data);
@@ -2089,7 +2089,7 @@ dumpTimestamp(const char *msg)
20892089
* string
20902090
*/
20912091
staticvoid
2092-
doConnStrQuoting(PQExpBufferbuf,constchar*str)
2092+
appendConnStrVal(PQExpBufferbuf,constchar*str)
20932093
{
20942094
constchar*s;
20952095
boolneedquotes;
@@ -2138,7 +2138,7 @@ doConnStrQuoting(PQExpBuffer buf, const char *str)
21382138
* there eventually leads to errors here.
21392139
*/
21402140
staticvoid
2141-
doShellQuoting(PQExpBufferbuf,constchar*str)
2141+
appendShellString(PQExpBufferbuf,constchar*str)
21422142
{
21432143
constchar*p;
21442144

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp