1
0
mirror of https://github.com/pgbackrest/pgbackrest.git synced 2024-12-14 10:13:05 +02:00
pgbackrest/lib/pgBackRest
David Steele 451ae397be The restore command is implemented entirely in C.
For the most part this is a direct migration of the Perl code into C.

There is one important behavioral change with regard to how file permissions are handled.  The Perl code tried to set ownership as it was in the manifest even when running as an unprivileged user.  This usually just led to errors and frustration.

The C code works like this:

If a restore is run as a non-root user (the typical scenario) then all files restored will belong to the user/group executing pgBackRest. If existing files are not owned by the executing user/group then an error will result if the ownership cannot be updated to the executing user/group. In that case the file ownership will need to be updated by a privileged user before the restore can be retried.

If a restore is run as the root user then pgBackRest will attempt to recreate the ownership recorded in the manifest when the backup was made. Only user/group names are stored in the manifest so the same names must exist on the restore host for this to work. If the user/group name cannot be found locally then the user/group of the PostgreSQL data directory will be used and finally root if the data directory user/group cannot be mapped to a name.

Reviewed by Cynthia Shang.
2019-09-26 07:52:02 -04:00
..
Archive Update HINT messages to conform to new standard detailed in CODING.md. 2019-09-14 12:21:08 -04:00
Backup Update HINT messages to conform to new standard detailed in CODING.md. 2019-09-14 12:21:08 -04:00
Check Fix comment typos. 2019-08-26 12:05:36 -04:00
Common Update HINT messages to conform to new standard detailed in CODING.md. 2019-09-14 12:21:08 -04:00
Config Fix comment typos. 2019-08-26 12:05:36 -04:00
Protocol Don't decode manifest data when it is generated on a remote. 2019-09-03 12:30:45 -04:00
Storage Don't decode manifest data when it is generated on a remote. 2019-09-03 12:30:45 -04:00
Db.pm Update HINT messages to conform to new standard detailed in CODING.md. 2019-09-14 12:21:08 -04:00
DbVersion.pm Fix static WAL segment size used to determine if archive-push-queue-max has been exceeded. 2018-10-27 20:00:00 +01:00
InfoCommon.pm Added stanza-upgrade command. 2017-04-03 10:42:55 -04:00
LibC.pm Remove perl critic and coverage. 2019-07-05 16:55:17 -04:00
LibCAuto.pm Add recursion and json output to the ls command. 2019-09-12 16:29:50 -04:00
Main.pm The restore command is implemented entirely in C. 2019-09-26 07:52:02 -04:00
Manifest.pm Fix comment typos. 2019-08-26 12:05:36 -04:00
Version.pm Begin v2.18 development. 2019-09-03 17:53:50 -04:00