]> git.ipfire.org Git - thirdparty/dovecot/core.git/commitdiff
lib-storage: Once hooks have run, set vlast to NULL to make sure it's not used
authorTimo Sirainen <timo.sirainen@dovecot.fi>
Fri, 3 Feb 2017 14:16:26 +0000 (16:16 +0200)
committerTimo Sirainen <timo.sirainen@dovecot.fi>
Fri, 3 Feb 2017 14:16:26 +0000 (16:16 +0200)
The functions can't be correctly overridden outside their own specific
hooks. It would work only if hook_build_update() is called afterwards and
currently there's no public API for that.

src/lib-storage/mail-storage-hooks.c

index 282eb3def0e6c97b689abd9e73a310413f420747..1889eb722288d94f586c35d95a5523800d5ccf58 100644 (file)
@@ -273,6 +273,7 @@ void hook_mail_user_created(struct mail_user *user)
                        hook_build_update(ctx, user->vlast);
                } T_END;
        }
+       user->vlast = NULL;
        pool_unref(&ctx->pool);
 }
 
@@ -326,6 +327,7 @@ void hook_mail_storage_created(struct mail_storage *storage)
                        hook_build_update(ctx, storage->vlast);
                } T_END;
        }
+       storage->vlast = NULL;
        pool_unref(&ctx->pool);
 }
 
@@ -342,6 +344,7 @@ void hook_mailbox_list_created(struct mailbox_list *list)
                        hook_build_update(ctx, list->vlast);
                } T_END;
        }
+       list->vlast = NULL;
        pool_unref(&ctx->pool);
 }
 
@@ -358,6 +361,7 @@ void hook_mailbox_allocated(struct mailbox *box)
                        hook_build_update(ctx, box->vlast);
                } T_END;
        }
+       box->vlast = NULL;
        pool_unref(&ctx->pool);
 }
 
@@ -386,5 +390,6 @@ void hook_mail_allocated(struct mail *mail)
                        hook_build_update(ctx, pmail->vlast);
                } T_END;
        }
+       pmail->vlast = NULL;
        pool_unref(&ctx->pool);
 }