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: Sat, 14 Oct 2017 15:08:51 -0300

To: Daniel Kahn Gillmor, Notmuch Mail

Cc:

From: David Bremner


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
_______________________________________________
notmuch mailing list
notmuch@notmuchmail.org
https://notmuchmail.org/mailman/listinfo/notmuch

Thread: