Re: backup manifests

From: Noah Misch <noah(at)leadboat(dot)com>
To: Andres Freund <andres(at)anarazel(dot)de>
Cc: Robert Haas <robertmhaas(at)gmail(dot)com>, David Steele <david(at)pgmasters(dot)net>, Stephen Frost <sfrost(at)snowman(dot)net>, Amit Kapila <amit(dot)kapila16(at)gmail(dot)com>, Suraj Kharage <suraj(dot)kharage(at)enterprisedb(dot)com>, tushar <tushar(dot)ahuja(at)enterprisedb(dot)com>, Rajkumar Raghuwanshi <rajkumar(dot)raghuwanshi(at)enterprisedb(dot)com>, Rushabh Lathia <rushabh(dot)lathia(at)gmail(dot)com>, Tels <nospam-pg-abuse(at)bloodgate(dot)com>, Andrew Dunstan <andrew(dot)dunstan(at)2ndquadrant(dot)com>, PostgreSQL Hackers <pgsql-hackers(at)postgresql(dot)org>, Jeevan Chalke <jeevan(dot)chalke(at)enterprisedb(dot)com>, vignesh C <vignesh21(at)gmail(dot)com>
Subject: Re: backup manifests
Date: 2020-04-01 05:15:04
Message-ID: 20200401051504.GA3366291@rfd.leadboat.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

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?

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Kyotaro Horiguchi 2020-04-01 05:39:22 Re: [HACKERS] Restricting maximum keep segments by repslots
Previous Message Andres Freund 2020-04-01 04:53:04 wraparound dangers in snapshot too old