openvpn-python-plugin icon indicating copy to clipboard operation
openvpn-python-plugin copied to clipboard

problems with build and run on Linux

Open tuchinsky opened this issue 3 years ago • 0 comments

I'm trying to build on Ubuntu 20.04 with Python 3.8 and gcc 9.4

The first problem I had was interpreting warnings as errors:

openvpn-plugin-python.c: In function ‘openvpn_plugin_func_v3’:
openvpn-plugin-python.c:230:51: warning: format ‘%ld’ expects argument of type ‘long int’, but argument 4 has type ‘int’ [-Wformat=]
  230 |   log(PLOG_DEBUG, PLUGIN_NAME, "Result of call: %ld", retval);
      |                                                 ~~^   ~~~~~~
      |                                                   |   |
      |                                                   |   int
      |                                                   long int
      |                                                 %d
openvpn-plugin-python.c:246:3: error: format not a string literal and no format arguments [-Werror=format-security]
  246 |   log(PLOG_ERR, PLUGIN_NAME, python_error(retval));
      |   ^~~
cc1: some warnings being treated as errors
error: command 'x86_64-linux-gnu-gcc' failed with exit status 1
make: *** [Makefile:13: openvpn-plugin-python.so] Error 1

I fixed this by adding -Wformat=0 -Wno-format-security flags to CFLAGS. This doesn't best idea, but it's works.

After successful build I'm trying to run from cli and i get an error:

Tue Sep 13 15:56:24 2022 PLUGIN_INIT: could not load plugin shared object /usr/local/lib/openvpn/plugins/openvpn-plugin-python-proxy.so: /usr/local/lib/openvpn/plugins/openvpn-plugin-python-proxy.so: undefined symbol: PyList_New
Tue Sep 13 15:56:24 2022 Exiting due to fatal error

@lytboris can you help me with this?

tuchinsky avatar Sep 13 '22 12:09 tuchinsky