Path: csiph.com!usenet.pasdenom.info!dedibox.gegeweb.org!gegeweb.eu!nntpfeed.proxad.net!proxad.net!feeder1-2.proxad.net!usenet-fr.net!nerim.net!novso.com!newsfeed.xs4all.nl!newsfeed2.news.xs4all.nl!xs4all!newsgate.cistron.nl!newsgate.news.xs4all.nl!post.news.xs4all.nl!not-for-mail Return-Path: X-Original-To: python-list@python.org Delivered-To: python-list@mail.python.org X-Spam-Status: OK 0.002 X-Spam-Evidence: '*H*': 1.00; '*S*': 0.00; 'say,': 0.05; 'modify': 0.07; 'subject:same': 0.07; 'check,': 0.09; 'cookie': 0.09; 'received:80.91': 0.09; 'received:80.91.229': 0.09; 'received:gmane.org': 0.09; 'received:list': 0.09; 'subject:How': 0.10; 'assume': 0.14; '12:38,': 0.16; 'received:80.91.229.3': 0.16; 'received:dip0.t-ipconnect.de': 0.16; 'received:plane.gmane.org': 0.16; 'received:t-ipconnect.de': 0.16; 'sees': 0.16; 'sure.': 0.16; 'files.': 0.16; 'obviously': 0.18; 'server,': 0.19; 'fit': 0.20; 'header:User-Agent:1': 0.23; 'server.': 0.24; 'header:X-Complaints-To:1': 0.27; 'header:In- Reply-To:1': 0.27; 'host': 0.29; 'chris': 0.29; 'work.': 0.31; 'clever': 0.31; 'probability': 0.31; 'use?': 0.31; 'file': 0.32; 'this.': 0.32; 'probably': 0.32; 'another': 0.32; 'running': 0.33; 'announce': 0.33; 'subject:the': 0.34; 'could': 0.34; "can't": 0.35; 'connection': 0.35; 'but': 0.35; 'there': 0.35; 'application': 0.37; 'remote': 0.38; 'server': 0.38; 'same.': 0.38; 'to:addr:python-list': 0.38; 'files': 0.38; 'anything': 0.39; "couldn't": 0.39; 'to:addr:python.org': 0.39; 'received:org': 0.40; 'simply': 0.61; 'simple': 0.61; 'information': 0.63; 'name': 0.63; 'between': 0.67; 'determine': 0.67; 'received:93': 0.72; 'conclude': 0.84 X-Injected-Via-Gmane: http://gmane.org/ To: python-list@python.org From: Malte Forkel Subject: Re: How to determine whether client and server are on the same host Date: Tue, 26 Nov 2013 13:13:40 +0100 References: <7wfvqkrqvb.fsf@benfinney.id.au> Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit X-Gmane-NNTP-Posting-Host: p5ddb24f4.dip0.t-ipconnect.de User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:24.0) Gecko/20100101 Thunderbird/24.1.1 In-Reply-To: X-BeenThere: python-list@python.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: General discussion list for the Python programming language List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Newsgroups: comp.lang.python Message-ID: Lines: 23 NNTP-Posting-Host: 2001:888:2000:d::a6 X-Trace: 1385468030 news.xs4all.nl 15948 [2001:888:2000:d::a6]:39722 X-Complaints-To: abuse@xs4all.nl Xref: csiph.com comp.lang.python:60504 Am 26.11.2013 12:38, schrieb Chris Angelico: > 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. > That is a clever idea. While I can't modify the server, I could look at the files on the host running the application and try to determine if they fit to information from the server about its files. If both match, I could then conclude that application host and server host probably are the same. But, I still couldn't be sure. Isn't there anything in telnetlib that can differentiate between a local connection and a remote connection? Or may be some unique property of each host that I could use? Malte