[hypermail] Followup [was New bug: attachments are not being overwritten]

From: Jose Kahan <jose.kahan_at_w3.org_at_hypermail-project.org>
Date: Tue, 29 Jul 2003 18:41:22 +0200
Message-ID: <20030729164122.GC4378_at_inrialpes.fr>


The problem is in parse.c, lime 2392-2398:

#ifdef O_BINARY
#define OPENBITMASK O_WRONLY | O_CREAT | O_BINARY
#else
#define OPENBITMASK O_WRONLY | O_CREAT
#endif
                            if (binname) {
			        binfile = open(binname, OPENBITMASK,
				set_filemode); 

O_CREAT won't create a file if it already existsi, at least under Linux and Solaris 5.8:



O_CREAT
    Create the file if it does not exist. This flag     requires that the mode argument be specified.

    If the file exists, this flag has no effect except as     noted under O_EXCL below.


Using or not using the hypermail overwrite option produces the same behavior for attachments.

The solution is either to unlink the file if it already exists or remove the O_CREAT flag and use a chmod afterwards to set the access rights.

Which solution shall we adopt?

-jose Received on Tue 29 Jul 2003 06:41:49 PM GMT

This archive was generated by hypermail 2.3.0 : Sat 13 Mar 2010 03:46:12 AM GMT GMT