pg.ddx.io  pgsql-hackers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Noah Misch <noah@leadboat.com>
To: Andres Freund <andres@anarazel.de>
Cc: Robert Haas <robertmhaas@gmail.com>
Cc: David Steele <david@pgmasters.net>
Cc: Stephen Frost <sfrost@snowman.net>
Cc: Amit Kapila <amit.kapila16@gmail.com>
Cc: Suraj Kharage <suraj.kharage@enterprisedb.com>
Cc: tushar <tushar.ahuja@enterprisedb.com>
Cc: Rajkumar Raghuwanshi <rajkumar.raghuwanshi@enterprisedb.com>
Cc: Rushabh Lathia <rushabh.lathia@gmail.com>
Cc: Tels <nospam-pg-abuse@bloodgate.com>
Cc: Andrew Dunstan <andrew.dunstan@2ndquadrant.com>
Cc: PostgreSQL Hackers <pgsql-hackers@postgresql.org>
Cc: Jeevan Chalke <jeevan.chalke@enterprisedb.com>
Cc: vignesh C <vignesh21@gmail.com>
Subject: Re: backup manifests
Date: Tue, 31 Mar 2020 22:15:04 -0700
Message-ID: <20200401051504.GA3366291@rfd.leadboat.com> (raw)
In-Reply-To: <20200331225034.odt3l2w4h3dr6ggk@alap3.anarazel.de>
References: <CA+TgmoZfj3wqcgoaXp+4a7ZSk3coARcxvghT7m=7Hf=8r6st6w@mail.gmail.com>
	<20200329034010.GB2247658@rfd.leadboat.com>
	<CA+TgmobSzurSGzy4uLXq__h3pKFnb4RFHepa6yxs3h4d3gwGEg@mail.gmail.com>
	<20200330010740.4remdjgnftyuiz2v@alap3.anarazel.de>
	<ddbb128b-86e5-7ffb-b5dc-15a414dfde0e@pgmasters.net>
	<20200330020814.nspra4mvby42yoa4@alap3.anarazel.de>
	<CA+TgmoZj9tuVRDw=wj1p2-TTSJ+qUEWvh6updZJsw-5gxWUW1w@mail.gmail.com>
	<20200330185944.42bxysvem6b757ew@alap3.anarazel.de>
	<CA+TgmoawEeE5qpFgj5Vy2zZGKzd3ZSEhGrD_JdPqPd2GB8u1Cw@mail.gmail.com>
	<20200331225034.odt3l2w4h3dr6ggk@alap3.anarazel.de>

On Tue, Mar 31, 2020 at 03:50:34PM -0700, Andres Freund wrote:
> On 2020-03-31 14:10:34 -0400, Robert Haas wrote:
> > +/*
> > + * Attempt to parse the WAL files required to restore from backup using
> > + * pg_waldump.
> > + */
> > +static void
> > +parse_required_wal(validator_context *context, char *pg_waldump_path,
> > +				   char *wal_directory, manifest_wal_range *first_wal_range)
> > +{
> > +	manifest_wal_range *this_wal_range = first_wal_range;
> > +
> > +	while (this_wal_range != NULL)
> > +	{
> > +		char *pg_waldump_cmd;
> > +
> > +		pg_waldump_cmd = psprintf("\"%s\" --quiet --path=\"%s\" --timeline=%u --start=%X/%X --end=%X/%X\n",
> > +			   pg_waldump_path, wal_directory, this_wal_range->tli,
> > +			   (uint32) (this_wal_range->start_lsn >> 32),
> > +			   (uint32) this_wal_range->start_lsn,
> > +			   (uint32) (this_wal_range->end_lsn >> 32),
> > +			   (uint32) this_wal_range->end_lsn);
> > +		if (system(pg_waldump_cmd) != 0)
> > +			report_backup_error(context,
> > +								"WAL parsing failed for timeline %u",
> > +								this_wal_range->tli);
> > +
> > +		this_wal_range = this_wal_range->next;
> > +	}
> > +}
> 
> Should we have a function to properly escape paths in cases like this?
> Not that it's likely or really problematic, but the quoting for path
> could be "circumvented".

Are you looking for appendShellString(), or something different?





view thread (243+ messages)  latest in thread

Message-ID: <20200401051504.GA3366291@rfd.leadboat.com>
Permalink:  ../20200401051504.GA3366291@rfd.leadboat.com/
Also on:    postgresql.org/message-id/20200401051504.GA3366291@rfd.leadboat.com

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-hackers@postgresql.org
  Cc: noah@leadboat.com, andres@anarazel.de, robertmhaas@gmail.com, david@pgmasters.net, sfrost@snowman.net, amit.kapila16@gmail.com, suraj.kharage@enterprisedb.com, tushar.ahuja@enterprisedb.com, rajkumar.raghuwanshi@enterprisedb.com, rushabh.lathia@gmail.com, nospam-pg-abuse@bloodgate.com, andrew.dunstan@2ndquadrant.com, jeevan.chalke@enterprisedb.com, vignesh21@gmail.com
  Subject: Re: backup manifests
  In-Reply-To: <20200401051504.GA3366291@rfd.leadboat.com>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox