-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1
On 08/25/2009 10:21 AM, Jakub Hrozek wrote:
Also, why are you checking if ops->uid is nonzero in that if() statement? I think just checking if(ops->domain && ops->domain != dom) is sufficient (since get_domain_by_id() has already established the validity of ops->uid)
Yes and no. Checking for ops->uid is correct but obfuscated the code, I changed it to more readable if(dom && ops->domain && ops->domain != dom) as you only want to assert ops->domain==dom if domain was given in form of FQDN (so it's in ops->domain) and uid (so it's in dom after get_domain_by_id()). Hope it makes more sense now.
Sorry, actually the first version was correct. I forgot that you can specify uid and still not get a valid domain back -- which is when you select both username@DOMAIN and an UID that is outside all domains.
I also took the liberty of chanking the get_domain_by_id() logic to fix ticket #112, too. I tested this version extensively with all kinds of weird domain-uid combinations and it should be finally OK. Sorry for the noise.
All three patches attached for clarity, but in reality only 0001 changed.
Jakub