Update of /cvsroot/monetdb/MonetDB/src/gdk
In directory sc8-pr-cvs16.sourceforge.net:/tmp/cvs-serv1134/src/gdk

Modified Files:
      Tag: MonetDB_1-20
        gdk.mx gdk_posix.mx gdk_storage.mx gdk_utils.mx 
Log Message:
cleanup of mask and open flags

1) all files are now created using MONETDB_MODE
        which is 0666 (using the appropriete S_I* flags).

2) we don't set the umask, this should be done by the user
(todo check any startup scripts and spec files)


Index: gdk.mx
===================================================================
RCS file: /cvsroot/monetdb/MonetDB/src/gdk/gdk.mx,v
retrieving revision 1.238.2.1
retrieving revision 1.238.2.2
diff -u -d -r1.238.2.1 -r1.238.2.2
--- gdk.mx      28 Nov 2007 13:40:22 -0000      1.238.2.1
+++ gdk.mx      1 Dec 2007 15:06:56 -0000       1.238.2.2
@@ -2318,6 +2318,8 @@
 #define strdup _strdup
 #endif
 
+#define MONETDB_MODE  S_IRUSR | S_IWUSR | S_IRGRP | S_IWGRP | S_IROTH | S_IWOTH
+
 #define BBP_BATMASK     511
 #define BBP_THREADMASK   63
 

Index: gdk_storage.mx
===================================================================
RCS file: /cvsroot/monetdb/MonetDB/src/gdk/gdk_storage.mx,v
retrieving revision 1.128
retrieving revision 1.128.4.1
diff -u -d -r1.128 -r1.128.4.1
--- gdk_storage.mx      6 Jun 2007 12:05:40 -0000       1.128
+++ gdk_storage.mx      1 Dec 2007 15:06:57 -0000       1.128.4.1
@@ -160,14 +160,14 @@
 #ifdef WIN32
        flags |= strchr(mode, 'b') ? O_BINARY : O_TEXT;
 #endif
-       fd = open(path, flags, 0644);
+       fd = open(path, flags, MONETDB_MODE);
        if (fd < 0 && *mode == 'w') {
                /* try to create the directory, if that was the problem */
                char tmp[PATHLENGTH];
 
                strcpy(tmp, buf);
                if (GDKcreatedir(tmp)) {
-                       fd = open(path, flags, 0644);
+                       fd = open(path, flags, MONETDB_MODE);
                }
        }
        return fd;

Index: gdk_utils.mx
===================================================================
RCS file: /cvsroot/monetdb/MonetDB/src/gdk/gdk_utils.mx,v
retrieving revision 1.192.2.1
retrieving revision 1.192.2.2
diff -u -d -r1.192.2.1 -r1.192.2.2
--- gdk_utils.mx        16 Oct 2007 10:50:57 -0000      1.192.2.1
+++ gdk_utils.mx        1 Dec 2007 15:06:57 -0000       1.192.2.2
@@ -1573,7 +1573,6 @@
        if (GDKrecovery && unlink(GDKLOCK) < 0) {
                GDKfatal("GDKlockHome: unlock DB failed\n");
        }
-       umask(0000);
        if (MT_lockf(GDKLOCK, F_TLOCK, 4, 1) < 0) {
                GDKlockFile = 0;
                GDKfatal("GDKlockHome: Database lock '%s' denied\n", GDKLOCK);

Index: gdk_posix.mx
===================================================================
RCS file: /cvsroot/monetdb/MonetDB/src/gdk/gdk_posix.mx,v
retrieving revision 1.143.2.2
retrieving revision 1.143.2.3
diff -u -d -r1.143.2.2 -r1.143.2.3
--- gdk_posix.mx        21 Nov 2007 11:30:36 -0000      1.143.2.2
+++ gdk_posix.mx        1 Dec 2007 15:06:57 -0000       1.143.2.3
@@ -1039,7 +1039,7 @@
 void *
 MT_mmap_open(MT_mmap_hdl *hdl, char *path, int mode, off_t off, size_t len, 
size_t nremaps)
 {
-       int fd = open(path, O_CREAT | ((mode & MMAP_WRITE) ? O_RDWR : 
O_RDONLY), 0664);
+       int fd = open(path, O_CREAT | ((mode & MMAP_WRITE) ? O_RDWR : 
O_RDONLY), MONETDB_MODE);
        void *ret = (void *) -1L;
 
        (void) nremaps;
@@ -1928,7 +1928,7 @@
 #else
 #define MMAP_FLAGS(f)          f
 #define MMAP_FD                        fd
-#define MMAP_OPEN_DEV_ZERO     int fd = open("/dev/zero", O_RDWR, 0666)
+#define MMAP_OPEN_DEV_ZERO     int fd = open("/dev/zero", O_RDWR, MONETDB_MODE)
 #define MMAP_CLOSE_DEV_ZERO    close(fd)
 #endif
 
@@ -2035,7 +2035,7 @@
 int
 MT_lockf(char *filename, int mode, off_t off, off_t len)
 {
-       int fd = open(filename, O_CREAT | O_RDWR, 0662);
+       int fd = open(filename, O_CREAT | O_RDWR, MONETDB_MODE);
 
        if (fd < 0)
                return -2;
@@ -2198,7 +2198,7 @@
                SetLastError(ERROR_INVALID_DATA);
        }
        if (ret != 0) {
-               fd = open(filename, O_CREAT | O_RDWR, 0662);
+               fd = open(filename, O_CREAT | O_RDWR, MONETDB_MODE);
                if (fd < 0) {
                        /* this is nasty, but I "trust" windows that it in this 
case
                         * also cannot open the file into a filehandle any 
more, so


-------------------------------------------------------------------------
SF.Net email is sponsored by: The Future of Linux Business White Paper
from Novell.  From the desktop to the data center, Linux is going
mainstream.  Let it simplify your IT future.
http://altfarm.mediaplex.com/ad/ck/8857-50307-18918-4
_______________________________________________
Monetdb-checkins mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/monetdb-checkins

Reply via email to