From 4f81a8adc274d0b171e1a2116b772ba894bbf357 Mon Sep 17 00:00:00 2001 From: Andreas Schneider Date: Tue, 13 May 2008 16:05:11 +0200 Subject: [PATCH] Fix typo. Wrong uri was used for remote replica. --- src/csync_time.c | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/src/csync_time.c b/src/csync_time.c index 92f4ecb05..9e3364751 100644 --- a/src/csync_time.c +++ b/src/csync_time.c @@ -41,6 +41,15 @@ time_t csync_timediff(CSYNC *ctx) { char *ruri = NULL; csync_vio_handle_t *fp = NULL; csync_vio_file_stat_t *st = NULL; + csync_vio_handle_t *dp = NULL; + + /* try to open remote dir to get auth */ + ctx->replica = ctx->remote.type; + dp = csync_vio_opendir(ctx, ctx->remote.uri); + if (dp == NULL) { + return -1; + } + csync_vio_closedir(ctx, dp); if (asprintf(&luri, "%s/csync_timediff.ctmp", ctx->local.uri) < 0) { goto out; @@ -71,7 +80,8 @@ time_t csync_timediff(CSYNC *ctx) { /* create temporary file on remote replica */ ctx->replica = ctx->remote.type; - fp = csync_vio_creat(ctx, luri, 0644); + + fp = csync_vio_creat(ctx, ruri, 0644); if (fp == NULL) { CSYNC_LOG(CSYNC_LOG_PRIORITY_FATAL, "Unable to create temporary file: %s - %s", ruri, strerror(errno)); goto out; @@ -80,7 +90,7 @@ time_t csync_timediff(CSYNC *ctx) { /* Get the modification time */ st = csync_vio_file_stat_new(); - if (csync_vio_stat(ctx, luri, st) < 0) { + if (csync_vio_stat(ctx, ruri, st) < 0) { CSYNC_LOG(CSYNC_LOG_PRIORITY_FATAL, "Synchronisation is not possible! %s - %s", ruri, strerror(errno)); goto out; }