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
@@ -16,4 +16,5 @@
-# Configure logging via syslog.
-# For more info, run `info wydawca syslog'.
+/* Configure logging via syslog.
+ For more info, run `info wydawca syslog'.
+ */
syslog {
@@ -24,18 +25,21 @@ syslog {
-# Enable statistics output at the end of the run.
-# For more info, run `info wydawca statistics'.
+/* Enable statistics output at the end of the run.
+ For more info, run `info wydawca statistics'.
+ */
statistics all;
-# Remove any stray files that are more than an hour old.
+/* Remove any stray files that are more than an hour old. */
file-sweep-time "1 hour";
-# Set default umask
+/* Set default umask. */
umask 022;
-# Set the name of the tar binary. This is optional.
-# See `info wydawca archivation', for more info.
+/* Set the name of the tar binary. This is optional.
+ See `info wydawca archivation', for more info.
+ */
tar-program "/bin/tar";
-# Configure SQL databases.
-# See `info wydawca sql'.
+/* Configure SQL databases.
+ See `info wydawca sql'.
+ */
sql default {
@@ -47,9 +51,8 @@ sql default {
-#############################################################################
-# Configure access methods.
-# Run `info wydawca access', for the detailed description of these.
-# The provided ones use Savane database structure.
-#############################################################################
+/* Configure dictionaries.
+ Run `info wydawca dictionaries', for the detailed description of these.
+ The provided ones use Savane database structure.
+ */
-access-method project-owner {
+dictionary project-owner {
type sql;
@@ -61,32 +64,22 @@ access-method project-owner {
"AND user_group.admin_flags = 'A' "
- "AND groups.unix_group_name='$p'";
+ "AND groups.unix_group_name='${project}'";
}
-access-method user-data {
- type sql;
- params (default);
- query "SELECT email, realname FROM user WHERE user_name='${user}'";
-}
-
-access-method verify-user {
- type sql;
- params (default);
- query "SELECT user.user_name "
- "FROM user,user_group, groups "
- "WHERE user_group.user_id=user.user_id "
- "AND user_group.group_id=groups.group_id "
- "AND user_group.admin_flags = 'A' "
- "AND groups.unix_group_name='$p' AND user.user_name='$u'";
-}
-access-method gpg-key {
+/* Only project admins are allowed to make uploads. */
+dictionary project-uploader {
type sql;
+ query "SELECT user.user_name,user.realname,user.email,user.gpg_key "
+ "FROM user,user_group,groups "
+ "WHERE user_group.user_id=user.user_id "
+ "AND user_group.group_id=groups.group_id "
+ "AND user_group.admin_flags = 'A' "
+ "AND groups.unix_group_name='${project}' "
+ "AND user.gpg_key is not NULL";
params (default);
- query "SELECT gpg_key FROM user WHERE user_name='$u'";
}
-
-#############################################################################
-# Configure email notifications
-# See `info wydawca notification', for an explanation.
-#############################################################################
+
+/* Configure email notifications
+ See `info wydawca notification', for a description.
+ */
@@ -285,9 +278,8 @@ EOT;
-#############################################################################
-# Configure distribution spools.
-# A spool defines where to look for input triplets, and where to
-# copy uploaded files.
-#
-# See `info wydawca spool', for a detailed explanation.
-#############################################################################
+/* Configure distribution spools.
+ A spool defines where to look for input triplets, and where to
+ copy uploaded files.
+
+ See `info wydawca spool', for a detailed explanation.
+ */
diff --git a/src/config.c b/src/config.c
index c3b2e22..0c681ac 100644
--- a/src/config.c
+++ b/src/config.c
@@ -167,3 +167,3 @@ notification_event_str (enum notification_event evt)
{
- return event_args[evt];
+ return ARGMATCH_TO_ARGUMENT ((char*)&evt, event_args, event_types);
}
@@ -205,3 +205,3 @@ notification_target_str (enum notification_target tgt)
{
- return target_args[tgt];
+ return ARGMATCH_TO_ARGUMENT ((char*)&tgt, target_args, target_types);
}
diff --git a/src/mail.c b/src/mail.c
index 98f6c4a..756490a 100644
--- a/src/mail.c
+++ b/src/mail.c
@@ -482,2 +482,4 @@ get_uploader_email (struct uploader_info *info, struct file_triplet *trp,
+ if (!info)
+ return NULL;
rc = mu_address_create (&addr, info->email);

Return to:

Send suggestions and report system problems to the System administrator.