Package: root-system
Version: 5.18.00-2
Severity: normal
Tags: patch
User: [EMAIL PROTECTED]
Usertags: origin-ubuntu intrepid ubuntu-patch

Hi,

In Ubuntu your package failed to build due to incomplete calls to
open.

cd src/XrdSecpwd;\
        /usr/bin/make all ARCH=i386_linux26 --no-print-directory
Compiling XrdSecpwdSrvAdmin.cc
g++ -c -D_LARGEFILE_SOURCE -D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64 
-D_ALL_SOURCE -D_REENTRANT -D_GNU_SOURCE -fPIC -rdynamic -Wall -Wno-deprecated 
-D__linux__  -O2 -DXrdDEBUG=0  -I. -I.. -o ../../obj/XrdSecpwdSrvAdmin.o 
XrdSecpwdSrvAdmin.cc
In file included from ../XrdSut/XrdSutPFile.hh:19,
                 from XrdSecpwdSrvAdmin.cc:63:
../XrdOuc/XrdOucHash.hh: In destructor 'XrdOucHash_Item<T>::~XrdOucHash_Item()':
../XrdOuc/XrdOucHash.hh:88: warning: suggest explicit braces to avoid ambiguous 
'else'
In function 'int open(const char*, int, ...)',
    inlined from 'bool ExpPuk(const char*, bool)' at XrdSecpwdSrvAdmin.cc:2407:
/usr/include/bits/fcntl2.h:51: error: call to '__open_missing_mode' declared 
with attribute error: open with O_CREAT in second argument needs 3 arguments
In function 'int open(const char*, int, ...)',
    inlined from 'void SavePasswd(XrdOucString, XrdOucString, bool)' at 
XrdSecpwdSrvAdmin.cc:1825:
/usr/include/bits/fcntl2.h:51: error: call to '__open_missing_mode' declared 
with attribute error: open with O_CREAT in second argument needs 3 arguments
In function 'int open(const char*, int, ...)',
    inlined from 'bool SavePuk()' at XrdSecpwdSrvAdmin.cc:2130:
/usr/include/bits/fcntl2.h:51: error: call to '__open_missing_mode' declared 
with attribute error: open with O_CREAT in second argument needs 3 arguments
make[6]: *** [../../obj/XrdSecpwdSrvAdmin.o] Error 1
make[5]: *** [Linuxall] Error 2
make[4]: *** [all] Error 2
make[3]: *** [XrdSecpwd] Error 2
make[2]: *** [all] Error 2
make[2]: Leaving directory `/build/buildd/root-system-5.18.00/xrootd/src/xrootd'
make[1]: *** [xrootd/src/xrootd/lib/libXrdSec.so] Error 2
rm utils/src/rootcint_tmp.cxx utils/src/RStl_tmp.cxx

Please see

  
http://launchpadlibrarian.net/17425770/buildlog_ubuntu-intrepid-i386.root-system_5.18.00-2_FAILEDTOBUILD.txt.gz

for a full build log.

open(2) states

  "mode must be specified when O_CREAT is in the flags, and is ignored 
otherwise."

so I'm not sure why it doesn't fail on Debian.

Attached is a suggested patch to fix this. 4 of the calls were followed by an 
fchmod,
so I took the code from that, one wasn't so please review whether the chosen 
mode
is appropriate. Also the fchmod calls could perhaps be removed.

Thanks,

James

--- root-system-5.18.00.orig/xrootd/src/xrootd/src/XrdClient/XrdClient.cc
+++ root-system-5.18.00/xrootd/src/xrootd/src/XrdClient/XrdClient.cc
@@ -1111,7 +1111,7 @@
     }
 
     Stat(0);
-    int f = open(localpath, O_CREAT | O_RDWR);   
+    int f = open(localpath, O_CREAT | O_RDWR, 0644);   
     if (f < 0) {
 	Error("Copy", "Error opening local file.");
 	return FALSE;
only in patch2:
unchanged:
--- root-system-5.18.00.orig/xrootd/src/xrootd/src/XrdSecpwd/XrdSecpwdSrvAdmin.cc
+++ root-system-5.18.00/xrootd/src/xrootd/src/XrdSecpwd/XrdSecpwdSrvAdmin.cc
@@ -1822,7 +1822,7 @@
    PwdFile += tag;
    //
    // Open file, truncating if it exists already
-   int fd = open(PwdFile.c_str(),O_WRONLY | O_CREAT | O_TRUNC);
+   int fd = open(PwdFile.c_str(),O_WRONLY | O_CREAT | O_TRUNC, 0600);
    if (fd < 0) {
       PRT("SavePasswd: could not open/create file: "<<PwdFile.c_str());
       PRT("SavePasswd: errno: "<<errno);
@@ -2127,7 +2127,7 @@
    delete tstr;
    //
    // Open file, truncating if it exists already
-   int fd = open(PukFile.c_str(),O_WRONLY | O_CREAT | O_TRUNC);
+   int fd = open(PukFile.c_str(),O_WRONLY | O_CREAT | O_TRUNC, 0600);
    if (fd < 0) {
       PRT("SavePuk: could not open/create file: "<<PukFile);
       PRT("SavePuk: errno: "<<errno);
@@ -2404,7 +2404,7 @@
 
    // Now we save the public part in the export files
    // Open file, truncating if it exists already
-   int fd = open(expfile.c_str(),O_WRONLY | O_CREAT | O_TRUNC);
+   int fd = open(expfile.c_str(),O_WRONLY | O_CREAT | O_TRUNC, 0644);
    if (fd < 0) {
       PRT("ExpPuk: could not open/create file: "<<expfile.c_str());
       PRT("ExpPuk: errno: "<<errno);
only in patch2:
unchanged:
--- root-system-5.18.00.orig/proofd/src/XrdProofdProtocol.cxx
+++ root-system-5.18.00/proofd/src/XrdProofdProtocol.cxx
@@ -1972,7 +1972,7 @@
    XrdOucString fn = dir;
    fn += "/.afs";
    // Open the file, truncatin g if already existing
-   int fd = open(fn.c_str(), O_WRONLY | O_CREAT | O_TRUNC);
+   int fd = open(fn.c_str(), O_WRONLY | O_CREAT | O_TRUNC, 0600);
    if (fd <= 0) {
       TRACE(XERR, "SaveAFSkey: problems creating file - errno: " << errno);
       delete [] out;

Reply via email to