Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!

Bug 290461

Summary: net-mail/vpopmail-5.4.16 fail to compile using gcc-4.3
Product: Gentoo Linux Reporter: Alex Efros <powerman-asdf>
Component: New packagesAssignee: Benedikt Böhm (RETIRED) <hollow>
Status: RESOLVED FIXED    
Severity: normal CC: esigra, fauli, johntash, nyctelecomm, qmail-bugs+disabled
Priority: High    
Version: unspecified   
Hardware: All   
OS: Linux   
Whiteboard:
Package list:
Runtime testing required: ---
Bug Depends on:    
Bug Blocks: 198121    

Description Alex Efros 2009-10-25 13:13:07 UTC
It's well-known gcc-4.3 issue with open(O_CREAT) without 4th param (permissions). I'll attach the patch.

Reproducible: Always
Comment 1 Alex Efros 2009-10-25 13:22:12 UTC
Looks like there some bug in bugzilla itself - I can't attach patch because of bugzilla error "undef error - Undefined subroutine Fh::slice at template/en/custom/global/hidden-fields.html.tmpl line 44". So I'll include patch here. :(

I've just added 0644 permissions without thinking to make it compiling, so from security bla bla etc view some other permissions may be preferable.

---cut---
diff -uNr vpopmail-5.4.16.orig/vpopmail.c vpopmail-5.4.16/vpopmail.c
--- vpopmail-5.4.16.orig/vpopmail.c	2009-10-25 12:55:15.000000000 +0000
+++ vpopmail-5.4.16/vpopmail.c	2009-10-25 13:06:43.000000000 +0000
@@ -1201,7 +1201,7 @@
 
 #ifdef FILE_LOCKING
   snprintf(tmpbuf1, sizeof(tmpbuf1), "%s.lock", filename);
-  if ( (fd3 = open(tmpbuf1, O_WRONLY | O_CREAT)) < 0 ) {
+  if ( (fd3 = open(tmpbuf1, O_WRONLY | O_CREAT, 0644)) < 0 ) {
     fprintf(stderr, "could not open lock file %s\n", tmpbuf1);
     return(VA_COULD_NOT_UPDATE_FILE);
   }
@@ -1755,7 +1755,7 @@
 
 #ifdef FILE_LOCKING
   snprintf(tmpbuf1, sizeof(tmpbuf1), "%s.lock", filename);
-  if ( (fd3 = open(tmpbuf1, O_WRONLY | O_CREAT)) < 0 ) {
+  if ( (fd3 = open(tmpbuf1, O_WRONLY | O_CREAT, 0644)) < 0 ) {
     fprintf(stderr, "could not open lock file %s\n", tmpbuf1);
     return(VA_COULD_NOT_UPDATE_FILE);
   }
@@ -1864,7 +1864,7 @@
 
 #ifdef FILE_LOCKING
   snprintf(tmpbuf1, sizeof(tmpbuf1), "%s.lock", filename);
-  if ( (fd3 = open(tmpbuf1, O_WRONLY | O_CREAT)) < 0 ) {
+  if ( (fd3 = open(tmpbuf1, O_WRONLY | O_CREAT, 0644)) < 0 ) {
     fprintf(stderr, "could not open lock file %s\n", tmpbuf1);
     return(VA_COULD_NOT_UPDATE_FILE);
   }
---cut---
Comment 2 Christian Faulhammer (RETIRED) gentoo-dev 2009-11-07 16:03:38 UTC
What about the newer versions of vpopmail? Maybe we can get it stabilised?
Comment 3 Sebastian Luther (few) 2009-11-09 07:11:04 UTC
*** Bug 292473 has been marked as a duplicate of this bug. ***
Comment 4 johntash 2009-11-17 04:01:43 UTC
(In reply to comment #2)
> What about the newer versions of vpopmail? Maybe we can get it stabilised?
> 

I was getting the same error with gcc 4.3 and vpopmail 5.4.16.  Added "=net-mail/vpopmail-5.4.26" to package.keywords and it compiled/emerged without a problem.   As for actually working.. We'll see :)
Comment 5 Christian Faulhammer (RETIRED) gentoo-dev 2009-12-29 12:05:38 UTC
Regarding this issue as fixed...I will try to stabilise vpopmail 5.4.30 as soon as possibly, which will be bumped soon.