aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSergey Poznyakoff <gray@gnu.org.ua>2009-12-22 16:04:46 +0200
committerSergey Poznyakoff <gray@gnu.org.ua>2009-12-22 16:04:46 +0200
commitd44a5b0b3818601311c6cde02a5ffe65b1a47554 (patch)
tree44f2f401d7950e23bffb7379e861768ecdf3252f
parent1d9b66b2a9038d9ecc1ddf21194bfb5eb89d8075 (diff)
downloadwydawca-d44a5b0b3818601311c6cde02a5ffe65b1a47554.tar.gz
wydawca-d44a5b0b3818601311c6cde02a5ffe65b1a47554.tar.bz2
Version 2.0release-2.0
* NEWS: Update. * configure.ac: Update. * doc/wydawca.texi: Minor change. * etc/wydawca.rc: Update. * src/config.c (notification_event_str) (notification_target_str): Use ARGMATCH_TO_ARGUMENT. * src/mail.c (get_uploader_email): Avoid segfault on info==NULL.
-rw-r--r--etc/wydawca.rc86
-rw-r--r--src/config.c4
-rw-r--r--src/mail.c2
3 files changed, 43 insertions, 49 deletions
diff --git a/etc/wydawca.rc b/etc/wydawca.rc
index 378e9ac..de7ab0b 100644
--- a/etc/wydawca.rc
+++ b/etc/wydawca.rc
@@ -14,30 +14,34 @@
14 You should have received a copy of the GNU General Public License along 14 You should have received a copy of the GNU General Public License along
15 with wydawca. If not, see <http://www.gnu.org/licenses/>. */ 15 with wydawca. If not, see <http://www.gnu.org/licenses/>. */
16 16
17# Configure logging via syslog. 17/* Configure logging via syslog.
18# For more info, run `info wydawca syslog'. 18 For more info, run `info wydawca syslog'.
19 */
19syslog { 20syslog {
20 facility local1; 21 facility local1;
21 tag wydawca; 22 tag wydawca;
22 print-priority yes; 23 print-priority yes;
23} 24}
24 25
25# Enable statistics output at the end of the run. 26/* Enable statistics output at the end of the run.
26# For more info, run `info wydawca statistics'. 27 For more info, run `info wydawca statistics'.
28 */
27statistics all; 29statistics all;
28 30
29# Remove any stray files that are more than an hour old. 31/* Remove any stray files that are more than an hour old. */
30file-sweep-time "1 hour"; 32file-sweep-time "1 hour";
31 33
32# Set default umask 34/* Set default umask. */
33umask 022; 35umask 022;
34 36
35# Set the name of the tar binary. This is optional. 37/* Set the name of the tar binary. This is optional.
36# See `info wydawca archivation', for more info. 38 See `info wydawca archivation', for more info.
39 */
37tar-program "/bin/tar"; 40tar-program "/bin/tar";
38 41
39# Configure SQL databases. 42/* Configure SQL databases.
40# See `info wydawca sql'. 43 See `info wydawca sql'.
44 */
41sql default { 45sql default {
42 host "localhost:/tmp/mysql.sock"; 46 host "localhost:/tmp/mysql.sock";
43 database "savane"; 47 database "savane";
@@ -45,13 +49,12 @@ sql default {
45 password "guessme"; 49 password "guessme";
46} 50}
47 51
48############################################################################# 52/* Configure dictionaries.
49# Configure access methods. 53 Run `info wydawca dictionaries', for the detailed description of these.
50# Run `info wydawca access', for the detailed description of these. 54 The provided ones use Savane database structure.
51# The provided ones use Savane database structure. 55 */
52#############################################################################
53 56
54access-method project-owner { 57dictionary project-owner {
55 type sql; 58 type sql;
56 params (default); 59 params (default);
57 query "SELECT user.email, user.realname " 60 query "SELECT user.email, user.realname "
@@ -59,36 +62,26 @@ access-method project-owner {
59 "WHERE user_group.user_id=user.user_id " 62 "WHERE user_group.user_id=user.user_id "
60 "AND user_group.group_id=groups.group_id " 63 "AND user_group.group_id=groups.group_id "
61 "AND user_group.admin_flags = 'A' " 64 "AND user_group.admin_flags = 'A' "
62 "AND groups.unix_group_name='$p'"; 65 "AND groups.unix_group_name='${project}'";
63} 66}
64 67
65access-method user-data {
66 type sql;
67 params (default);
68 query "SELECT email, realname FROM user WHERE user_name='${user}'";
69}
70
71access-method verify-user {
72 type sql;
73 params (default);
74 query "SELECT user.user_name "
75 "FROM user,user_group, groups "
76 "WHERE user_group.user_id=user.user_id "
77 "AND user_group.group_id=groups.group_id "
78 "AND user_group.admin_flags = 'A' "
79 "AND groups.unix_group_name='$p' AND user.user_name='$u'";
80}
81 68
82access-method gpg-key { 69/* Only project admins are allowed to make uploads. */
70dictionary project-uploader {
83 type sql; 71 type sql;
72 query "SELECT user.user_name,user.realname,user.email,user.gpg_key "
73 "FROM user,user_group,groups "
74 "WHERE user_group.user_id=user.user_id "
75 "AND user_group.group_id=groups.group_id "
76 "AND user_group.admin_flags = 'A' "
77 "AND groups.unix_group_name='${project}' "
78 "AND user.gpg_key is not NULL";
84 params (default); 79 params (default);
85 query "SELECT gpg_key FROM user WHERE user_name='$u'";
86} 80}
87 81
88############################################################################# 82/* Configure email notifications
89# Configure email notifications 83 See `info wydawca notification', for a description.
90# See `info wydawca notification', for an explanation. 84 */
91#############################################################################
92 85
93admin-address "root@localhost"; 86admin-address "root@localhost";
94from-address "wydawca@localhost"; 87from-address "wydawca@localhost";
@@ -283,13 +276,12 @@ The Project Submission Robot
283EOT; 276EOT;
284} 277}
285 278
286############################################################################# 279/* Configure distribution spools.
287# Configure distribution spools. 280 A spool defines where to look for input triplets, and where to
288# A spool defines where to look for input triplets, and where to 281 copy uploaded files.
289# copy uploaded files. 282
290# 283 See `info wydawca spool', for a detailed explanation.
291# See `info wydawca spool', for a detailed explanation. 284 */
292#############################################################################
293 285
294spool download { 286spool download {
295 url ftp://your.domain.net; 287 url ftp://your.domain.net;
diff --git a/src/config.c b/src/config.c
index c3b2e22..0c681ac 100644
--- a/src/config.c
+++ b/src/config.c
@@ -165,7 +165,7 @@ ARGMATCH_VERIFY (event_args, event_types);
165const char * 165const char *
166notification_event_str (enum notification_event evt) 166notification_event_str (enum notification_event evt)
167{ 167{
168 return event_args[evt]; 168 return ARGMATCH_TO_ARGUMENT ((char*)&evt, event_args, event_types);
169} 169}
170 170
171int 171int
@@ -203,7 +203,7 @@ ARGMATCH_VERIFY (target_args, target_types);
203const char * 203const char *
204notification_target_str (enum notification_target tgt) 204notification_target_str (enum notification_target tgt)
205{ 205{
206 return target_args[tgt]; 206 return ARGMATCH_TO_ARGUMENT ((char*)&tgt, target_args, target_types);
207} 207}
208 208
209int 209int
diff --git a/src/mail.c b/src/mail.c
index 98f6c4a..756490a 100644
--- a/src/mail.c
+++ b/src/mail.c
@@ -480,6 +480,8 @@ get_uploader_email (struct uploader_info *info, struct file_triplet *trp,
480 mu_address_t rcpt = NULL; 480 mu_address_t rcpt = NULL;
481 int rc; 481 int rc;
482 482
483 if (!info)
484 return NULL;
483 rc = mu_address_create (&addr, info->email); 485 rc = mu_address_create (&addr, info->email);
484 if (rc) 486 if (rc)
485 { 487 {

Return to:

Send suggestions and report system problems to the System administrator.