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 C2EEA6DE0F4B for ; Mon, 27 May 2019 14:25:59 -0700 (PDT) X-Virus-Scanned: Debian amavisd-new at cworth.org X-Spam-Flag: NO X-Spam-Score: -0.25 X-Spam-Level: X-Spam-Status: No, score=-0.25 tagged_above=-999 required=5 tests=[AWL=-0.049, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_PASS=-0.001] 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 BcGwz8m9cXg1 for ; Mon, 27 May 2019 14:25:59 -0700 (PDT) Received: from che.mayfirst.org (che.mayfirst.org [162.247.75.118]) by arlo.cworth.org (Postfix) with ESMTPS id 0A9706DE0EC5 for ; Mon, 27 May 2019 14:25:58 -0700 (PDT) DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/simple; d=fifthhorseman.net; i=@fifthhorseman.net; q=dns/txt; s=2019; t=1558992358; h=from : to : subject : in-reply-to : references : date : message-id : mime-version : content-type : from; bh=8oiaS+ZNFlzORGXK5JAhmYK0BgayAr1V8siJkojFnqM=; b=D3xhAfzg8rncJawmv38xVRcayblp+svmH8mO3ShbMUNh+Cst0KsBWzZJ nZ3UV/NU5wkQ9eaTrdhWQBJY/K0NAw== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=fifthhorseman.net; i=@fifthhorseman.net; q=dns/txt; s=2019rsa; t=1558992358; h=from : to : subject : in-reply-to : references : date : message-id : mime-version : content-type : from; bh=8oiaS+ZNFlzORGXK5JAhmYK0BgayAr1V8siJkojFnqM=; b=fqbi2ujoyuTVg1KtQ2PbA/NcMihOY0/MPI1cTcTw4yX8/rJoDOZY0lQt YXBjeVHB65BC7rcx1Fme5VE95lCSKZbpVz5XdRxkNeZob1JLZMKS5NFjwf +7CNLbAoRJjLDQGaw9CT+HQebkevD5I9QUIzqU7zuHLBc1c0dHYmm1UXds 74mRaW/JczLyY0OWK9HF9L81SVyngduakKzvq76kKbxSwaAewIX8ZS6is7 o2OEstpJJoWZC7TeDmCD2HyYFe5qp1aEZEa7kemTT4t44QM/8VYK8+pwK1 Ggq+nAYrbDams1olxqGZK4SEC9npz2WnHS3kZcLjAjva7VaUgxvqGQ== Received: from fifthhorseman.net (cpe-74-71-53-242.nyc.res.rr.com [74.71.53.242]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by che.mayfirst.org (Postfix) with ESMTPSA id E9B49F99E; Mon, 27 May 2019 17:25:57 -0400 (EDT) Received: by fifthhorseman.net (Postfix, from userid 1000) id 62A9020312; Mon, 27 May 2019 17:25:55 -0400 (EDT) From: Daniel Kahn Gillmor To: David Bremner , Notmuch Mail Subject: _notmuch_database_log vs _notmuch_database_log_append [was: Re: [PATCH v2 10/17] indexing: record protected subject when indexing cleartext] In-Reply-To: <87y32sjity.fsf@tethera.net> References: <20190526221610.2833-1-dkg@fifthhorseman.net> <20190526221610.2833-11-dkg@fifthhorseman.net> <87y32sjity.fsf@tethera.net> Autocrypt: addr=dkg@fifthhorseman.net; prefer-encrypt=mutual; keydata= mDMEXEK/AhYJKwYBBAHaRw8BAQdAr/gSROcn+6m8ijTN0DV9AahoHGafy52RRkhCZVwxhEe0K0Rh bmllbCBLYWhuIEdpbGxtb3IgPGRrZ0BmaWZ0aGhvcnNlbWFuLm5ldD6ImQQTFggAQQIbAQUJA8Jn AAULCQgHAgYVCgkICwIEFgIDAQIeAQIXgBYhBMS8Lds4zOlkhevpwvIGkReQOOXGBQJcQsbzAhkB AAoJEPIGkReQOOXG4fkBAO1joRxqAZY57PjdzGieXLpluk9RkWa3ufkt3YUVEpH/AP9c+pgIxtyW +FwMQRjlqljuj8amdN4zuEqaCy4hhz/1DbgzBFxCv4sWCSsGAQQB2kcPAQEHQERSZxSPmgtdw6nN u7uxY7bzb9TnPrGAOp9kClBLRwGfiPUEGBYIACYWIQTEvC3bOMzpZIXr6cLyBpEXkDjlxgUCXEK/ iwIbAgUJAeEzgACBCRDyBpEXkDjlxnYgBBkWCAAdFiEEyQ5tNiAKG5IqFQnndhgZZSmuX/gFAlxC v4sACgkQdhgZZSmuX/iVWgD/fCU4ONzgy8w8UCHGmrmIZfDvdhg512NIBfx+Mz9ls5kA/Rq97vz4 z48MFuBdCuu0W/fVqVjnY7LN5n+CQJwGC0MIA7QA/RyY7Sz2gFIOcrns0RpoHr+3WI+won3xCD8+ sVXSHZvCAP98HCjDnw/b0lGuCR7coTXKLIM44/LFWgXAdZjm1wjODbg4BFxCv50SCisGAQQBl1UB BQEBB0BG4iXnHX/fs35NWKMWQTQoRI7oiAUt0wJHFFJbomxXbAMBCAeIfgQYFggAJhYhBMS8Lds4 zOlkhevpwvIGkReQOOXGBQJcQr+dAhsMBQkB4TOAAAoJEPIGkReQOOXGe/cBAPlek5d9xzcXUn/D kY6jKmxe26CTws3ZkbK6Aa5Ey/qKAP0VuPQSCRxA7RKfcB/XrEphfUFkraL06Xn/xGwJ+D0hCw== Date: Mon, 27 May 2019 17:25:54 -0400 Message-ID: <87a7f74mjh.fsf@fifthhorseman.net> MIME-Version: 1.0 Content-Type: multipart/signed; boundary="=-=-="; micalg=pgp-sha512; protocol="application/pgp-signature" X-BeenThere: notmuch@notmuchmail.org X-Mailman-Version: 2.1.29 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: Mon, 27 May 2019 21:26:00 -0000 --=-=-= Content-Type: text/plain On Mon 2019-05-27 07:24:41 -0300, David Bremner wrote: > Daniel Kahn Gillmor writes: > >> + status = _notmuch_message_crypto_potential_payload (msg_crypto, clear, GMIME_OBJECT (encrypted_data), GMIME_MULTIPART_ENCRYPTED_CONTENT); >> + _index_mime_part (message, indexopts, clear, msg_crypto); >> g_object_unref (clear); > > If you're going to ignore the return value here (not sure if that's a > good idea?) please explicitly cast to void rather than putting in > status to ignore. Good catch, thanks. I've logged the error with _notmuch_database_log_append in v3 of this patch, i hope that makes sense to you! i note that _index_encrypted_mime_part() itself uses an odd mixture of _notmuch_database_log_append and _notmuch_database_log, which maybe is a sign that more cleanup is due there. I confess i always get a bit confused about when to use one vs. the other, though. _log resets the database's status_string, while _log_append just appends to it. On IRC, you wrote "I'd say it makes sense to append for warnings", which is a plausible rule of thumb, but seems like it might not map to the intent of how we expect the status_string to be used -- is it for the caller of the library? or something else? For example, should every call into the library reset the status string, and then there would only be one _database_log() function? (i don't know whether that's feasible, or what it would mean for internal code that already calls exported functions directly). It'd probably be worthwhile for someone to do an audit of those uses and come up with some normalized way of handling this that we can clearly explain, because i think it's a bit unwieldy now. I'm writing this report with the intent of tagging this e-mail with notmuch::bug, in the hopes that someone interested in doing maintenance work will take this on as a future project :) --dkg --=-=-= Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iHUEARYKAB0WIQTJDm02IAobkioVCed2GBllKa5f+AUCXOxV4wAKCRB2GBllKa5f +BYyAP48XCIOI3oNfKskd4mdcbsQkpb06nskfNjc7bILu53+PAD+LNG3kI+0HR3d UxRk4RGVwgVpv9vSAjCkMTds0htZTwM= =Mas9 -----END PGP SIGNATURE----- --=-=-=--