]> diplodocus.org Git - flac-archive/commitdiff
set mode on output file, and don't clobber existing
author <epg@pretzelnet.org> <>
Sun, 8 Dec 2013 23:45:49 +0000 (15:45 -0800)
committer <epg@pretzelnet.org> <>
Sun, 8 Dec 2013 23:45:49 +0000 (15:45 -0800)
apic-read.cc

index ad07b3d..d03287f 100644 (file)
@@ -41,7 +41,7 @@ main(int argc, char **argv)
         }
         AttachedPictureFrame *pic_frame = (AttachedPictureFrame *)frame;
         TagLib::ByteVector data = pic_frame->picture();
-        int fd = open(argv[2], O_CREAT | O_WRONLY);
+        int fd = open(argv[2], O_CREAT | O_EXCL | O_WRONLY, 0644);
         if (fd < 0) {
             perror("open");
             return 2;