From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp0.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 uLCOAzyJI2d9RAEAqHPOHw:P1 (envelope-from ) for ; Thu, 31 Oct 2024 13:42:20 +0000 Received: from aspmx1.migadu.com ([2001:41d0:303:e16b::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp0.migadu.com with LMTPS id uLCOAzyJI2d9RAEAqHPOHw (envelope-from ) for ; Thu, 31 Oct 2024 14:42:20 +0100 X-Envelope-To: larch@yhetil.org Authentication-Results: aspmx1.migadu.com; dkim=fail ("body hash did not verify") header.d=iki.fi header.s=meesny header.b=oSGTg6A6; 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; arc=reject ("signature check failed: fail, {[1] = sig:iki.fi:reject}"); dmarc=none ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1730382140; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to: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=nG8FQC77o6PfBk6prYJaDaerJUBm74hCbtRJpfFwgMk=; b=PG2MBIdDQ8Bcj7hPskWnVW0f4f1IBLmGLqE+cp5DTnKx5jS9Al+qSo58ht2QySzV2dkGRx ciTpMIZ2XxxOxFY/4jj25J1whfVdZiQwSE4qZgOKD6Q6+nZbGyWQQe4/PANh+Qgxf2dpAt 0/nzBCCTd5SBdudOu1sr027S5UbZHWug5IU/k6knlfFqXMqZ3jO/i8alzzBXtxhUCgDrf1 SmJM0VaYJG0QYlGVwU751aP0TOPiumHMjZDSsT8KhUQ4RjT5U9kW6zvX8HK6MbgIRvugXm yhG+DlVMcNzIsV9f/W8ZD/YA8/b5FNRFbfbfftQiBLlJRAekcp/Yz3/ZXOEazw== ARC-Seal: i=2; s=key1; d=yhetil.org; t=1730382140; a=rsa-sha256; cv=fail; b=A1JxTg8vWc9kjedoF+oU3ptRwBQ++ngYuyvWxlD0+SDO4Ry0UKonE/NZgfq0UPiwYuvqP/ MjIXRfXZiIir+rcArQYLMkK3qgs2HaCaqVfEcxmkMETNO7Q/5gEIJV3t4Py7aHgh8PIcFS 313VWn07+oW0XoKMtjWUMf2u12nGjCXAt++Y2LdRABw1cm3ud0prtZrQHl1/endKN8ucxd /CXiJNa51wNB0m/xvrPBWdf+TYUaRZrQ/5Yhlxr9dlT/UlAoUSuk53ih1pt4Edd3B+DyU/ bBUUDEH1Vbd30In++PWqo+OpquoGcy8dZncaURSRcdnx7Quk4uOWki9dxwetKw== ARC-Authentication-Results: i=2; aspmx1.migadu.com; dkim=fail ("body hash did not verify") header.d=iki.fi header.s=meesny header.b=oSGTg6A6; 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; arc=reject ("signature check failed: fail, {[1] = sig:iki.fi:reject}"); 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 CEEE25ED2D for ; Thu, 31 Oct 2024 14:42:19 +0100 (CET) Received: from yantan.tethera.net (localhost [127.0.0.1]) by mail.notmuchmail.org (Postfix) with ESMTP id 7DBE25F5EB; Thu, 31 Oct 2024 13:42:16 +0000 (UTC) Received: from meesny.iki.fi (meesny.iki.fi [IPv6:2001:67c:2b0:1c1::201]) by mail.notmuchmail.org (Postfix) with ESMTPS id 14AFE5F371 for ; Thu, 31 Oct 2024 13:42:13 +0000 (UTC) Received: from c53 (gw1.nor.fi [185.218.193.67]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange ECDHE (prime256v1) server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) (Authenticated sender: too) by meesny.iki.fi (Postfix) with ESMTPSA id 4XfQCR1RTQzyR7 for ; Thu, 31 Oct 2024 15:42:11 +0200 (EET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=iki.fi; s=meesny; t=1730382131; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=J372BtbtQ8tL4onL6Ev20LYtJJ7B8VwCCMKiPCeCouA=; b=oSGTg6A6QlbdO7PYcwKD9iEQZc50oF8MP7c+5NzEXqxHCUBLznZcdGIhSsAsF+JuAUNh47 PBlOd/X9+eEBDbhhpPwUfN9DzD1N1JfmxRdljQ5Qq4nP/5TfJsVyCSrcdIkqm3O4wzvdtF FfwR9S509yAs6fjIRJsoQRMxw9yJdck= ARC-Seal: i=1; s=meesny; d=iki.fi; t=1730382131; a=rsa-sha256; cv=none; b=bpt0XzkeX+Y2DoRGCBY666jT+PkP/7pSamcSg7efvjmMUY9FE6kLLn5PHIu1EfhDoE5RKQ ZRBaVzKmDGkP1zmRiSB5lkCpyN84VDv/A3u8iaZax7ranRgRMc8VvHyCxsfX9zFN3Sn71t BpwUyP1gvtXzjTgKGg7a0sNmPg5SLYk= ARC-Authentication-Results: i=1; ORIGINATING; auth=pass smtp.auth=too smtp.mailfrom=tomi.ollila@iki.fi ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=iki.fi; s=meesny; t=1730382131; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=J372BtbtQ8tL4onL6Ev20LYtJJ7B8VwCCMKiPCeCouA=; b=kFiREdchUqB84ZYQS9krAkKnzrF1+FJ+wS0NMHezb7eHbge4i9HcoklSB0Pvi3HrFwPqY8 c4cV5sfzks6EpFlxgDUjKntTMvMN/yh3pzhqMSzeLNGNtgkGSYxEzQhgsUNsOtOoazCqoD OEk9LJTDMLdwd0Mb1TAWciOfRy4PpXM= From: Tomi Ollila To: notmuch@notmuchmail.org Subject: Re: [PATCH] Add support for ~/foo style relative paths In-Reply-To: <87frocscss.fsf@tethera.net> References: <20241029221551.19393-1-ralph@ml.seichter.de> <87frocscss.fsf@tethera.net> User-Agent: Notmuch/0.38+5~gf38f4f8 (https://notmuchmail.org) Emacs/27.1 X-Face: HhBM'cA~ MIME-Version: 1.0 Message-ID-Hash: NE6572CDHLFJESFTK7GB55U6SIJGRFFJ X-Message-ID-Hash: NE6572CDHLFJESFTK7GB55U6SIJGRFFJ X-MailFrom: tomi.ollila@iki.fi 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 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: 2.30 X-Spam-Score: 2.30 X-Migadu-Queue-Id: CEEE25ED2D X-Migadu-Scanner: mx13.migadu.com X-TUID: TFajcXhQfPkF On Thu, Oct 31 2024, David Bremner wrote: > 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' ? IMO: if (val[0] == '~' && val[1] == '/') i.e. expand leading ~/ as $HOME/ -- otherwise expand as previously. Tomi >> + 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.