From: Timo Sirainen Date: Mon, 20 Jun 2016 14:52:28 +0000 (+0300) Subject: lib: file_create_locked() - Unexpectedly deleted temp file is error. X-Git-Tag: 2.3.0.rc1~3461 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=ee0a6db8fe59b301c58b99e073687ae049d29a53;p=thirdparty%2Fdovecot%2Fcore.git lib: file_create_locked() - Unexpectedly deleted temp file is error. This shouldn't happen and we shouldn't be silently retrying if it does. --- diff --git a/src/lib/file-create-locked.c b/src/lib/file-create-locked.c index 3ea4c66b70..905e8cdc01 100644 --- a/src/lib/file-create-locked.c +++ b/src/lib/file-create-locked.c @@ -69,9 +69,11 @@ try_create_new(const char *path, const struct file_create_settings *set, /* just created by somebody else */ ret = 0; } else if (errno == ENOENT) { - /* our temp file was just deleted by somebody else, - retry creating it. */ - ret = 0; + /* nobody should be deleting the temp file unless the + entire directory is deleted. */ + *error_r = t_strdup_printf( + "Temporary file %s was unexpectedly deleted", + str_c(temp_path)); } else { *error_r = t_strdup_printf("link(%s, %s) failed: %m", str_c(temp_path), path);