← Back to team overview

mysql-proxy-discuss team mailing list archive

Re: Errors with MySQL proxy 0.7.1 with my LUA script. (It was working fine with 0.6.1)

 

Hi Manohar,

It turns out you can access the information from auth, but it is
implemented in a different way.


I re-wrote that example lua script from the docs and this works:


function read_handshake( auth )
        print("<-- let's send him some information about us")
        print("    mysqld-version: " .. proxy.connection.server.mysqld_version)
        print("    thread-id     : " .. proxy.connection.server.thread_id)
        print("    scramble-buf  : " .. string.format("%q",
proxy.connection.server.scramble_buffer))
        print("    server-addr   : " .. proxy.connection.server.dst.name)
        print("    client-addr   : " .. proxy.connection.client.dst.name)

        if not proxy.connection.client.dst.name:match("^127.0.0.1:") then
                proxy.response.type = proxy.MYSQLD_PACKET_ERR
                proxy.response.errmsg = "only local connects are allowed"

                print("we don't like this client");

                return proxy.PROXY_SEND_RESULT
        end
end

I'll enter a request to update the docs later on.

Thanks

Diego

On Sat, May 23, 2009 at 12:06 PM, Diego Medina <diego@xxxxxxxxxxxxx> wrote:
> Hi Manohar,
>
> I think that the read_handshake error will be fixed once this blueprint
> https://blueprints.launchpad.net/mysql-proxy/+spec/expose-auth-packet
> is implemented.
>
> But I'm not sure how much work or how long that could take.
>
> Thanks
>
> Diego
>
> On Sat, May 23, 2009 at 9:43 AM, manohar s <manoharyes@xxxxxxxxx> wrote:
>> I am using "mysql-proxy-0.7.1-linux-rhel4-x86-32bit.tar.gz" MySQL proxy
>> binary on 32 bit machine
>>
>> uname -a:
>> [root@testserver sbin]# uname -a
>> Linux testserver 2.6.12-1.1381_FC3 #1 Fri Oct 21 03:46:55 EDT 2005 i686
>> athlon i386 GNU/Linux
>>
>> [root@testserver sbin]# ./mysql-proxy --proxy-address=192.168.1.3:4040
>> --proxy-backend-addresses=192.168.1.5:3306 --proxy-lua-script=test.lua
>> 2009-05-23 18:05:15: (critical) chassis.c:980: could not raise RLIMIT_NOFILE
>> to 8192, Invalid argument (22). Current limit still 34359739392.
>> 2009-05-23 18:05:17: (critical) (read_handshake) [string
>> "/root/mysql-proxy-0.7.1-linux-rhel4-x86-32b..."]:143: attempt to index
>> local 'auth' (a nil value)
>> 2009-05-23 18:05:17: (critical) (read_auth) [string
>> "/root/mysql-proxy-0.7.1-linux-rhel4-x86-32b..."]:166: attempt to index
>> local 'auth' (a nil value)
>>
>> I am running a sample which was working fine in 0.6.1 given here:
>> http://dev.mysql.com/doc/refman/5.0/en/mysql-proxy-scripting-read-handshake.html
>> Now where ever I have used 'auth', it is throwing these errors.
>>
>> 1) Is it expected? If so,
>> 2) Can you please point me to the updated documentation?
>>
>> Manohar
>>
>> --
>> hope is the only thing which keeps us all happy
>> _______________________________________________
>> Mailing list: https://launchpad.net/~mysql-proxy-discuss
>> Post to     : mysql-proxy-discuss@xxxxxxxxxxxxxxxxxxx
>> Unsubscribe : https://launchpad.net/~mysql-proxy-discuss
>> More help   : https://help.launchpad.net/ListHelp
>>
>>
>
>
>
> --
> Diego Medina
> Web Developer
> http://www.fmpwizard.com
>



-- 
Diego Medina
Web Developer
http://www.fmpwizard.com



References