group writable __db files

Matthias Andree matthias.andree at gmx.de
Wed Dec 1 11:47:41 CET 2004


"Fletcher Mattox" <fletcher at cs.utexas.edu> writes:

> I need for the __db lock files to be group writable, but seem
> unable to make that happen with umask.  I even added a umask(002) to
> the startup code in bogomain.c.  But after a while, the __db files
> are mode 0644 again.  Any idea what I'm doing wrong?  This is
> bogofilter 0.93.1, by the way.

We're requesting 0644 & ~umask for the environment,
so your setting cannot work.

Try this patch (which uses 0664 & ~umask) and let us know if it works, I
presume it should work without your adding the umask() to bogomain if
you set the umask to 02 in your shell before starting
bogofilter/bogoutil, this is against 0.93.1.

The same change has been made to CVS so it can become part of 0.93.2.

diff -ur a/src/datastore_db.c b/src/datastore_db.c
--- a/src/datastore_db.c	2004-11-11 05:05:22.000000000 +0100
+++ b/src/datastore_db.c	2004-12-01 11:42:50.000000000 +0100
@@ -903,7 +903,7 @@
 
     /* All we are interested in is that this file exists, we'll close it
      * right away as plock down will open it again */
-    ret = open(t, O_RDWR|O_CREAT|O_EXCL, (mode_t)0644);
+    ret = open(t, O_RDWR|O_CREAT|O_EXCL, (mode_t)0664);
     if (ret < 0 && errno != EEXIST) {
 	print_error(__FILE__, __LINE__, "open(%s): %s",
 		t, strerror(errno));
@@ -993,7 +993,7 @@
 	    NULL,
 #endif
 	    DB_INIT_MPOOL | DB_INIT_LOCK
-	    | DB_INIT_LOG | DB_INIT_TXN | DB_CREATE | flags, /* mode */ 0644);
+	    | DB_INIT_LOG | DB_INIT_TXN | DB_CREATE | flags, /* mode */ 0664);
     if (ret != 0) {
 	dbe->close(dbe, 0);
 	print_error(__FILE__, __LINE__, "DB_ENV->open, err: %d, %s", ret, db_strerror(ret));

>
> Thanks
> Fletcher
> _______________________________________________
> Bogofilter mailing list
> Bogofilter at bogofilter.org
> http://www.bogofilter.org/mailman/listinfo/bogofilter
>
>

-- 
Matthias Andree



More information about the Bogofilter mailing list