unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
From: Thierry Volpiatto <thierry.volpiatto@gmail.com>
To: Sven Joachim <svenjoac@gmx.de>
Cc: emacs-devel@gnu.org
Subject: Re: Possible issue with sudo in eshell
Date: Fri, 06 Apr 2012 18:22:18 +0200	[thread overview]
Message-ID: <87k41sakzp.fsf@gmail.com> (raw)
In-Reply-To: <8762dd59tu.fsf@turtle.gmx.de> (Sven Joachim's message of "Fri, 06 Apr 2012 14:22:21 +0200")

Hi Sven,

Sven Joachim <svenjoac@gmx.de> 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 



      parent reply	other threads:[~2012-04-06 16:22 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-04-06 10:32 Possible issue with sudo in eshell Thierry Volpiatto
2012-04-06 12:22 ` Sven Joachim
2012-04-06 13:11   ` Tom Willemsen
2012-04-06 16:30     ` Thierry Volpiatto
2012-04-06 16:22   ` Thierry Volpiatto [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87k41sakzp.fsf@gmail.com \
    --to=thierry.volpiatto@gmail.com \
    --cc=emacs-devel@gnu.org \
    --cc=svenjoac@gmx.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).