From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp2.migadu.com ([2001:41d0:303:e16b::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms13.migadu.com with LMTPS id AI0CG0JxI2fcOQEAe85BDQ:P1 (envelope-from ) for ; Thu, 31 Oct 2024 12:00:02 +0000 Received: from aspmx1.migadu.com ([2001:41d0:303:e16b::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp2.migadu.com with LMTPS id AI0CG0JxI2fcOQEAe85BDQ (envelope-from ) for ; Thu, 31 Oct 2024 13:00:02 +0100 X-Envelope-To: larch@yhetil.org Authentication-Results: aspmx1.migadu.com; dkim=fail ("body hash did not verify") header.d=tethera.net header.s=2024 header.b=XXl6zKDo; spf=pass (aspmx1.migadu.com: domain of notmuch-bounces@notmuchmail.org designates 2a01:4f9:c011:7a79::1 as permitted sender) smtp.mailfrom=notmuch-bounces@notmuchmail.org; dmarc=none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1730376002; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:list-id:list-help: list-owner:list-unsubscribe:list-subscribe:list-post:dkim-signature; bh=DiZHdaemMTAyg256SWBvJ/QL9uDu+hvA1VDMbhQX5Qg=; b=MJa5IlEJaZ/krWzP8KAOMWghaHPHEzhBZeYenLiwC4/UczQMO9lr7EcHGZ9u0oxY3aAuZa sP0cIxefXXKownrOPgKHXONtklKhQ2reel/EZPhfrFUkhITngyKIqrKONSLcnm7lXXSpTs +pcXLSI7NUSh41vVGTnalYJkCMDIpH85NM2N2BXoQd6JHB4sqVpcXuBl4+v/i1HCRNY9ZT IDYMaMfaxD8NFS/UWnXh2EIZDCkkkuh3WmTaUmQEe2MAWFf8c6gMG+12jaVHJKWiC/321a EvgYgZWjHAF2mgu+ZBYHCYgWwRrLN2gUBPcLktt9T2JvC2DjBhRXlHrKkI26Yg== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1730376002; a=rsa-sha256; cv=none; b=myRRzqkTOGDxvkphy18gujSx/+0rT9PRMAqfBFmSRCbMGFQOSrCBsOfk1uXmQUjxireOjB bOC4PYjACiUUu5GuQjW6UfVCFDPQ6pZZBCbUq4JCYkXGigb3mx9H1id1DilM8eL35tEQP4 0KN9Yl/GPYJt38ccoFhbXqx1n+5MGafnqngJ3LeCSg3vQVkmRAkt95z1c478ABFjalDYn9 hY8S1o1xgCMKvpP9djtonuDptVNPoNzqpa5DSYq96zgY4p6nks0gUjAHsa45X6vWGMGX2w KObHn0a1hUz5jarktf0Co+ons62bRvEF4rnEjkM1s5YD+iqZGBaxl0Yho3i9xw== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=fail ("body hash did not verify") header.d=tethera.net header.s=2024 header.b=XXl6zKDo; spf=pass (aspmx1.migadu.com: domain of notmuch-bounces@notmuchmail.org designates 2a01:4f9:c011:7a79::1 as permitted sender) smtp.mailfrom=notmuch-bounces@notmuchmail.org; dmarc=none Received: from mail.notmuchmail.org (yantan.tethera.net [IPv6:2a01:4f9:c011:7a79::1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by aspmx1.migadu.com (Postfix) with ESMTPS id C527D588F5 for ; Thu, 31 Oct 2024 13:00:01 +0100 (CET) Received: from yantan.tethera.net (localhost [127.0.0.1]) by mail.notmuchmail.org (Postfix) with ESMTP id 622A45F5EB; Thu, 31 Oct 2024 11:59:52 +0000 (UTC) Received: from phubs.tethera.net (phubs.tethera.net [192.99.9.157]) by mail.notmuchmail.org (Postfix) with ESMTPS id AD3695F371 for ; Thu, 31 Oct 2024 11:59:49 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=tethera.net; i=@tethera.net; q=dns/txt; s=2024; t=1730375987; h=from : to : cc : subject : in-reply-to : references : date : message-id : mime-version : content-type : from; bh=ywgNzgY6gJ+Pp1xInzSsWAUDTeys8M6Gm968zZVRcyI=; b=XXl6zKDoT3yMZjOJ+cG0oDZQPXzI2mz18Pb2GlzShE0gn5Uw1OJgCPX9qxSW64u2NE/vP if7pb2+iHllCB9OnGwuv6Td8PTehlKlYSurDh0UWOJdN7WCNxkzebLBQCH6EDSheEDKac1S aU9F2vtxS/SoGyWff1yFzH7kGMaattqXj6+CIUrgkX4R0De24T/5ajVBGoOEg/ouoS4JT5e iiKDf74ZLdN9GWxQEmsmIcUn0f1iU72LWlr9IYJBoARgA5anlV4d/Tws8o8SyW+CdcNgz73 dVQ7Hu/XG/wSzxRf+PypXfI04OzsmXiP1TG74zddc9a5fJYon+kXCthvvYWg== Received: from tethera.net (fctnnbsc51w-159-2-211-58.dhcp-dynamic.fibreop.nb.bellaliant.net [159.2.211.58]) by phubs.tethera.net (Postfix) with ESMTPS id D472618006E; Thu, 31 Oct 2024 08:59:47 -0300 (ADT) Received: (nullmailer pid 2705986 invoked by uid 1000); Thu, 31 Oct 2024 11:59:47 -0000 From: David Bremner To: Ralph Seichter , notmuch@notmuchmail.org Subject: Re: [PATCH] Add support for ~/foo style relative paths In-Reply-To: <20241029221551.19393-1-ralph@ml.seichter.de> References: <20241029221551.19393-1-ralph@ml.seichter.de> Date: Thu, 31 Oct 2024 08:59:47 -0300 Message-ID: <87frocscss.fsf@tethera.net> MIME-Version: 1.0 Message-ID-Hash: KZ2GO35YDXGC7FLZZDYNISR3SOAO2UEW X-Message-ID-Hash: KZ2GO35YDXGC7FLZZDYNISR3SOAO2UEW X-MailFrom: david@tethera.net X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; emergency; loop; banned-address; member-moderation; header-match-notmuch.notmuchmail.org-0; nonmember-moderation; administrivia; implicit-dest; max-recipients; max-size; news-moderation; no-subject; digests; suspicious-header CC: Ralph Seichter X-Mailman-Version: 3.3.3 Precedence: list List-Id: "Use and development of the notmuch mail system." List-Help: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit X-Migadu-Flow: FLOW_IN X-Migadu-Country: DE X-Migadu-Spam-Score: 1.30 X-Spam-Score: 1.30 X-Migadu-Queue-Id: C527D588F5 X-Migadu-Scanner: mx13.migadu.com X-TUID: ZhSc6s3J4ymQ Ralph Seichter writes: > + strcmp (key, "database.backup_path") == 0) { > + if (val[0] == '~') > + /* Explicit syntax for "~/some/relative/path" */ > + expanded_val = talloc_asprintf (ctx, "%s%s", getenv ("HOME"), &val[1]); what should we do if val[1] != '/'? I think that is what derailed us last time. Do we think it's worth checking the passwd database for user names? what about things like '~.foo' ? > + else if (val[0] != '/') > + /* Implicit syntax for "some/relative/path" */ > + expanded_val = talloc_asprintf (ctx, "%s/%s", getenv ("HOME"), val); > + } > + if (! expanded_val) > + /* Catchall, no special expansion */ > expanded_val = talloc_strdup (ctx, val); > > return expanded_val; If we do decide to make this change, obviously we'll need to update the documentation and (maybe less obviously) tests.