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

Commited790f4

Browse files
committed
Support encryuption only for remote backup
1 parente6de9e4 commited790f4

File tree

1 file changed

+19
-5
lines changed

1 file changed

+19
-5
lines changed

‎src/pg_probackup.c‎

Lines changed: 19 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -135,6 +135,7 @@ static void opt_backup_mode(ConfigOption *opt, const char *arg);
135135
staticvoidopt_show_format(ConfigOption*opt,constchar*arg);
136136

137137
staticvoidcompress_init(void);
138+
staticvoidencryption_init(void);
138139

139140
/*
140141
* Short name should be non-printable ASCII character.
@@ -600,9 +601,8 @@ main(int argc, char *argv[])
600601
if (num_threads<1)
601602
num_threads=1;
602603

604+
encryption_init();
603605
compress_init();
604-
if (instance_config.encryption)
605-
fio_crypto_init();
606606

607607
/* do actual operation */
608608
switch (backup_subcmd)
@@ -714,6 +714,23 @@ opt_show_format(ConfigOption *opt, const char *arg)
714714
elog(ERROR,"Invalid show format \"%s\"",arg);
715715
}
716716

717+
/*
718+
* Initialize encryption support.
719+
*/
720+
staticvoidencryption_init(void)
721+
{
722+
if (encryption_shortcut)
723+
instance_config.encryption=encryption_shortcut;
724+
725+
if (instance_config.encryption)
726+
{
727+
if (!instance_config.remote.host)
728+
elog(ERROR,"Encryp;tion is upported only for remote backups");
729+
730+
fio_crypto_init();
731+
}
732+
}
733+
717734
/*
718735
* Initialize compress and sanity checks for compress.
719736
*/
@@ -724,9 +741,6 @@ compress_init(void)
724741
if (compress_shortcut)
725742
instance_config.compress_alg=ZLIB_COMPRESS;
726743

727-
if (encryption_shortcut)
728-
instance_config.encryption=encryption_shortcut;
729-
730744
if (backup_subcmd!=SET_CONFIG_CMD)
731745
{
732746
if (instance_config.compress_level!=COMPRESS_LEVEL_DEFAULT

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp