Re: [PATCH v3 11/15] config: indexing defaults will be stored in the database.

Subject: Re: [PATCH v3 11/15] config: indexing defaults will be stored in the database.

Date: Sun, 15 Oct 2017 02:28:59 -0400

To: David Bremner, Notmuch Mail

Cc:

From: Daniel Kahn Gillmor


On Sat 2017-10-14 15:08:51 -0300, David Bremner wrote:
> Daniel Kahn Gillmor <dkg@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
_______________________________________________
notmuch mailing list
notmuch@notmuchmail.org
https://notmuchmail.org/mailman/listinfo/notmuch

Thread: