Your message dated Sat, 14 Nov 2009 16:17:18 +0000
with message-id <[email protected]>
and subject line Bug#538194: fixed in fdm 1.6-2
has caused the Debian Bug report #538194,
regarding fdm doesn't handle EXDEV when linking files.
to be marked as done.
This means that you claim that the problem has been dealt with.
If this is not the case it is now your responsibility to reopen the
Bug report if necessary, and/or fix the problem forthwith.
(NB: If you are a system administrator and have no idea what this
message is talking about, this may indicate a serious mail system
misconfiguration somewhere. Please contact [email protected]
immediately.)
--
538194: http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=538194
Debian Bug Tracking System
Contact [email protected] with problems
--- Begin Message ---
Package: fdm
Version: 1.5-3
Severity: important
Tags: patch
Dear maintainer,
link() fails with EXDEV when you try to link files accross file systems.
On the AFS file system, this also occurs between directories :
http://docs.openafs.org/AdminGuide/ch02.html#HDRWQ32
This special case breaks fdm when using maildirs on OpenAFS.
I suggest a patch which workaround EXDEV by using stat() and rename().
I haven't run fdm's regressions tests on it. I have just checked it on
AFS and ext3.
A similar issue has been fixed in openssh (see #352589).
The same bug certainly exists in other parts of fdm.
Here is the code :
--- fdm-1.5.orig/deliver-maildir.c 2008-03-06 10:25:32.000000000 +0100
+++ fdm-1.5-3.debian.louis/deliver-maildir.c 2009-07-23 21:28:34.418851829
+0200
@@ -146,6 +146,7 @@
char src[MAXPATHLEN], dst[MAXPATHLEN];
int fd;
ssize_t n;
+ struct stat sb;
name = NULL;
fd = -1;
@@ -195,28 +196,52 @@
fd = -1;
/*
- * Create the new path and attempt to link it. A failed link jumps
- * back to find another name in the tmp directory.
+ * Create the new path and attempt to link it. A failed link on EEXIST
+ * jumps back to find another name in the tmp directory.
*/
if (ppath(dst, sizeof dst, "%s/new/%s", path, name) != 0)
goto error_unlink;
log_debug2(
"%s: linking .../tmp/%s to .../new/%s", a->name, name, name);
if (link(src, dst) != 0) {
- if (errno == EEXIST) {
- log_debug2("%s: %s: link failed", a->name, src);
+ log_debug2("%s: %s: link failed", a->name, src);
+ /*
+ * EXDEV must also be handled, especially for the AFS filesystem
+ * where hardlinks can't traverse directories :
+ * http://docs.openafs.org/AdminGuide/ch02.html#HDRWQ32
+ */
+ if (errno == EXDEV) {
+ log_debug2("%s: renaming .../tmp/%s to .../new/%s",
+ a->name, name, name);
+ /*
+ * But stat + rename can be racy.
+ */
+ if (stat(dst, &sb) == -1) {
+ if (errno != ENOENT || rename(src, dst) != 0) {
+ log_debug2("%s: %s: rename failed",
+ a->name, src);
+ goto error_cleanup;
+ }
+ } else { /* EEXIST */
+ if (unlink(src) != 0)
+ fatal("unlink failed");
+ cleanup_deregister(src);
+ goto restart;
+ }
+ } else if (errno == EEXIST) {
if (unlink(src) != 0)
fatal("unlink failed");
cleanup_deregister(src);
goto restart;
- }
- goto error_unlink;
+ } else /* Dot it only if we are not on EXDEV */
+ goto error_unlink;
+ } else {
+ /* Unlink the original tmp file. */
+ log_debug2("%s: unlinking .../tmp/%s", a->name, name);
+ if (unlink(src) != 0)
+ goto error_unlink;
}
- /* Unlink the original tmp file. */
- log_debug2("%s: unlinking .../tmp/%s", a->name, name);
- if (unlink(src) != 0)
- goto error_unlink;
cleanup_deregister(src);
/* Save the mail file as a tag. */
@@ -229,6 +254,7 @@
error_unlink:
if (unlink(src) != 0)
fatal("unlink failed");
+error_cleanup:
cleanup_deregister(src);
error_log:
Please, tell me any suggestion.
Best regards, Louis Opter.
-- System Information:
Debian Release: 5.0.2
APT prefers stable
APT policy: (500, 'stable')
Architecture: amd64 (x86_64)
Kernel: Linux 2.6.26-2-amd64 (SMP w/2 CPU cores)
Locale: LANG=en_US.UTF-8, LC_CTYPE=en_US.UTF-8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/bash
Versions of packages fdm depends on:
ii adduser 3.110 add and remove users and groups
ii libc6 2.7-18 GNU C Library: Shared libraries
ii libpcre3 7.6-2.1 Perl 5 Compatible Regular Expressi
ii libssl0.9.8 0.9.8g-15+lenny1 SSL shared libraries
ii libtdb1 1.1.2~git20080615-1 Trivial Database - shared library
ii zlib1g 1:1.2.3.3.dfsg-12 compression library - runtime
fdm recommends no packages.
fdm suggests no packages.
-- no debconf information
--- End Message ---
--- Begin Message ---
Source: fdm
Source-Version: 1.6-2
We believe that the bug you reported is fixed in the latest version of
fdm, which is due to be installed in the Debian FTP archive:
fdm_1.6-2.diff.gz
to main/f/fdm/fdm_1.6-2.diff.gz
fdm_1.6-2.dsc
to main/f/fdm/fdm_1.6-2.dsc
fdm_1.6-2_amd64.deb
to main/f/fdm/fdm_1.6-2_amd64.deb
A summary of the changes between this version and the previous one is
attached.
Thank you for reporting the bug, which will now be closed. If you
have further comments please address them to [email protected],
and the maintainer will reopen the bug report if appropriate.
Debian distribution maintenance software
pp.
Frank Terbeck <[email protected]> (supplier of updated fdm package)
(This message was generated automatically at their request; if you
believe that there is a problem with it please contact the archive
administrators by mailing [email protected])
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
Format: 1.8
Date: Wed, 11 Nov 2009 11:51:21 +0100
Source: fdm
Binary: fdm
Architecture: source amd64
Version: 1.6-2
Distribution: unstable
Urgency: low
Maintainer: Frank Terbeck <[email protected]>
Changed-By: Frank Terbeck <[email protected]>
Description:
fdm - fetching, filtering and delivering emails
Closes: 538194 554287
Changes:
fdm (1.6-2) unstable; urgency=low
.
* Adding -lcrypto do $(LIBS) to support GNU gold (Closes: #554287)
* Adding 05savemove.patch from Louis Opter. Sorry for the incredibly
long delay. It fell through the cracks. (Closes: #538194)
* Incrementing Standards-Version, no changes needed
* Adding debian/README.source to please lintian yet again.
Checksums-Sha1:
f7f8866ed5d43b5f8cef3473ba0381ffae8dd527 1019 fdm_1.6-2.dsc
bbdd5bf58ce1f23ced9be69b10d9fc1c3bdc8972 7664 fdm_1.6-2.diff.gz
2c038b7eb0ab6fde13bccd8c9b238b58486ee4b9 162638 fdm_1.6-2_amd64.deb
Checksums-Sha256:
468b73ddb64e15cd789ecb34a174e648b720feae390cf0425a3b77c6a70996b7 1019
fdm_1.6-2.dsc
025ae941f9dd3dc5011306d27b3b81b867c955e7447b3cb8f6595a27b57f2536 7664
fdm_1.6-2.diff.gz
903e59193f5bdcff0017ba3ac9c7e3c63b4f05bd772831343eabd653f0928d49 162638
fdm_1.6-2_amd64.deb
Files:
76ea658b8454dc436acf58f39035ea35 1019 mail optional fdm_1.6-2.dsc
5fa0f434a95396c40268c189f1d3a623 7664 mail optional fdm_1.6-2.diff.gz
9f1b2d3cc8ea882a17f402666e95a0bc 162638 mail optional fdm_1.6-2_amd64.deb
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.9 (GNU/Linux)
iEYEARECAAYFAkr+zzQACgkQHYflSXNkfP92iACgnD1an85/i71H4iD9wXjqkQrX
rOgAnjWow0ChGdIv8DMEGTCD2e/X/g67
=KL3i
-----END PGP SIGNATURE-----
--- End Message ---