missing arg to open()
Posted: 2007-09-25T20:12:08-07:00
Building in the Fedora 8 toolchain I tripped over a weird error which I tracked down to an open() in CopyDelegateFile which specifies O_CREAT, but doesn't include a mode argument in the call.
--- ImageMagick-6.3.5-9/magick/delegate.c 2007-09-11 13:20:41.000000000 +1000
+++ ImageMagick-6.3.5-9/magick/delegate.c 2007-09-18 18:27:31.000000000 +1000
@@ -769,7 +769,8 @@ static void CopyDelegateFile(const char
/*
Copy source file to destination.
*/
- destination_file=open(destination,O_WRONLY | O_BINARY | O_CREAT);
+ destination_file=open(destination,O_WRONLY | O_BINARY | O_CREAT,
+ S_IRUSR | S_IWUSR | S_IRGRP );
if (destination_file == -1)
return;
source_file=open(source,O_RDONLY | O_BINARY);
--- ImageMagick-6.3.5-9/magick/delegate.c 2007-09-11 13:20:41.000000000 +1000
+++ ImageMagick-6.3.5-9/magick/delegate.c 2007-09-18 18:27:31.000000000 +1000
@@ -769,7 +769,8 @@ static void CopyDelegateFile(const char
/*
Copy source file to destination.
*/
- destination_file=open(destination,O_WRONLY | O_BINARY | O_CREAT);
+ destination_file=open(destination,O_WRONLY | O_BINARY | O_CREAT,
+ S_IRUSR | S_IWUSR | S_IRGRP );
if (destination_file == -1)
return;
source_file=open(source,O_RDONLY | O_BINARY);