Replacing of non-alphanumeric chars in Name can be confusing

Guus Sliepen guus at tinc-vpn.org
Sat May 27 18:56:26 CEST 2017


On Sat, May 27, 2017 at 05:46:17PM +0200, Niklas Hambüchen wrote:

> Tinc replaces non-alphanumeric characters in the `Name` field of
> tinc.conf by '_' (see [1] and [2]).

Only if you use Name = $something. This is clearly mentioned in the
manpage. In particular, it says:

    Name may only consist of alphanumeric and underscore characters (a-z,
    A-Z, 0-9 and _), and is case sensitive.

So it's clear about what names are normally allowed. It then goes on to
mention:

    If Name starts with a $, then the contents of the environment variable
    that follows will be used. In that case, invalid characters will be
    converted to underscores.

This was done specifically to make it easy to use Name = $HOST, and
still work when the hostname contains hyphens. However, since some
operating systems don't provide the equivalent of $HOST, or when tinc is
run in a restricted environment where $HOST is not set, tinc will use
gethostname() as a convenience. But there is no reason to expect that
this would suddenly allow hyphens.

So I believe your suggestions 1) and 2) are already implemented!

I know it was not perhaps the best choice for tinc to prevent the use of
the hyphen in Names, however it would be problematic to allow it for two
backwards-compatibility reasons: all versions of tinc up to now will
disconnect from any nodes that send any information about nodes with
hyphens in their name, and the possible ambiguity when you have node
names ending in -up or -down.

-- 
Met vriendelijke groet / with kind regards,
     Guus Sliepen <guus at tinc-vpn.org>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: Digital signature
URL: <http://www.tinc-vpn.org/pipermail/tinc/attachments/20170527/c5f53044/attachment.sig>


More information about the tinc mailing list