-
I've looked for possible causes of this issue and for me it looks like the only way for
getDefHostName()to return empty JID (BareJIDwith empty domain part) is caused by settings-Dtigase-primary-addressto an empty value (adding-Dtigase-primary-address=to Tigase options intigase.conf.This is caused by the fact that
InetAddress::getByName(tigasePrimaryHost)is NOT throwing an exception iftigasePrimaryHostis set to an empty string, causing Tigase to accept this empty string as default hostname.Additionally,
BareJIDaccepts domain ofBareJIDto be an empty string. In my opinion, this should not be allowed and we should:- throw
TigaseStringprepExceptionfor methodsbareJIDInstance() - return
nullfor methodsbareJIDInstanceNS(or throw NPE)
I think that we should also check if
tigase-secondary-addressdoes not have similar issues. - throw
-
Andrzej Wójcik wrote:
I've looked for possible causes of this issue and for me it looks like the only way for
getDefHostName()to return empty JID (BareJIDwith empty domain part) is caused by settings-Dtigase-primary-addressto an empty value (adding-Dtigase-primary-address=to Tigase options intigase.conf.This is caused by the fact that
InetAddress::getByName(tigasePrimaryHost)is NOT throwing an exception iftigasePrimaryHostis set to an empty string, causing Tigase to accept this empty string as default hostname.Thank you for pointing this out - I fixed both places in
stableandmaster.Additionally,
BareJIDaccepts domain ofBareJIDto be an empty string. In my opinion, this should not be allowed and we should:- throw
TigaseStringprepExceptionfor methodsbareJIDInstance() - return
nullfor methodsbareJIDInstanceNS(or throw NPE)
You are correct according to 2.2. Domainpart:
it is the primary identifier and is the only **REQUIRED** element of a JID (a mere domainpart is a valid JID)I added checks in
JIDInstancemethods and accompanying tests. - throw
| Type |
Bug
|
| Priority |
Normal
|
| Assignee | |
| RedmineID |
6911
|
| Version |
tigase-server-7.1.4
|
| Spent time |
0
|
It seems that tigase.server.BasicComponent#getDefHostName returns either empty or invalid value. Occurances with version 7.1.4 and 7.1.3-SNAPSHOT.