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

Commitc1b048f

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 parent395d565 commitc1b048f

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(char*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,
@@ -213,7 +213,7 @@ main(int argc, char *argv[])
213213
case'f':
214214
filename=pg_strdup(optarg);
215215
appendPQExpBuffer(pgdumpopts," -f ");
216-
doShellQuoting(pgdumpopts,filename);
216+
appendShellString(pgdumpopts,filename);
217217
break;
218218

219219
case'g':
@@ -254,7 +254,7 @@ main(int argc, char *argv[])
254254

255255
case'S':
256256
appendPQExpBuffer(pgdumpopts," -S ");
257-
doShellQuoting(pgdumpopts,optarg);
257+
appendShellString(pgdumpopts,optarg);
258258
break;
259259

260260
case't':
@@ -290,13 +290,13 @@ main(int argc, char *argv[])
290290

291291
case2:
292292
appendPQExpBuffer(pgdumpopts," --lock-wait-timeout ");
293-
doShellQuoting(pgdumpopts,optarg);
293+
appendShellString(pgdumpopts,optarg);
294294
break;
295295

296296
case3:
297297
use_role=pg_strdup(optarg);
298298
appendPQExpBuffer(pgdumpopts," --role ");
299-
doShellQuoting(pgdumpopts,use_role);
299+
appendShellString(pgdumpopts,use_role);
300300
break;
301301

302302
default:
@@ -1699,9 +1699,9 @@ runPgDump(const char *dbname)
16991699
* string.
17001700
*/
17011701
appendPQExpBuffer(connstrbuf,"%s dbname=",connstr);
1702-
doConnStrQuoting(connstrbuf,dbname);
1702+
appendConnStrVal(connstrbuf,dbname);
17031703

1704-
doShellQuoting(cmd,connstrbuf->data);
1704+
appendShellString(cmd,connstrbuf->data);
17051705

17061706
appendPQExpBuffer(cmd,"%s",SYSTEMQUOTE);
17071707

@@ -1983,7 +1983,7 @@ constructConnStr(const char **keywords, const char **values)
19831983
appendPQExpBufferChar(buf,' ');
19841984
firstkeyword= false;
19851985
appendPQExpBuffer(buf,"%s=",keywords[i]);
1986-
doConnStrQuoting(buf,values[i]);
1986+
appendConnStrVal(buf,values[i]);
19871987
}
19881988

19891989
connstr=pg_strdup(buf->data);
@@ -2076,7 +2076,7 @@ dumpTimestamp(char *msg)
20762076
* string
20772077
*/
20782078
staticvoid
2079-
doConnStrQuoting(PQExpBufferbuf,constchar*str)
2079+
appendConnStrVal(PQExpBufferbuf,constchar*str)
20802080
{
20812081
constchar*s;
20822082
boolneedquotes;
@@ -2125,7 +2125,7 @@ doConnStrQuoting(PQExpBuffer buf, const char *str)
21252125
* there eventually leads to errors here.
21262126
*/
21272127
staticvoid
2128-
doShellQuoting(PQExpBufferbuf,constchar*str)
2128+
appendShellString(PQExpBufferbuf,constchar*str)
21292129
{
21302130
constchar*p;
21312131

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp