Ticket #365 (closed defect: invalid)

Opened 3 years ago

Last modified 3 years ago

Server string code does not check IP

Reported by: Diablo-D3 Owned by: lennart
Milestone: Component: daemon
Keywords: Cc:

Description

If you give localhost as your server to anything that accepts a ServerString?, and your machine is not literally named localhost, the connection fails; yet, if you give YourMachineName? as your machine's name, it works.

PA needs to resolve your machine's name and the name given in the server string and see if the IPs are identical instead of just trying to match the raw strings.

As such, YourMachineName? and localhost should both resolve to 127.0.0.1, and PA should allow the connection.

Please note that PA should not special case this for localhost only: I could supply foo.lan and my machine's name is really foo.com; as long as both resolve to the same IP, it should connect.

Change History

Changed 3 years ago by Diablo-D3

Sorry, that should read "my machine's name could really be foo or foo.com".

Changed 3 years ago by coling

On my system:

$ hostname
jimmy
$ PULSE_SERVER=localhost paplay /usr/share/sounds/ia_ora-startup.wav
<plays>

I'm not sure I've understood the problem tho' ;)

Changed 3 years ago by Diablo-D3

This bug applies to unix sockets, not tcp ones, I'm sorry if I didn't make this clear.

Changed 3 years ago by Diablo-D3

To summarize a conversation I just had with coling on IRC, PA is now doing something that actually requires {hostname} to be put infront of unix, since unix sockets are local only and cannot be routed to another machine.

Changed 3 years ago by lennart

  • status changed from new to closed
  • resolution set to invalid

The {hostname} trick is for checking the UNIX host name as set with sethostname(2). Often enough it doesn't make sense to resolve that name to an IP address at all.

We use this to make make sure that we use the specified UNIX socket only when the UNIX hostname of the one who set the server srting and the one who reads it matches.

Or in other words: PA behaves correctly here (unless I misunderstood something). Closing bug.

Note: See TracTickets for help on using tickets.