Director: Patch for the "Bug" in virtual host port verifcation.

João Ribeiro <[email protected]> Mon, 15 Sep 2003 23:19:18 +0100
Newsgroups gmane.comp.java.enhydra.director
Message-ID <[email protected]>
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Hi!

Since 2 years ago, we are using enhydra and director at the office.
It's working great but there is a feature in director that never worked=20
correctly: the port validtion in the virtualserver restriction never work=
ed.
The port validation run fine for client and server restriction but not=20
for virtualserver restriction.

We really need these feature working so i made a patch and know the port=20
is verifed when specified in a virtualserver restriction.

The conf entry

<Application prefix=3D"/admin">
        <AppServer host=3D"192.168.5.11" port=3D"9001" />
        <Restrict virtualserver=3D"myhost.dyndns.org" port=3D"8007" />
    </Application>

will know work properly and only allow connection made to the=20
vituralhost  "myhost.dyndns.org" using port  8007 be passed to the=20
enhydra application.

I've seen a very few post talking about this "bug".=20
So i put here the patch i made that correct this behaviour.
It's very small and simple.
If someone from the development team want to give a try i will be happy.

Regards.
Jo=E3o Paulo Ribeiro


[root@host common]# diff edir_load_choose.c edir_load_choose.c.old | more
201,205d200
<                       } else if ((rp->port !=3D 0) &&
<                           (local_addr->sin_port !=3D htons(rp->port))) =
{
<                           EDIR_DEBUG_EVERYTHING(("Port %d doesn't=20
match %d", \
<                                                =20
ntohs(local_addr->sin_port), \
<                                                 rp->port));
[root@host common]#

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.1 (MingW32)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iD8DBQE/ZjrrbwM7R+C+9B0RAszHAKCyx2lekRrpRUkznmC9dJgi5VvqkQCgpIr8
E/gbDfxZykbc8D9+M1abnLE=3D
=3D3rT0
-----END PGP SIGNATURE-----