9fans - fans of the OS Plan 9 from Bell Labs
 help / color / mirror / Atom feed
From: Russ Cox <rsc@swtch.com>
To: Fans of the OS Plan 9 from Bell Labs <9fans@9fans.net>
Subject: Re: [9fans] P9p on Fedora 12
Date: Thu,  2 Sep 2010 15:24:49 -0400	[thread overview]
Message-ID: <AANLkTikKZc_Hz8vECiPTJzL1Vqu1AuzbCX4tv043tksv@mail.gmail.com> (raw)
In-Reply-To: <f88ed432d6a122022362c3a216aa861c@terzarima.net>

On Mon, Aug 30, 2010 at 7:22 PM, Charles Forsyth <forsyth@terzarima.net> wrote:
> in rcinputproc
>                s = setecho(sfd, 0);
>                if(write(rcfd, pair.s, pair.ns) < 0)
>                        threadexitsall(nil);
>                if(s)
>                        setecho(sfd, s);
>
> there's a race between setting echo off, writing to rcfd, resetting echo and
> the reader of the other side of rcfd. a sleep(1) before if(s) makes it less frequent
> because the reader gets to read the data in the right mode.
> i haven't really looked at what linux is doing that allows that,
> or what changed between revisions.
>
> it's not my observation, it was on a list or issue comment somewhere,
> presumably for p9p. i can't find the bookmark.

thanks for this.  sleep(1) helped only rarely,
sleep(10) helps most of the time.  unfortunately
then there's a race between the invoked program
turning off echo and 9term turning it back on.
so "sudo sh" is pretty likely to echo the password
with the sleep in there.

what a mess.

russ


  reply	other threads:[~2010-09-02 19:24 UTC|newest]

Thread overview: 33+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-02-22  9:56 Pavel Klinkovsky
2010-02-24 10:13 ` Pavel Klinkovsky
2010-02-24 16:07   ` David Leimbach
2010-03-01  9:49   ` Pavel Klinkovsky
2010-03-01 11:04     ` Gabriel Díaz
2010-03-01 12:11   ` Pavel Klinkovsky
2010-03-01 12:37     ` Gabriel Díaz
2010-03-01 12:56       ` erik quanstrom
2010-03-01 13:02         ` Gabriel Díaz
2010-03-01 14:10       ` Pavel Klinkovsky
     [not found]       ` <d03cbc06-ad77-47f0-b3b5-e78454608057@t20g2000yqe.googlegroups.co>
2010-03-01 14:32         ` erik quanstrom
2010-03-01 13:19   ` Pavel Klinkovsky
2010-03-01 14:35     ` Gabriel Díaz
2010-08-29 23:01 ` fgergo
2010-08-30  3:46   ` erik quanstrom
2010-08-30 11:20     ` Russ Cox
2010-08-30 11:38       ` erik quanstrom
2010-08-30 12:39         ` erik quanstrom
2010-08-30 16:09       ` Skip Tavakkolian
2010-08-30 17:47         ` erik quanstrom
2010-08-30 18:53           ` Skip Tavakkolian
2010-08-30 23:11             ` Russ Cox
2010-08-30 23:22               ` Charles Forsyth
2010-09-02 19:24                 ` Russ Cox [this message]
2010-09-03 14:25                   ` Russ Cox
2010-09-08 15:37                     ` roger peppe
2010-08-30 18:47         ` Russ Cox
2010-09-06 11:47     ` Pavel Klinkovsky
2010-09-06 20:08       ` Russ Cox
2010-09-06 21:48         ` Ethan Grammatikidis
2010-09-06 21:54           ` Ethan Grammatikidis
2010-09-07  8:47       ` Pavel Klinkovsky
2010-09-06 11:45 ` [9fans] [plan9mod] " Pavel Klinkovsky

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

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

  git send-email \
    --in-reply-to=AANLkTikKZc_Hz8vECiPTJzL1Vqu1AuzbCX4tv043tksv@mail.gmail.com \
    --to=rsc@swtch.com \
    --cc=9fans@9fans.net \
    /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.
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 NNTP newsgroup(s).