Index: [Article Count Order] [Thread]

Date:  Thu, 6 Mar 2008 13:05:46 +0100
From:  "Tobias Gablunsky" <t.gablunsky (at mark) cbxnet.de>
Subject:  [coba-e:12177] Using the /etc/skel structure
To:  <coba-e (at mark) bluequartz.org>
Message-Id:  <01E188343A33DE4E8B1A00D7980BC879023A4832 (at mark) s2.combox.de>
X-Mail-Count: 12177

Hello.

As in another recent thread mentioned I am working on customizing BQ so that the email system uses the Maildir format to store messages.

The solution I prefer (the only one I tested) for local delivery is using procmail. For being able to use this efficiently I have to make two modifications to the BQ system, precise both modifications concern files from the package "base-user-glue".

The first modification is needed for being able to copy any hidden file from /etc/skel other than only the "/etc/skel/.bash*" (in my case /etc/skel/.procmailrc).

The tiny patch for this is against "/usr/sausalito/perl/Base/User.pm":

##########################
--- User.pm     2008-03-06 12:22:54.000000000 +0100
+++ User.pm.new 2008-03-06 12:23:37.000000000 +0100
@@ -914,7 +914,9 @@ sub _internal_useradd
                     # rollback command will call userdel with the flag
                     # to rm the user's directory
                     system("/bin/cp -r $user->{skel}/* $user->{homedir}");
-                    system("/bin/cp /etc/skel/.bash* $user->{homedir}");
+                    ### changed for being able to copy any hidden file out of /etc/skel, Tobias Gablunsky 20080305
+                    #system("/bin/cp /etc/skel/.bash* $user->{homedir}");
+                    system("/bin/cp /etc/skel/.* $user->{homedir}");
                 }
     
                 Sauce::Util::chmodfile(Sauce::Config::perm_UserDir, $user->{homedir});
##########################


The second modification is a change of the filesystem permissions. The users homedir has to don't have write permissions for the group (chmod g-w ~USERHOME). Otherwise the ~USERHOME/.procmailrc doesn't get executed. This is done by changing the setting of standard permissions for users homedir in the file "/usr/sausalito/handlers/base/user/handle_user.pl":

##########################
--- handle_user.pl      2008-03-06 12:13:31.000000000 +0100
+++ handle_user.pl.new  2008-03-06 12:13:03.000000000 +0100
@@ -333,7 +333,9 @@ if (scalar(@pwent) == 0) {
 if (defined($new->{enabled})) {
        if ($new->{enabled}) {
                # FIXME: this assumes raq style dir permissions
-               Sauce::Util::chmodfile(($obj->{site} ? 02771 : 0700), $homedir);
+                # changed, for being able to use ~userhome/.procmailrc, Tobias Gablunsky 20080305
+                # Sauce::Util::chmodfile(($obj->{site} ? 02771 : 0700), $homedir);
+                Sauce::Util::chmodfile(($obj->{site} ? 02751 : 0700), $homedir);
        } else {
                Sauce::Util::chmodfile(0000, $homedir);
        }
##########################


I didn't find any side effects with this change of the filesystem rights but I am not sure if there really are none. Perhaps anyone on the list is able to comment this?

If nobody finds any problems with these changes I would like to see them in the original package. Any comments?


--
tobias gablunsky
systemtechnik internet

CBXNET combox internet gmbh
LÕzowstraŽße 105-106
10785 Berlin
Telefon: 030 / 59 00 69 -41; Zentrale: -00
Telefax: 030 / 59 00 69 -99
www.cbxnet.de | support (at mark) cbxnet.de

Amtsgericht Berlin-Charlottenburg HRB 71171
GeschçÇtsfÉrer: Lutz Treutler