[PATCH v3 11/15] config: indexing defaults will be stored in the database.
Daniel Kahn Gillmor
dkg at fifthhorseman.net
Sat Oct 14 23:28:59 PDT 2017
On Sat 2017-10-14 15:08:51 -0300, David Bremner wrote:
> Daniel Kahn Gillmor <dkg at fifthhorseman.net> writes:
>
>> static int
>> _print_db_config(notmuch_config_t *config, const char *name)
>> @@ -859,6 +860,8 @@ notmuch_config_command_get (notmuch_config_t *config, char *item)
>> notmuch_built_with (item + strlen (BUILT_WITH_PREFIX)) ? "true" : "false");
>> } else if (STRNCMP_LITERAL (item, QUERY_PREFIX) == 0) {
>> return _print_db_config (config, item);
>> + } else if (STRNCMP_LITERAL (item, INDEX_PREFIX) == 0) {
>> + return _print_db_config (config, item);
>> } else {
>> char **value;
>
> I wonder if we should sanity check the value of 'item' more here. With
> 'query.', it makes sense to get or set anything, since it's just the
> name of a stored query. With 'index.', presumably only certain
> parameters make sense. As a motivating example, consider someone who
> sets
>
> $ notmuch config index.try_decrypt true
>
> then changes their mind
>
> $ notmuch config index.try-decrypt false
>
> They _think_ they are safe, but notmuch is silently going to continue
> decrypting their mail
Do you have any suggestions about how we should do this check? Some
sort of registry of known options? If we have such a registry, how
would an addon or a frontend use notmuch config without having to modify
that registry?
--dkg
More information about the notmuch
mailing list