From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Thierry Volpiatto Newsgroups: gmane.emacs.devel Subject: Re: Possible issue with sudo in eshell Date: Fri, 06 Apr 2012 18:22:18 +0200 Message-ID: <87k41sakzp.fsf@gmail.com> References: <87sjgh9mm8.fsf@gmail.com> <8762dd59tu.fsf@turtle.gmx.de> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: dough.gmane.org 1333729365 11717 80.91.229.3 (6 Apr 2012 16:22:45 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Fri, 6 Apr 2012 16:22:45 +0000 (UTC) Cc: emacs-devel@gnu.org To: Sven Joachim Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Fri Apr 06 18:22:40 2012 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1SGBvj-0005As-KT for ged-emacs-devel@m.gmane.org; Fri, 06 Apr 2012 18:22:31 +0200 Original-Received: from localhost ([::1]:51663 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SGBvi-0006lK-Rw for ged-emacs-devel@m.gmane.org; Fri, 06 Apr 2012 12:22:30 -0400 Original-Received: from eggs.gnu.org ([208.118.235.92]:56333) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SGBvg-0006l1-7b for emacs-devel@gnu.org; Fri, 06 Apr 2012 12:22:29 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1SGBve-0001ni-Gq for emacs-devel@gnu.org; Fri, 06 Apr 2012 12:22:27 -0400 Original-Received: from mail-we0-f169.google.com ([74.125.82.169]:50383) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SGBve-0001na-8R for emacs-devel@gnu.org; Fri, 06 Apr 2012 12:22:26 -0400 Original-Received: by werj55 with SMTP id j55so1942940wer.0 for ; Fri, 06 Apr 2012 09:22:23 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:cc:subject:references:date:in-reply-to:message-id :user-agent:mime-version:content-type; bh=SW/au4iBkldNS9kgCgRsf9r7ASn1HcNz7BoCYZ3BHoA=; b=EVbx8ernhOaghf6vYl9e/l1G40X6rB5O7X1HlK8hF9tDimU9QgouPD1PUx7qNWSC6a GIBW0fKR3uVnFZ1+n1mYs42JZC7n0v76gGtQPK3WqWgwvWJDmoRKlAGDCV/rf/T1IF2V jc7nIC/Gx4G8qDxf5JE8vN+/Yx7lCqUUF03A1EehhdtQbgYQgA2zhIME0XLe/9bhyAAH OgBUHmkZNipjpeIQoVkszMwA0qwVb6VkjbbHuDYoU7tNZcwRkK/yIimCNrpp2bPLPWPq sxIVV4EWkQpZ8r07z4saqYoVLJHPFIkR1rl1+kIzSEfyF3DhJlctvwrnIggkLk2GbRQF v1sg== Original-Received: by 10.180.8.231 with SMTP id u7mr12763170wia.9.1333729343442; Fri, 06 Apr 2012 09:22:23 -0700 (PDT) Original-Received: from thierry-MM061 (lbe83-2-78-243-104-167.fbx.proxad.net. [78.243.104.167]) by mx.google.com with ESMTPS id ex2sm12461763wib.8.2012.04.06.09.22.20 (version=TLSv1/SSLv3 cipher=OTHER); Fri, 06 Apr 2012 09:22:22 -0700 (PDT) In-Reply-To: <8762dd59tu.fsf@turtle.gmx.de> (Sven Joachim's message of "Fri, 06 Apr 2012 14:22:21 +0200") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.0.95 (gnu/linux) X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 74.125.82.169 X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:149430 Archived-At: Hi Sven, Sven Joachim writes: > On 2012-04-06 12:32 +0200, Thierry Volpiatto wrote: > >> Hi all, >> >> when I run a command with sudo in eshell, e.g "sudo ls /etc" >> I must enter a password as expected, but I must reenter this password at >> each time I repeat the command. This is annoying. >> >> This works fine in M-x shell and term. >> >> It seem the timestamp is recorded in /var/lib/sudo, but eshell is not >> reading it before running command again. > > That's because eshell special cases sudo and uses an internal command > that calls tramp behind the scenes. The result is this: > > ,---- > | ~ $ tty > | /dev/pts/3 > | ~ $ sudo tty > | not a tty > | ~ $ /usr/bin/sudo tty > | /dev/pts/3 > | ~ $ > `---- I see, thanks for these infos. The timestamp is recorded here in "/var/lib/sudo/thierry/3" which would correspond with /dev/pts/3. I am already using an alias for sudo: alias sudo *sudo -p Password: $* and with it, "sudo tty" always return "/dev/pts/3", but I have anyway to reenter password at each time. > If sudo is configured with the tty_tickets option (recommended for > security reasons), you'll have to enter the password each time. > >> I have no idea how to fix this, any hints welcome. > > I tried "alias sudo /usr/bin/sudo", but that worked badly. I think this is same as using "*sudo" which work badly too. > Any eshell guru around with better suggestions? -- Thierry Get my Gnupg key: gpg --keyserver pgp.mit.edu --recv-keys 59F29997