[PATCH v3 10/15] crypto: index encrypted parts when indexopts try_decrypt is set.

David Bremner david at tethera.net
Thu Oct 12 18:08:26 PDT 2017


Daniel Kahn Gillmor <dkg at fifthhorseman.net> writes:

> +	if (status) {
> +	    _notmuch_database_log (notmuch, "Warning: setup failed for decrypting "
> +				   "during indexing. (%d)\n", status);
> +	    status = notmuch_message_add_property (message, "index-decryption", "failure");
> +	    if (status)
> +		_notmuch_database_log (notmuch, "failed to add index-decryption "
> +				       "property (%d)\n", status);
> +	    return;
> +	}

The second _notmuch_database_log will override the first
here. You can use _notmuch_database_log_append if you don't want to
clear the existing log (e.g. at least for the second _log
here).

> +    const char *autoproperties[] = { "index-decryption" };

I'm always a bit nervous when I see the same string hard coded into two
different places.  What about using some prefix naming scheme like
"index.auto.decryption" with the idea that all properties with the
prefix "index.auto." could be blown away. If we settle on a prefix based
naming scheme now, we could do the minor tweak to the properties API
later so that it's only a single call.


More information about the notmuch mailing list