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


Groups > comp.lang.python > #60504

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

From Malte Forkel <malte.forkel@berlin.de>
Subject Re: How to determine whether client and server are on the same host
Date 2013-11-26 13:13 +0100
References <l708pt$r5b$1@ger.gmane.org> <7wfvqkrqvb.fsf@benfinney.id.au> <l720h8$792$2@ger.gmane.org> <CAPTjJmrt+dXUi9g3_Z6TvtHWO07=QGobtfCUbjnR5KhAq7Kr7w@mail.gmail.com>
Newsgroups comp.lang.python
Message-ID <mailman.3230.1385468030.18130.python-list@python.org> (permalink)

Show all headers | View raw


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


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 Malte Forkel <malte.forkel@berlin.de> - 2013-11-26 13:13 +0100

csiph-web