Re: Bug fix in vacuumdb --buffer-usage-limit xxx -Z
David Rowley <dgrowleyml@gmail.com>
From: David Rowley <dgrowleyml@gmail.com>
To: Ryoga Yoshida <bt23yoshidar@oss.nttdata.com>
Cc: pgsql-hackers@lists.postgresql.org
Date: 2023-09-21T05:50:26Z
Lists: pgsql-hackers
On Thu, 21 Sept 2023 at 16:18, David Rowley <dgrowleyml@gmail.com> wrote: > Thanks for the report and the patch. I agree this has been overlooked. > > I also wonder if we should be escaping the buffer-usage-limit string > sent in the comment. It seems quite an unlikely attack vector, as the > user would have command line access and could likely just use psql > anyway, but I had thought about something along the lines of: > > $ vacuumdb --buffer-usage-limit "1MB'); drop database postgres;--" postgres > vacuumdb: vacuuming database "postgres" > vacuumdb: error: processing of database "postgres" failed: ERROR: > VACUUM cannot run inside a transaction block > > seems that won't work, due to sending multiple commands at once, but I > think we should fix it anyway. I've pushed your patch plus some additional code to escape the text specified in --buffer-usage-limit before passing it to the server in commit 5cfba1ad6 Thanks again for the report. David
Commits
-
Fix vacuumdb to pass buffer-usage-limit with analyze-only mode
- 5cfba1ad69c6 17.0 landed
- f7dbdab051d0 16.1 landed