Relax chown requirements when check_owner is false debian/4.84-8+hcoop1
authorClinton Ebadi <clinton@unknownlamer.org>
Thu, 14 May 2015 03:26:29 +0000 (23:26 -0400)
committerClinton Ebadi <clinton@unknownlamer.org>
Thu, 14 May 2015 03:34:04 +0000 (23:34 -0400)
HCoop delivers into /afs, and the chown will always fail since the
effective unix user and openafs role ($user.daemon) are not the
same. This is harmless in afs space, and it seems reasonable enough to
not care about the chown failing in the general case when exim will
ignore the perms afterward / if the file already exists and it is
appending to it.

debian/changelog
debian/patches/50-relax-appendfile-chown-openafs.patch [new file with mode: 0644]
debian/patches/series

index 3e072fd..0b746a7 100644 (file)
@@ -1,3 +1,9 @@
+exim4 (4.84-8+hcoop1) unstable; urgency=medium
+
+  * Relax chown requirement for delivery into afs
+
+ -- Clinton Ebadi <clinton@unknownlamer.org>  Wed, 13 May 2015 23:26:54 -0400
+
 exim4 (4.84-8) unstable; urgency=medium
 
   * Pull 83_Remove-limit-on-remove_headers-item-size.-Bug-1533.patch and
diff --git a/debian/patches/50-relax-appendfile-chown-openafs.patch b/debian/patches/50-relax-appendfile-chown-openafs.patch
new file mode 100644 (file)
index 0000000..1e89bfe
--- /dev/null
@@ -0,0 +1,35 @@
+--- a/src/transports/appendfile.c
++++ b/src/transports/appendfile.c
+@@ -1769,19 +1769,28 @@
+         goto RETURN;
+         }
+-      /* We have successfully created and opened the file. Ensure that the group
++      /* We have successfully created and opened the file. Ensure that the owner
+       and the mode are correct. */
+-      if(Uchown(filename, uid, gid) || Uchmod(filename, mode))
++      /* Ignore failed chown if check_owner is disabled. */
++      if(Uchown(filename, uid, gid) && ob->check_owner)
+         {
+         addr->basic_errno = errno;
+-        addr->message = string_sprintf("while setting perms on mailbox %s",
++        addr->message = string_sprintf("while setting owner on mailbox %s",
+           filename);
+         addr->transport_return = FAIL;
+         goto RETURN;
+         }
+-      }
++      if(Uchmod(filename, mode))
++      {
++        addr->basic_errno = errno;
++        addr->message = string_sprintf("while setting perms on mailbox %s",
++          filename);
++        addr->transport_return = FAIL;
++        goto RETURN;
++      }
++      }
+     /* The file already exists. Test its type, ownership, and permissions, and
+     save the inode for checking later. If symlinks are permitted (not the
index 7e55c37..8a882b2 100644 (file)
@@ -4,6 +4,7 @@
 34_eximstatsmanpage.dpatch
 35_install.dpatch
 50_localscan_dlopen.dpatch
+50-relax-appendfile-chown-openafs.patch
 60_convert4r4.dpatch
 66_enlarge-dh-parameters-size.dpatch
 67_unnecessaryCopt.diff