From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from localhost (localhost [127.0.0.1]) by arlo.cworth.org (Postfix) with ESMTP id DB5926DE0C66 for ; Sat, 14 Oct 2017 23:48:21 -0700 (PDT) X-Virus-Scanned: Debian amavisd-new at cworth.org X-Spam-Flag: NO X-Spam-Score: -0.035 X-Spam-Level: X-Spam-Status: No, score=-0.035 tagged_above=-999 required=5 tests=[AWL=-0.035] autolearn=disabled Received: from arlo.cworth.org ([127.0.0.1]) by localhost (arlo.cworth.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 0tCOgNbUKb2Z for ; Sat, 14 Oct 2017 23:48:21 -0700 (PDT) Received: from che.mayfirst.org (che.mayfirst.org [162.247.75.118]) by arlo.cworth.org (Postfix) with ESMTP id 2EDC86DE0FB6 for ; Sat, 14 Oct 2017 23:48:16 -0700 (PDT) Received: from fifthhorseman.net (ool-6c3a0662.static.optonline.net [108.58.6.98]) by che.mayfirst.org (Postfix) with ESMTPSA id 50B3DF9A1; Sun, 15 Oct 2017 02:48:15 -0400 (EDT) Received: by fifthhorseman.net (Postfix, from userid 1000) id 6E7342025E; Sun, 15 Oct 2017 02:28:59 -0400 (EDT) From: Daniel Kahn Gillmor To: David Bremner , Notmuch Mail Subject: Re: [PATCH v3 11/15] config: indexing defaults will be stored in the database. In-Reply-To: <878tgdy53g.fsf@tethera.net> References: <20170915055359.24123-1-dkg@fifthhorseman.net> <20171010054916.23925-1-dkg@fifthhorseman.net> <20171010054916.23925-12-dkg@fifthhorseman.net> <878tgdy53g.fsf@tethera.net> Date: Sun, 15 Oct 2017 02:28:59 -0400 Message-ID: <87o9p8rkk4.fsf@fifthhorseman.net> MIME-Version: 1.0 Content-Type: text/plain X-BeenThere: notmuch@notmuchmail.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "Use and development of the notmuch mail system." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 15 Oct 2017 06:48:21 -0000 On Sat 2017-10-14 15:08:51 -0300, David Bremner wrote: > Daniel Kahn Gillmor 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