Re: [BUG] inconsistent user context handling w/ tramp
authorDavid Bremner <david@tethera.net>
Sat, 2 Mar 2013 18:50:19 +0000 (14:50 +2000)
committerW. Trevor King <wking@tremily.us>
Fri, 7 Nov 2014 17:53:50 +0000 (09:53 -0800)
6a/15a6beb0d053c4090bc2d3b78793227a00f5d6 [new file with mode: 0644]

diff --git a/6a/15a6beb0d053c4090bc2d3b78793227a00f5d6 b/6a/15a6beb0d053c4090bc2d3b78793227a00f5d6
new file mode 100644 (file)
index 0000000..1c294b4
--- /dev/null
@@ -0,0 +1,107 @@
+Return-Path: <bremner@unb.ca>\r
+X-Original-To: notmuch@notmuchmail.org\r
+Delivered-To: notmuch@notmuchmail.org\r
+Received: from localhost (localhost [127.0.0.1])\r
+       by olra.theworths.org (Postfix) with ESMTP id 7CB13431FAF\r
+       for <notmuch@notmuchmail.org>; Sat,  2 Mar 2013 10:50:28 -0800 (PST)\r
+X-Virus-Scanned: Debian amavisd-new at olra.theworths.org\r
+X-Spam-Flag: NO\r
+X-Spam-Score: 0\r
+X-Spam-Level: \r
+X-Spam-Status: No, score=0 tagged_above=-999 required=5 tests=[none]\r
+       autolearn=disabled\r
+Received: from olra.theworths.org ([127.0.0.1])\r
+       by localhost (olra.theworths.org [127.0.0.1]) (amavisd-new, port 10024)\r
+       with ESMTP id i9+PcW56R5H0 for <notmuch@notmuchmail.org>;\r
+       Sat,  2 Mar 2013 10:50:28 -0800 (PST)\r
+Received: from tesseract.cs.unb.ca (tesseract.cs.unb.ca [131.202.240.238])\r
+       (using TLSv1 with cipher DHE-RSA-AES128-SHA (128/128 bits))\r
+       (No client certificate requested)\r
+       by olra.theworths.org (Postfix) with ESMTPS id E7B5F431FAE\r
+       for <notmuch@notmuchmail.org>; Sat,  2 Mar 2013 10:50:27 -0800 (PST)\r
+Received: from fctnnbsc30w-156034082078.dhcp-dynamic.fibreop.nb.bellaliant.net\r
+       ([156.34.82.78] helo=zancas.localnet)\r
+       by tesseract.cs.unb.ca with esmtpsa\r
+       (TLS1.2:DHE_RSA_AES_128_CBC_SHA1:128) (Exim 4.80)\r
+       (envelope-from <bremner@unb.ca>)\r
+       id 1UBrVp-0008Lz-8K; Sat, 02 Mar 2013 14:50:26 -0400\r
+Received: from bremner by zancas.localnet with local (Exim 4.80)\r
+       (envelope-from <bremner@unb.ca>)\r
+       id 1UBrVj-0002Ql-GI; Sat, 02 Mar 2013 14:50:19 -0400\r
+From: David Bremner <david@tethera.net>\r
+To: Simon Campese <notmuchmail_org@campese.de>, notmuch@notmuchmail.org\r
+Subject: Re: [BUG] inconsistent user context handling w/ tramp\r
+In-Reply-To: <874nguxbvq.fsf@tu-dortmund.de>\r
+References: <874nguxbvq.fsf@tu-dortmund.de>\r
+User-Agent: Notmuch/0.15.2+32~g16aa65b (http://notmuchmail.org) Emacs/24.2.1\r
+       (x86_64-pc-linux-gnu)\r
+Date: Sat, 02 Mar 2013 14:50:19 -0400\r
+Message-ID: <87sj4d63h0.fsf@zancas.localnet>\r
+MIME-Version: 1.0\r
+Content-Type: text/plain\r
+X-Spam_bar: -\r
+X-BeenThere: notmuch@notmuchmail.org\r
+X-Mailman-Version: 2.1.13\r
+Precedence: list\r
+List-Id: "Use and development of the notmuch mail system."\r
+       <notmuch.notmuchmail.org>\r
+List-Unsubscribe: <http://notmuchmail.org/mailman/options/notmuch>,\r
+       <mailto:notmuch-request@notmuchmail.org?subject=unsubscribe>\r
+List-Archive: <http://notmuchmail.org/pipermail/notmuch>\r
+List-Post: <mailto:notmuch@notmuchmail.org>\r
+List-Help: <mailto:notmuch-request@notmuchmail.org?subject=help>\r
+List-Subscribe: <http://notmuchmail.org/mailman/listinfo/notmuch>,\r
+       <mailto:notmuch-request@notmuchmail.org?subject=subscribe>\r
+X-List-Received-Date: Sat, 02 Mar 2013 18:50:28 -0000\r
+\r
+Simon Campese <notmuchmail_org@campese.de> writes:\r
+\r
+> Hello,\r
+>\r
+> after using tramp to open a file using the 'su' or 'sudo' protocol as\r
+> user X, the next time I run 'compose-mail' to compose a message it\r
+> apparently looks in the home directory of user X for its config file,\r
+> mail directory etc. In the compose window, I get the error message\r
+>\r
+> 'Error reading configuration file $X_homedir/.notmuch-config: No such\r
+> file or directory'\r
+>\r
+> in all header fields (From, Fcc etc.) that should be filled by notmuch\r
+> ($X_homedir  is the home directory of user X from above).\r
+>\r
+\r
+I don't think this is specific to notmuch. Notmuch uses the HOME\r
+environment variable to locate it's configuration file, and tramp is\r
+modifying this environment variable. \r
+\r
+To verify this:\r
+\r
+Start emacs with "emacs -Q"\r
+open a file use /su:user_@localhost:filename\r
+run M-! (or M-x shell-command) echo $HOME\r
+\r
+you will see that the variable is changed to the home directory of\r
+user_x.\r
+\r
+If you think this behaviour of tramp is wrong (I didn't think through\r
+all the implications), then you could file an emacs bug.\r
+\r
+Do you see this behaviour when running compose-mail from a buffer that\r
+is not a tramp buffer?\r
+\r
+All that said, the patches of \r
+\r
+     mid:2f89028f7986f67792478f1728ca1f1fdd382d3c.1359495450.git.jani@nikula.org\r
+\r
+could be used to work around this "feature" of tramp.  In fact since\r
+they were stalled a bit waiting for a convincing use case, maybe your\r
+report will help get them into notmuch more quickly.\r
+\r
+Someone would still have to modify the emacs client side code, but at\r
+least conceptually I don't think that would be difficult.\r
+\r
+d\r
+\r
+PS: all my tests where with Emacs 24.2.1\r
+\r
+\r