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 51B3C6DE02A7 for ; Wed, 11 May 2016 13:16:54 -0700 (PDT) X-Virus-Scanned: Debian amavisd-new at cworth.org X-Spam-Flag: NO X-Spam-Score: 0.592 X-Spam-Level: X-Spam-Status: No, score=0.592 tagged_above=-999 required=5 tests=[AWL=-0.060, SPF_NEUTRAL=0.652] 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 UFuqKs8-xAFK for ; Wed, 11 May 2016 13:16:46 -0700 (PDT) Received: from guru.guru-group.fi (guru.guru-group.fi [46.183.73.34]) by arlo.cworth.org (Postfix) with ESMTP id ECDCD6DE0281 for ; Wed, 11 May 2016 13:16:45 -0700 (PDT) Received: from guru.guru-group.fi (localhost [IPv6:::1]) by guru.guru-group.fi (Postfix) with ESMTP id EDAB01000B3; Wed, 11 May 2016 23:16:39 +0300 (EEST) From: Tomi Ollila To: David Edmondson , Bijan Chokoufe Cc: notmuch@notmuchmail.org Subject: Re: [PATCH] config: Expand ~ to $HOME In-Reply-To: References: <1462722574-4176-1-git-send-email-bijan@chokoufe.com> <20160509215724.GA3634@600B5B> User-Agent: Notmuch/0.22+18~gbe09ed8 (http://notmuchmail.org) Emacs/24.5.1 (x86_64-unknown-linux-gnu) X-Face: HhBM'cA~ MIME-Version: 1.0 Content-Type: text/plain X-BeenThere: notmuch@notmuchmail.org X-Mailman-Version: 2.1.20 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: Wed, 11 May 2016 20:16:54 -0000 On Wed, May 11 2016, David Edmondson wrote: > On Wed, May 11 2016, Bijan Chokoufe wrote: > >> so what would be the spec for handling ~user? > > Look up "user" in the password file and replace "~user" with their home > directory. See getpwnam(). > >> As Tomi pointed out ~foo will point to different folders if set by user >> 'foo' or by user 'bar'. > > ~foo means "the home directory of user foo", independent of who is using > it, so it will be the same when used by both user foo and user bar. > 3 things more if you're cooking new patch 1) use git send-email -- then it is easier to apply. 2) on talloc() use config instead of NULL to lessen unfreed memory at program exit 3) talloc_free() old config->database_path and set it to point the new value. Tomi >> To what folder should it point and where do I get this information? >> >> David Edmondson schrieb am Di., 10. Mai 2016 um 10:22 Uhr: >> >>> On Mon, May 09 2016, Bijan Chokoufe Nejad wrote: >>> >>> >> ~user is ~ in case you're 'user' -- except that now that I think of it >>> >> ~user could read home directory from /etc/passwd and not using $HOME. >>> >> If you're 'eve', then ~alice should definitely be different than ~ >>> > >>> > OK I see. I never used ~user instead of ~ and don't see any advantage in >>> using >>> > ~user but good to know it's there. >>> >>> A solution that supports ~ but not ~user seems incomplete. >>>