]> git.ipfire.org Git - thirdparty/dovecot/core.git/commitdiff
config: Automatically convert old-style auth_cache_size value.
authorTimo Sirainen <tss@iki.fi>
Wed, 8 Sep 2010 13:56:15 +0000 (14:56 +0100)
committerTimo Sirainen <tss@iki.fi>
Wed, 8 Sep 2010 13:56:15 +0000 (14:56 +0100)
src/config/old-set-parser.c

index d602009a7898f1cedffbdf3cbaa9a28496b71b05..fcdbff329b8b2ca590bb9c93b87ef6da2bd8d722 100644 (file)
@@ -269,6 +269,7 @@ old_settings_handle_proto(struct config_parser_context *ctx,
 {
        struct config_section_stack *old_section = ctx->cur_section;
        const char *p;
+       uoff_t size;
        bool root;
 
        while (ctx->cur_section->prev != NULL)
@@ -407,6 +408,14 @@ old_settings_handle_proto(struct config_parser_context *ctx,
                config_apply_auth_set(ctx, key, "chroot", value);
                return TRUE;
        }
+       if (strcmp(key, "auth_cache_size") == 0 &&
+           str_to_uoff(value, &size) == 0 && size < 1024) {
+               obsolete(ctx, "auth_cache_size value no longer defaults to "
+                        "megabytes. Use %sM", value);
+               config_apply_line(ctx, key,
+                                 t_strdup_printf("%s=%sM", key, value), NULL);
+               return TRUE;
+       }
        if (strcmp(key, "auth_count") == 0) {
                if (strcmp(value, "count") == 0)
                        obsolete(ctx, "auth_count has been removed");