~ubuntu-branches/ubuntu/utopic/lurker/utopic

« back to all changes in this revision

Viewing changes to debian/patches/01_umask.patch

  • Committer: Bazaar Package Importer
  • Author(s): Jonas Meurer
  • Date: 2009-10-31 01:46:17 UTC
  • mfrom: (1.1.3 upstream)
  • Revision ID: james.westby@ubuntu.com-20091031014617-a4c2ol1jpmxowq3r
Tags: 2.3-1
* new stable upstream release:
  - fixes compiliation with gcc-4.4 (closes: #504959)
  - moves default htdocs from /var/www/lurker to /usr/share/lurker/www.
    explain the migration in NEWS.Debian
  - rewritten markup regexps (linear-time and rfc-derived) (closes: #437858)
  - remove all patches, they where all incorporated upstream.
* drop apache from depends, it hasn't been supported in maintainer scripts
  since lurker 2.1-10
* bump standards-version to 3.8.3, no changes needed
* update debian/changelog to comply with proposed machine-readable format
  from http://wiki.debian.org/Proposals/CopyrightFormat
* add ${misc:Depends} to depends in debian/control
* set -e in postinst, preinst and prerm
* fix coding issues with POD documentation in debian/mailman2lurker
* add lintian-overrides for packages-contains-empty-directory. Install with
  dh_lintian, bump build-depends on debhelper to (>=6.0.7)
* bump debian/compat to 6
* add mindex.patch to docs and describe it's purpose in README.Debian.
* enhance the FAQ with a description how the activity chart is calculated.
* invoke ucf with --debconf-ok in postinst, build-depend on ucf (>= 0.28).
* fix postinst to configure the apache2 webserver only if it's selected.
  (closes: #550647)
* fix config maintainer script to not use absolute pathnames for binaries.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
## 01_umask.dpatch by Jonas Meurer <mejo@debian.org>
2
 
##
3
 
## Allow to configure umask
4
 
 
5
 
--- a/ChangeLog
6
 
+++ b/ChangeLog
7
 
@@ -1,3 +1,7 @@
8
 
+v2.2:
9
 
+       Added support for specifying a umask for the database
10
 
+       Removed idiotic/wrong use of 'sg' in INSTALL's import example
11
 
+
12
 
 v2.1:
13
 
        lurker.cgi uses the environment to provide location information:
14
 
          LURKER_CONFIG over-rides the default config file
15
 
--- a/INSTALL
16
 
+++ b/INSTALL
17
 
@@ -86,15 +86,10 @@
18
 
        * ^X-Mailing-List: <debian-japanese@lists.debian.org>.*
19
 
        | lurker-index -l japanese -m
20
 
   
21
 
-  Or with a lurker group:
22
 
-       UMASK=002
23
 
-       :0 w
24
 
-       * ^X-Mailing-List: <debian-japanese@lists.debian.org>.*
25
 
-       | sg lurker -c "lurker-index -l japanese -m"
26
 
+  If you have a lurker group:
27
 
+       Set 'db_umask = 002' in the lurker.conf file.
28
 
+       chmod 02775 /usr/local/var/lib/lurker
29
 
   
30
 
-  In the this example 'sg' is used to change to the lurker group.
31
 
-  The UMASK setting also tells procmail to make the files group writeable.
32
 
-
33
 
 5 Feed archived mail through lurker-index.
34
 
   
35
 
   lurker-index -l devel < debian-devel.mbox
36
 
--- a/common/ConfigFile.cpp
37
 
+++ b/common/ConfigFile.cpp
38
 
@@ -1,4 +1,4 @@
39
 
-/*  $Id: ConfigFile.cpp,v 1.23 2006/03/01 14:02:51 terpstra Exp $
40
 
+/*  $Id: ConfigFile.cpp,v 1.25 2006/03/10 00:47:22 terpstra Exp $
41
 
  *  
42
 
  *  ConfigFile.cpp - Knows how to load the config file
43
 
  *  
44
 
@@ -381,6 +381,7 @@
45
 
  : list(0), frontend(0), group(""), error(), lists(), groups(),
46
 
    file(""),
47
 
    dbdir(""), 
48
 
+   db_umask(-1),
49
 
    xslt("cat -"),
50
 
    delete_message(""),
51
 
    pgpv_mime("off"),
52
 
@@ -859,6 +860,22 @@
53
 
                }
54
 
                dbdir = val;
55
 
        }
56
 
+       else if (key == "db_umask")
57
 
+       {
58
 
+               if (lc != "")
59
 
+               {
60
 
+                       error << "db_umask cannot be localized" << endl;
61
 
+                       return -1;
62
 
+               }
63
 
+               
64
 
+               char* e;
65
 
+               db_umask = strtol(val.c_str(), &e, 8);
66
 
+               if (val.length() == 0 || *e != 0)
67
 
+               {
68
 
+                       error << "db_mask must be given an octal number, not '" << val << "'" << endl;
69
 
+                       return -1;
70
 
+               }
71
 
+       }
72
 
        else if (key == "admin_name")
73
 
        {
74
 
                admin_name.translate(lc, val);
75
 
--- a/common/ConfigFile.h
76
 
+++ b/common/ConfigFile.h
77
 
@@ -1,4 +1,4 @@
78
 
-/*  $Id: ConfigFile.h,v 1.13 2006/02/25 01:05:40 terpstra Exp $
79
 
+/*  $Id: ConfigFile.h,v 1.15 2006/03/10 00:47:22 terpstra Exp $
80
 
  *  
81
 
  *  ConfigFile.h - Knows how to load the config file
82
 
  *  
83
 
@@ -152,6 +152,7 @@
84
 
         
85
 
        // never localize paths, commands, or addresses
86
 
        string  dbdir;
87
 
+       int     db_umask;
88
 
        string  xslt;
89
 
        string  delete_message;
90
 
        string  pgpv_mime;
91
 
--- a/index/lurker-params.1
92
 
+++ b/index/lurker-params.1
93
 
@@ -3,7 +3,7 @@
94
 
 lurker\-params \(em parses parameters from the config file 
95
 
 .SH "SYNOPSIS" 
96
 
 .PP 
97
 
-\fBlurker\-params\fR [\-c <config-file>]  [\-f <locale>]  [\-d \-a \-n \-e \-x \-m \-i \-k \-w \-h \-r]  
98
 
+\fBlurker\-params\fR [\-c <config-file>]  [\-f <locale>]  [\-d \-u \-a \-n \-e \-x \-m \-i \-k \-w \-h \-r]  
99
 
 .SH "DESCRIPTION" 
100
 
 .PP 
101
 
 \fBlurker\-params\fR outputs various lurker settings 
102
 
@@ -17,6 +17,8 @@
103
 
 (it defaults to selecting the fallback case for each field). 
104
 
 .IP "\fB\-d\fP" 10 
105
 
 Output only the dbdir parameter 
106
 
+.IP "\fB\-u\fP" 10 
107
 
+Output only the db_umask parameter 
108
 
 .IP "\fB\-a\fP" 10 
109
 
 Output only the archive parameter 
110
 
 .IP "\fB\-n\fP" 10 
111
 
@@ -69,4 +71,4 @@
112
 
 still present in the latest official release. If the problem persists, 
113
 
 then send mail with instructions describing how to reproduce the bug to 
114
 
 <lurker\-users@lists.sourceforge.net>. 
115
 
-.\" created by instant / docbook-to-man, Mon 27 Feb 2006, 02:54 
116
 
+.\" created by instant / docbook-to-man, Fri 10 Mar 2006, 01:49 
117
 
--- a/index/lurker-params.sgml
118
 
+++ b/index/lurker-params.sgml
119
 
@@ -58,7 +58,7 @@
120
 
       <command>&dhpackage;</command>
121
 
       <arg>\-c &lt;config-file&gt;</arg>
122
 
       <arg>\-f &lt;locale&gt;</arg>
123
 
-      <arg>\-d \-a \-n \-e \-x \-m \-i \-k \-w \-h \-r</arg>
124
 
+      <arg>\-d \-u \-a \-n \-e \-x \-m \-i \-k \-w \-h \-r</arg>
125
 
     </cmdsynopsis>
126
 
   </refsynopsisdiv>
127
 
   <refsect1>
128
 
@@ -92,6 +92,12 @@
129
 
         </listitem>
130
 
       </varlistentry>
131
 
       <varlistentry>
132
 
+        <term><option>\-u</option></term>
133
 
+        <listitem>
134
 
+          <para>Output only the db_umask parameter</para>
135
 
+        </listitem>
136
 
+      </varlistentry>
137
 
+      <varlistentry>
138
 
         <term><option>\-a</option></term>
139
 
         <listitem>
140
 
           <para>Output only the archive parameter</para>
141
 
--- a/index/main.cpp
142
 
+++ b/index/main.cpp
143
 
@@ -1,4 +1,4 @@
144
 
-/*  $Id: main.cpp,v 1.49 2006/03/01 14:11:05 terpstra Exp $
145
 
+/*  $Id: main.cpp,v 1.50 2006/03/10 00:47:22 terpstra Exp $
146
 
  *  
147
 
  *  main.cpp - Read the fed data into our database
148
 
  *  
149
 
@@ -633,6 +633,8 @@
150
 
                return LEX_DATAERR;
151
 
        }
152
 
        
153
 
+       if (cfg.db_umask != -1) umask(cfg.db_umask);
154
 
+       
155
 
        string dbname = cfg.dbdir + "/db";
156
 
        ESort::Parameters params(synced);
157
 
        // work around g++ 2.95 borkage
158
 
--- a/index/params.cpp
159
 
+++ b/index/params.cpp
160
 
@@ -1,4 +1,4 @@
161
 
-/*  $Id: params.cpp,v 1.16 2006/02/26 14:09:07 terpstra Exp $
162
 
+/*  $Id: params.cpp,v 1.17 2006/03/10 00:47:22 terpstra Exp $
163
 
  *  
164
 
  *  params.cpp - Parse the config file for helper scripts
165
 
  *  
166
 
@@ -38,11 +38,12 @@
167
 
        cerr << "Lurker-params (v" << VERSION << ") parses params from the config file.\n";
168
 
        cerr << "\n";
169
 
        cerr << "Usage: " << name << " [-c <config-file>] [-f <locale>]\n";
170
 
-       cerr << "                         [-d -a -n -e -x -m -i -k -w -h -r]\n";
171
 
+       cerr << "                         [-d -u -a -n -e -x -m -i -k -w -h -r]\n";
172
 
        cerr << "\n";
173
 
        cerr << "\t-c <config-file> Use this config file for lurker settings\n";
174
 
        cerr << "\t-f <locale>      Output the fields for this locale\n";
175
 
        cerr << "\t-d               Output only the dbdir parameter\n";
176
 
+       cerr << "\t-u               Output only the db_umask parameter\n";
177
 
        cerr << "\t-a               Output only the archive parameter\n";
178
 
        cerr << "\t-n               Output only the administrator name\n";
179
 
        cerr << "\t-e               Output only the administrator email address\n";
180
 
@@ -66,6 +67,7 @@
181
 
        const char* config        = DEFAULT_CONFIG_FILE;
182
 
        int         fields        = 0;
183
 
        bool        dbdir         = false;
184
 
+       bool        db_umask      = false;
185
 
        bool        archive       = false;
186
 
        bool        admin_name    = false;
187
 
        bool        admin_address = false;
188
 
@@ -78,7 +80,7 @@
189
 
        bool        raw_email     = false;
190
 
        string lc;
191
 
        
192
 
-       while ((c = getopt(argc, (char*const*)argv, "c:f:danexmikwhr?")) != -1)
193
 
+       while ((c = getopt(argc, (char*const*)argv, "c:f:duanexmikwhr?")) != -1)
194
 
        {
195
 
                switch ((char)c)
196
 
                {
197
 
@@ -92,6 +94,10 @@
198
 
                        ++fields;
199
 
                        dbdir = true;
200
 
                        break;
201
 
+               case 'u':
202
 
+                       ++fields;
203
 
+                       db_umask = true;
204
 
+                       break;
205
 
                case 'a':
206
 
                        ++fields;
207
 
                        archive = true;
208
 
@@ -163,14 +169,18 @@
209
 
                return 1;
210
 
        }
211
 
        
212
 
-       if (!fields || dbdir)         cout << cfg.dbdir         << "\n";
213
 
-       if (!fields || archive)       cout << cfg.archive(lc)   << "\n";
214
 
-       if (!fields || admin_name)    cout << cfg.admin_name(lc)<< "\n";
215
 
-       if (!fields || admin_address) cout << cfg.admin_address << "\n";
216
 
-       if (!fields || xslt)          cout << cfg.xslt          << "\n";
217
 
-       if (!fields || pgpv_mime)     cout << cfg.pgpv_mime     << "\n";
218
 
-       if (!fields || pgpv_inline)   cout << cfg.pgpv_inline   << "\n";
219
 
-       if (!fields || delete_message)cout << cfg.delete_message<< "\n";
220
 
+       if (!fields || dbdir)         cout << cfg.dbdir           << "\n";
221
 
+       if (!fields || db_umask)
222
 
+               if (cfg.db_umask == -1) 
223
 
+                                     cout << "user"              << "\n";
224
 
+               else                  cout << "0" << oct << cfg.db_umask << "\n";
225
 
+       if (!fields || archive)       cout << cfg.archive(lc)     << "\n";
226
 
+       if (!fields || admin_name)    cout << cfg.admin_name(lc)  << "\n";
227
 
+       if (!fields || admin_address) cout << cfg.admin_address   << "\n";
228
 
+       if (!fields || xslt)          cout << cfg.xslt            << "\n";
229
 
+       if (!fields || pgpv_mime)     cout << cfg.pgpv_mime       << "\n";
230
 
+       if (!fields || pgpv_inline)   cout << cfg.pgpv_inline     << "\n";
231
 
+       if (!fields || delete_message)cout << cfg.delete_message  << "\n";
232
 
        if (!fields || web_cache)     cout << (cfg.web_cache?"on":"off") << "\n";
233
 
        if (!fields || hide_email)    cout << (cfg.hide_email?"on":"off") << "\n";
234
 
        if (!fields || raw_email)     cout << (cfg.raw_email?"on":"off") << "\n";
235
 
--- a/index/search.cpp
236
 
+++ b/index/search.cpp
237
 
@@ -1,4 +1,4 @@
238
 
-/*  $Id: search.cpp,v 1.12 2006/02/27 01:53:55 terpstra Exp $
239
 
+/*  $Id: search.cpp,v 1.13 2006/03/10 00:47:22 terpstra Exp $
240
 
  *  
241
 
  *  search.cpp - Search for messages in lurker database (optionally delete)
242
 
  *  
243
 
@@ -28,8 +28,11 @@
244
 
 #include <Keys.h>
245
 
 
246
 
 #include <iostream>
247
 
+#include <sys/stat.h>
248
 
+#include <sys/types.h>
249
 
 #include <assert.h>
250
 
 #include <stdio.h>
251
 
+#include <unistd.h>
252
 
 
253
 
 using namespace std;
254
 
 
255
 
@@ -124,6 +127,7 @@
256
 
        {
257
 
                if (verbose) cerr << "opening " << cfg.dbdir << "/db read-write" << endl;
258
 
                // Work around g++ 2.95 bug
259
 
+               if (cfg.db_umask != -1) umask(cfg.db_umask);
260
 
                auto_ptr<ESort::Writer> w
261
 
                        (ESort::Writer::opendb(cfg.dbdir + "/db"));
262
 
                db = w.get();
263
 
--- a/lurker.conf.in
264
 
+++ b/lurker.conf.in
265
 
@@ -50,10 +50,13 @@
266
 
 # The substitution %c denotes the config file of the database to affect.
267
 
 # The substitution %i is the lurker message ID of the target email.
268
 
 # The recommended setup is to have a 'lurker' group owning /var/lib/lurker
269
 
-# Then for the example command to work, you must set 'gpasswd lurker'.
270
 
-# On some systems this is 'passwd -g lurker', there may be other variants.
271
 
+#  Then for the example command to work, you must set 'gpasswd lurker'.
272
 
+#  On some systems this is 'passwd -g lurker', there may be other variants.
273
 
+# Alternately, you can make the lurker db writable by the CGI.
274
 
+#  Then use the second alternative after changing 'password'.
275
 
 
276
 
 delete_message = sg lurker -c "@BINDIR@/lurker-search -d -f -q -i -c %c %i"
277
 
+# delete_message = if test "password" = "`cat`"; then @BINDIR@/lurker-search -d -f -q -i -c %c %i; fi
278
 
 
279
 
 # The commands lurker uses to verify signatures.
280
 
 # 
281
 
@@ -102,6 +105,15 @@
282
 
 
283
 
 dbdir = @LOCALSTATEDIR@/lib/@PACKAGE@
284
 
 
285
 
+# The umask to use when creating files in the database.
286
 
+# 
287
 
+# If this is unset, the umask from the environment of the user is used.
288
 
+# You would want to set this to make sure that permissions stay correct.
289
 
+# If you want a group writable db, use 002 and a setgid dbdir (rwxrwsr-x).
290
 
+# If you want a user only db, use 022 and a dbdir with rwxr-xr-x.
291
 
292
 
+db_umask = 002
293
 
+
294
 
 # Include another file for additional configuration.
295
 
 # 
296
 
 # If you have a large number of mailing lists it may help to group them.