Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.python > #60501

Re: How to determine whether client and server are on the same host

Path csiph.com!usenet.pasdenom.info!aioe.org!news.stack.nl!newsfeed.xs4all.nl!newsfeed3.news.xs4all.nl!xs4all!newsgate.cistron.nl!newsgate.news.xs4all.nl!post.news.xs4all.nl!not-for-mail
Return-Path <rosuav@gmail.com>
X-Original-To python-list@python.org
Delivered-To python-list@mail.python.org
X-Spam-Status OK 0.031
X-Spam-Evidence '*H*': 0.94; '*S*': 0.00; 'say,': 0.05; 'subject:same': 0.07; 'check,': 0.09; 'cookie': 0.09; 'feasible.': 0.09; 'subject:How': 0.10; 'assume': 0.14; 'itself.': 0.14; 'from:addr:rosuav': 0.16; 'from:name:chris angelico': 0.16; 'sees': 0.16; 'wrote:': 0.18; 'obviously': 0.18; 'server.': 0.24; 'header:In-Reply-To:1': 0.27; 'message-id:@mail.gmail.com': 0.30; 'work.': 0.31; 'probability': 0.31; 'file': 0.32; 'this.': 0.32; 'option': 0.32; 'run': 0.32; 'another': 0.32; 'running': 0.33; 'announce': 0.33; 'implemented': 0.33; 'subject:the': 0.34; 'could': 0.34; 'connection': 0.35; 'but': 0.35; 'received:google.com': 0.35; 'there': 0.35; 'application': 0.37; 'server': 0.38; 'nov': 0.38; 'to:addr:python-list': 0.38; 'pm,': 0.38; 'to:addr:python.org': 0.39; 'most': 0.60; 'simply': 0.61; 'simple': 0.61; 'name': 0.63; 'direct': 0.67; '26,': 0.68; 'special': 0.74; 'protocol,': 0.84; 'technically': 0.84; '2013': 0.98
DKIM-Signature v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type; bh=sfWz6KOyBAc4z65SFpCUleQ7vGCk1eatrv6uHLkNpnU=; b=UuKXVbZaKjO+nXsy3osFCrySQnIXUv2vTC68V49PJXgWaNVwmGJgYWFQa6icbchPI4 R0fb0TT+2yfBGFWt+Vj4nKutDMyOL/ojugcjNjoU1C9Zys9WSQU+DQD9xTmTnp4siTer F/kOZREpIMGthSK9X6aNpj3SFk7N5krgUTQdfSbQOdwzgIcAKGG4f0eNLQydu0o8GjfQ 1DpXliyKGBZcpGqaY3gnpDmgSgmka2+Ml1xv6eCaD36vAzWLDvdx+G1ObNQp03RPQ5QF Yuz1G1CFnbTB0y2E92moD2u+ApSfWL0svemtKkLOjxkX6xOzpy/EFS9Q/P2mN/rp/lrg EZZA==
MIME-Version 1.0
X-Received by 10.220.196.66 with SMTP id ef2mr30708646vcb.7.1385465917917; Tue, 26 Nov 2013 03:38:37 -0800 (PST)
In-Reply-To <l720h8$792$2@ger.gmane.org>
References <l708pt$r5b$1@ger.gmane.org> <7wfvqkrqvb.fsf@benfinney.id.au> <l720h8$792$2@ger.gmane.org>
Date Tue, 26 Nov 2013 22:38:37 +1100
Subject Re: How to determine whether client and server are on the same host
From Chris Angelico <rosuav@gmail.com>
To python-list@python.org
Content-Type text/plain; charset=ISO-8859-1
X-BeenThere python-list@python.org
X-Mailman-Version 2.1.15
Precedence list
List-Id General discussion list for the Python programming language <python-list.python.org>
List-Unsubscribe <https://mail.python.org/mailman/options/python-list>, <mailto:python-list-request@python.org?subject=unsubscribe>
List-Archive <http://mail.python.org/pipermail/python-list/>
List-Post <mailto:python-list@python.org>
List-Help <mailto:python-list-request@python.org?subject=help>
List-Subscribe <https://mail.python.org/mailman/listinfo/python-list>, <mailto:python-list-request@python.org?subject=subscribe>
Newsgroups comp.lang.python
Message-ID <mailman.3228.1385465920.18130.python-list@python.org> (permalink)
Lines 16
NNTP-Posting-Host 2001:888:2000:d::a6
X-Trace 1385465920 news.xs4all.nl 15890 [2001:888:2000:d::a6]:51146
X-Complaints-To abuse@xs4all.nl
Xref csiph.com comp.lang.python:60501

Show key headers only | View raw


On Tue, Nov 26, 2013 at 10:26 PM, Malte Forkel <malte.forkel@berlin.de> wrote:
> Most of the application's functionality uses the telnet connection to
> communicate with the server. One special operation is not available in
> the protocol, but can be implemented by a direct file-based operation if
> the application is run on the server itself. I would like to use that
> option if technically feasible.

There is another way you might be able to do this. The server could
simply create a cookie in the file system - say, a file in /tmp with a
randomly-generated name - and it can announce that to the client. If
the client sees the same file in what it sees as /tmp, then it can
assume that it's running on the server. Obviously there's a miniscule
probability of an accidental collision, and someone could deliberately
fool it, but for a simple check, that might work.

ChrisA

Back to comp.lang.python | Previous | Next | Find similar | Unroll thread


Thread

Re: How to determine whether client and server are on the same host Chris Angelico <rosuav@gmail.com> - 2013-11-26 22:38 +1100

csiph-web