@@ -1480,7 +1480,7 @@ update_recovery_options_before_v12(pgBackup *backup,
14801480}
14811481
14821482elog (LOG ,"update recovery settings in recovery.conf" );
1483- snprintf (path ,lengthof ( path ) ,"%s/ recovery.conf" , instance_config . pgdata );
1483+ join_path_components (path ,instance_config . pgdata ,"recovery.conf" );
14841484
14851485fp = fio_fopen (path ,"w" ,FIO_DB_HOST );
14861486if (fp == NULL )
@@ -1537,8 +1537,7 @@ update_recovery_options(pgBackup *backup,
15371537
15381538time2iso (current_time_str ,lengthof (current_time_str ),current_time , false);
15391539
1540- snprintf (postgres_auto_path ,lengthof (postgres_auto_path ),
1541- "%s/postgresql.auto.conf" ,instance_config .pgdata );
1540+ join_path_components (postgres_auto_path ,instance_config .pgdata ,"postgresql.auto.conf" );
15421541
15431542if (fio_stat (postgres_auto_path ,& st , false,FIO_DB_HOST )< 0 )
15441543{
@@ -1648,7 +1647,7 @@ update_recovery_options(pgBackup *backup,
16481647if (params -> recovery_settings_mode == PITR_REQUESTED )
16491648{
16501649elog (LOG ,"creating recovery.signal file" );
1651- snprintf (path ,lengthof ( path ) ,"%s/ recovery.signal" , instance_config . pgdata );
1650+ join_path_components (path ,instance_config . pgdata ,"recovery.signal" );
16521651
16531652fp = fio_fopen (path ,PG_BINARY_W ,FIO_DB_HOST );
16541653if (fp == NULL )
@@ -1664,7 +1663,7 @@ update_recovery_options(pgBackup *backup,
16641663if (params -> restore_as_replica )
16651664{
16661665elog (LOG ,"creating standby.signal file" );
1667- snprintf (path ,lengthof ( path ) ,"%s/ standby.signal" , instance_config . pgdata );
1666+ join_path_components (path ,instance_config . pgdata ,"standby.signal" );
16681667
16691668fp = fio_fopen (path ,PG_BINARY_W ,FIO_DB_HOST );
16701669if (fp == NULL )
@@ -2160,7 +2159,7 @@ check_incremental_compatibility(const char *pgdata, uint64 system_identifier,
21602159{
21612160char pid_file [MAXPGPATH ];
21622161
2163- snprintf (pid_file ,MAXPGPATH ,"%s/ postmaster.pid" , pgdata );
2162+ join_path_components (pid_file ,pgdata ,"postmaster.pid" );
21642163elog (WARNING ,"Pid file \"%s\" is mangled, cannot determine whether postmaster is running or not" ,
21652164pid_file );
21662165success = false;
@@ -2201,7 +2200,7 @@ check_incremental_compatibility(const char *pgdata, uint64 system_identifier,
22012200 */
22022201if (incremental_mode == INCR_LSN )
22032202{
2204- snprintf (backup_label ,MAXPGPATH ,"%s/ backup_label" , pgdata );
2203+ join_path_components (backup_label ,pgdata ,"backup_label" );
22052204if (fio_access (backup_label ,F_OK ,FIO_DB_HOST )== 0 )
22062205{
22072206elog (WARNING ,"Destination directory contains \"backup_control\" file. "