Don't create the remote directory if it doesn't exist.

This commit is contained in:
Andreas Schneider 2008-06-13 18:44:15 +02:00
parent afa3bd7b80
commit c24411e5e5

View file

@ -47,11 +47,13 @@ time_t csync_timediff(CSYNC *ctx) {
ctx->replica = ctx->remote.type;
dp = csync_vio_opendir(ctx, ctx->remote.uri);
if (dp == NULL) {
if (csync_vio_mkdir(ctx, ctx->remote.uri, 0755) < 0) {
CSYNC_LOG(CSYNC_LOG_PRIORITY_FATAL, "Unable to create directory on remote uri: %s - %s", luri, strerror(errno));
/*
* To prevent problems especially with pam_csync we shouldn't try to create the
* remote directory here. Just fail!
*/
CSYNC_LOG(CSYNC_LOG_PRIORITY_FATAL, "Access dienied to remote uri: %s - %s", ctx->remote.uri, strerror(errno));
return -1;
}
}
csync_vio_closedir(ctx, dp);
if (asprintf(&luri, "%s/csync_timediff.ctmp", ctx->local.uri) < 0) {