@@ -1483,7 +1483,7 @@ update_recovery_options_before_v12(InstanceState *instanceState, pgBackup *backu
14831483}
14841484
14851485elog (LOG ,"update recovery settings in recovery.conf" );
1486- snprintf (path ,lengthof ( path ) ,"%s/ recovery.conf" , instance_config . pgdata );
1486+ join_path_components (path ,instance_config . pgdata ,"recovery.conf" );
14871487
14881488fp = fio_fopen (path ,"w" ,FIO_DB_HOST );
14891489if (fp == NULL )
@@ -1540,8 +1540,7 @@ update_recovery_options(InstanceState *instanceState, pgBackup *backup,
15401540
15411541time2iso (current_time_str ,lengthof (current_time_str ),current_time , false);
15421542
1543- snprintf (postgres_auto_path ,lengthof (postgres_auto_path ),
1544- "%s/postgresql.auto.conf" ,instance_config .pgdata );
1543+ join_path_components (postgres_auto_path ,instance_config .pgdata ,"postgresql.auto.conf" );
15451544
15461545if (fio_stat (postgres_auto_path ,& st , false,FIO_DB_HOST )< 0 )
15471546{
@@ -1651,7 +1650,7 @@ update_recovery_options(InstanceState *instanceState, pgBackup *backup,
16511650if (params -> recovery_settings_mode == PITR_REQUESTED )
16521651{
16531652elog (LOG ,"creating recovery.signal file" );
1654- snprintf (path ,lengthof ( path ) ,"%s/ recovery.signal" , instance_config . pgdata );
1653+ join_path_components (path ,instance_config . pgdata ,"recovery.signal" );
16551654
16561655fp = fio_fopen (path ,PG_BINARY_W ,FIO_DB_HOST );
16571656if (fp == NULL )
@@ -1667,7 +1666,7 @@ update_recovery_options(InstanceState *instanceState, pgBackup *backup,
16671666if (params -> restore_as_replica )
16681667{
16691668elog (LOG ,"creating standby.signal file" );
1670- snprintf (path ,lengthof ( path ) ,"%s/ standby.signal" , instance_config . pgdata );
1669+ join_path_components (path ,instance_config . pgdata ,"standby.signal" );
16711670
16721671fp = fio_fopen (path ,PG_BINARY_W ,FIO_DB_HOST );
16731672if (fp == NULL )
@@ -2163,7 +2162,7 @@ check_incremental_compatibility(const char *pgdata, uint64 system_identifier,
21632162{
21642163char pid_file [MAXPGPATH ];
21652164
2166- snprintf (pid_file ,MAXPGPATH ,"%s/ postmaster.pid" , pgdata );
2165+ join_path_components (pid_file ,pgdata ,"postmaster.pid" );
21672166elog (WARNING ,"Pid file \"%s\" is mangled, cannot determine whether postmaster is running or not" ,
21682167pid_file );
21692168success = false;
@@ -2204,7 +2203,7 @@ check_incremental_compatibility(const char *pgdata, uint64 system_identifier,
22042203 */
22052204if (incremental_mode == INCR_LSN )
22062205{
2207- snprintf (backup_label ,MAXPGPATH ,"%s/ backup_label" , pgdata );
2206+ join_path_components (backup_label ,pgdata ,"backup_label" );
22082207if (fio_access (backup_label ,F_OK ,FIO_DB_HOST )== 0 )
22092208{
22102209elog (WARNING ,"Destination directory contains \"backup_control\" file. "