~ubuntu-branches/ubuntu/trusty/dovecot/trusty-updates

« back to all changes in this revision

Viewing changes to src/config/config-filter.c

  • Committer: Package Import Robot
  • Author(s): James Page
  • Date: 2014-01-08 09:35:49 UTC
  • mfrom: (1.15.3) (96.1.1 trusty-proposed)
  • Revision ID: package-import@ubuntu.com-20140108093549-814nkqdcxfbvgktg
Tags: 1:2.2.9-1ubuntu1
* Merge from Debian unstable, remaining changes:
  + Add mail-stack-delivery package:
    - Update d/rules
    - d/control: convert existing dovecot-postfix package to a dummy
      package and add new mail-stack-delivery package.
    - Update maintainer scripts.
    - Rename d/dovecot-postfix.* to debian/mail-stack-delivery.*
    - d/mail-stack-delivery.preinst: Move previously installed backups and
      config files to a new package namespace.
    - d/mail-stack-delivery.prerm: Added to handle downgrades.
  + Use Snakeoil SSL certificates by default:
    - d/control: Depend on ssl-cert.
    - d/dovecot-core.postinst: Relax grep for SSL_* a bit.
  + Add autopkgtest to debian/tests/*.
  + Add ufw integration:
    - d/dovecot-core.ufw.profile: new ufw profile.
    - d/rules: install profile in dovecot-core.
    - d/control: dovecot-core - suggest ufw.
  + d/dovecot-core.dirs: Added usr/share/doc/dovecot-core
  + Add apport hook:
    - d/rules, d/source_dovecot.py
  + Add upstart job:
    - d/rules, d/dovecot-core.dovecot.upstart, d/control,
      d/dovecot-core.dirs, dovecot-imapd.{postrm, postinst, prerm},
      d/dovecot-pop3d.{postinst, postrm, prerm}.
      d/mail-stack-deliver.postinst: Convert init script to upstart.
  + Use the autotools-dev dh addon to update config.guess/config.sub for
    arm64.
* Dropped changes, included in Debian:
  - Update Dovecot name to reflect distribution in login greeting.
  - Update Drac plugin for >= 2.0.0 support.
* d/control: Drop dovecot-postfix package as its no longer required.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
/* Copyright (c) 2005-2012 Dovecot authors, see the included COPYING file */
 
1
/* Copyright (c) 2005-2013 Dovecot authors, see the included COPYING file */
2
2
 
3
3
#include "lib.h"
4
4
#include "array.h"
164
164
}
165
165
 
166
166
static bool have_changed_settings(const struct config_filter_parser *parser,
167
 
                                  const char *module)
 
167
                                  const char *const *modules)
168
168
{
169
169
        const unsigned char *changes;
170
170
        unsigned int i, j, size;
171
171
 
172
172
        for (i = 0; parser->parsers[i].root != NULL; i++) {
173
 
                if (*module != '\0' &&
174
 
                    !config_module_want_parser(config_module_parsers,
175
 
                                               module, parser->parsers[i].root))
 
173
                if (!config_module_want_parser(config_module_parsers,
 
174
                                               modules, parser->parsers[i].root))
176
175
                        continue;
177
176
 
178
177
                changes = settings_parser_get_changes(parser->parsers[i].parser);
186
185
}
187
186
 
188
187
static struct config_filter_parser *const *
189
 
config_filter_find_all(struct config_filter_context *ctx, const char *module,
 
188
config_filter_find_all(struct config_filter_context *ctx,
 
189
                       const char *const *modules,
190
190
                       const struct config_filter *filter,
191
191
                       struct master_service_settings_output *output_r)
192
192
{
203
203
 
204
204
                if (!config_filter_match_service(mask, filter)) {
205
205
                        if (!str_array_contains(&service_names, mask->service) &&
206
 
                            have_changed_settings(ctx->parsers[i], module))
 
206
                            have_changed_settings(ctx->parsers[i], modules))
207
207
                                array_append(&service_names, &mask->service, 1);
208
208
                        continue;
209
209
                }
221
221
                }
222
222
        }
223
223
        if (filter->service == NULL) {
224
 
                (void)array_append_space(&service_names);
 
224
                array_append_zero(&service_names);
225
225
                output_r->specific_services = array_idx(&service_names, 0);
226
226
        }
227
227
 
228
228
        array_sort(&matches, config_filter_parser_cmp);
229
 
        (void)array_append_space(&matches);
 
229
        array_append_zero(&matches);
230
230
        return array_idx(&matches, 0);
231
231
}
232
232
 
259
259
                        array_append(&matches, &ctx->parsers[i], 1);
260
260
        }
261
261
        array_sort(&matches, config_filter_parser_cmp_rev);
262
 
        (void)array_append_space(&matches);
 
262
        array_append_zero(&matches);
263
263
        return array_idx(&matches, 0);
264
264
}
265
265
 
306
306
}
307
307
 
308
308
int config_filter_parsers_get(struct config_filter_context *ctx, pool_t pool,
309
 
                              const char *module,
 
309
                              const char *const *modules,
310
310
                              const struct config_filter *filter,
311
311
                              struct config_module_parser **parsers_r,
312
312
                              struct master_service_settings_output *output_r,
322
322
           with an error. Merging SET_STRLIST types requires
323
323
           settings_parser_apply_changes() to work a bit unintuitively by
324
324
           letting the destination settings override the source settings. */
325
 
        src = config_filter_find_all(ctx, module, filter, output_r);
 
325
        src = config_filter_find_all(ctx, modules, filter, output_r);
326
326
 
327
327
        /* all of them should have the same number of parsers.
328
328
           duplicate our initial parsers from the first match */