From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: 2QdxY4RzWzUUiLuE@potatochowder.com Newsgroups: gmane.emacs.help Subject: Re: emacsclient and sudo Date: Wed, 24 Feb 2021 12:01:21 -0600 Message-ID: References: Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="14790"; mail-complaints-to="usenet@ciao.gmane.io" To: help-gnu-emacs@gnu.org Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane-mx.org@gnu.org Wed Feb 24 19:02:27 2021 Return-path: Envelope-to: geh-help-gnu-emacs@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1lEyUU-0003kC-LD for geh-help-gnu-emacs@m.gmane-mx.org; Wed, 24 Feb 2021 19:02:26 +0100 Original-Received: from localhost ([::1]:56440 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lEyUT-000373-L0 for geh-help-gnu-emacs@m.gmane-mx.org; Wed, 24 Feb 2021 13:02:25 -0500 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:59494) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from <2QdxY4RzWzUUiLuE@potatochowder.com>) id 1lEyTh-00036g-Q2 for help-gnu-emacs@gnu.org; Wed, 24 Feb 2021 13:01:37 -0500 Original-Received: from www458.your-server.de ([136.243.165.62]:40404) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from <2QdxY4RzWzUUiLuE@potatochowder.com>) id 1lEyTe-0002dj-Jo for help-gnu-emacs@gnu.org; Wed, 24 Feb 2021 13:01:37 -0500 Original-Received: from sslproxy06.your-server.de ([78.46.172.3]) by www458.your-server.de with esmtpsa (TLSv1.3:TLS_AES_256_GCM_SHA384:256) (Exim 4.92.3) (envelope-from <2QdxY4RzWzUUiLuE@potatochowder.com>) id 1lEyTT-000186-R4 for help-gnu-emacs@gnu.org; Wed, 24 Feb 2021 19:01:24 +0100 Original-Received: from [140.82.175.170] (helo=localhost) by sslproxy06.your-server.de with esmtpsa (TLSv1.3:TLS_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from <2QdxY4RzWzUUiLuE@potatochowder.com>) id 1lEyTT-0003Nk-9q for help-gnu-emacs@gnu.org; Wed, 24 Feb 2021 19:01:23 +0100 Mail-Followup-To: help-gnu-emacs@gnu.org Content-Disposition: inline In-Reply-To: X-Authenticated-Sender: 2QdxY4RzWzUUiLuE@potatochowder.com X-Virus-Scanned: Clear (ClamAV 0.102.4/26090/Wed Feb 24 13:09:42 2021) Received-SPF: pass client-ip=136.243.165.62; envelope-from=2QdxY4RzWzUUiLuE@potatochowder.com; helo=www458.your-server.de X-Spam_score_int: -18 X-Spam_score: -1.9 X-Spam_bar: - X-Spam_report: (-1.9 / 5.0 requ) BAYES_00=-1.9, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane-mx.org@gnu.org Original-Sender: "help-gnu-emacs" Xref: news.gmane.io gmane.emacs.help:128228 Archived-At: On 2021-02-24 at 18:48:54 +0100, Regarding "emacsclient and sudo," Luca Ferrari wrote: > Hi all, > when I start my emacsclient I can see all the colors I've setup for > fonts and faces. However, when I start it thru sudo (e..g, to quickly > edit a file with privileges instead of using tramp) all my settings > seem to be gone. > So far, I'm starting it normally (without sudo) and use tramp to edit > a file with sudo, but sometimes my fingers are faster than my brain > and I type "sudo emacs ...". > I suspect sudo is doing something to prevent emacs to start with my > settings, even if my home environment is kept. > > Anyone else dealing with this? No, but that's because I don't use sudo with emacsclient. ;-) Sudo has a whole bunch of configuration (command line arguments, environment variables, policies) regarding the HOME environment variable and the effiective user id, and I'd bet that one of those is actually being set to root's and then emacs doesn't find your settings. Check sudo's the man page and your local sudo policies. In the long run, please retrain your fingers. Unnecessarily running programs as root is an accident waiting to happen.