0

What are the mechanics needed to intercept calls being made from web apps to the MySQL C API in Linux?

I want to be able to intercept SQL calls being made and decide whether they should continue to MySQL.

If anyone point me in the right direction that would be greatly appreciated.

Jonathan Leffler
  • 730,956
  • 141
  • 904
  • 1,278
pzirkind
  • 2,338
  • 2
  • 20
  • 25
  • You didn't even say which OS ... anyway, a trivial but tedious option is to create a wrapper library. – Jester Aug 09 '15 at 15:25
  • Whoops you are absolutely correct! Linux – pzirkind Aug 09 '15 at 15:25
  • Are you going to be able to relink every application that might be making calls to the MySQL system? Or are you only concerned about those from a particular web server? Is the DBMS running on the same machine as the web apps? – Jonathan Leffler Aug 09 '15 at 16:00
  • only from web server – pzirkind Aug 09 '15 at 16:00
  • 1
    You can do this with a wrapper library loaded with LD_PRELOAD. Plenty of examples on the internet, see for example http://stackoverflow.com/questions/69859/how-could-i-intercept-linux-sys-calls – Joni Aug 11 '15 at 08:39
  • thanks, that is helpful, appreciated – pzirkind Aug 11 '15 at 13:28

0 Answers0