poldek: tndb/write.c - fixed file mode

mis mis at pld-linux.org
Fri Jun 22 20:21:03 CEST 2007


Author: mis                          Date: Fri Jun 22 18:21:03 2007 GMT
Module: poldek                        Tag: HEAD
---- Log message:
- fixed file mode

---- Files affected:
poldek/tndb:
   write.c (1.10 -> 1.11) 

---- Diffs:

================================================================
Index: poldek/tndb/write.c
diff -u poldek/tndb/write.c:1.10 poldek/tndb/write.c:1.11
--- poldek/tndb/write.c:1.10	Fri Jun 22 14:51:47 2007
+++ poldek/tndb/write.c	Fri Jun 22 20:20:58 2007
@@ -1,5 +1,5 @@
 /*
-  Copyright (C) 2002 Pawel A. Gajda <mis at k2.net.pl>
+  Copyright (C) 2002 - 2007 Pawel A. Gajda <mis at pld-linux.org>
 
   This program is free software; you can redistribute it and/or modify
   it under the terms of the GNU Library General Public License, version 2
@@ -55,10 +55,12 @@
 #ifdef HAVE_MKSTEMP
     fd = mkstemp(path);
 #else
-    fd = open(path, O_RDWR | O_CREAT | O_TRUNC, 0644);
+    fd = open(path, O_RDWR | O_CREAT | O_TRUNC | O_EXCL, 0600);
 #endif
     if (fd < 0)
         return NULL;
+
+    fchmod(fd, 0600);
     
     rmdir(path);
     unlink(path); /* unlink just after create, it's temporary file */
================================================================

---- CVS-web:
    http://cvs.pld-linux.org/poldek/tndb/write.c?r1=1.10&r2=1.11&f=u



More information about the pld-cvs-commit mailing list