mbachry / mosquitto_pyauth

Mosquitto auth plugin that lets you write your auth plugins in Python!
MIT License
63 stars 33 forks source link

THe Program doesn't compile #15

Open mntolia opened 6 years ago

mntolia commented 6 years ago

Hi, I tried installing this plugin but the program doesn't compile. It throws this error:

make MOSQUITTO_SRC=/home/maxwell/Desktop/project/mosquitto
cc -std=gnu99 -fPIC -I../lib -I../src `python2.7-config --includes` -Wall -Wextra -O2 -I/home/maxwell/Desktop/project/mosquitto/src/ -I/home/maxwell/Desktop/project/mosquitto/lib/ -c -o auth_plugin_pyauth.o auth_plugin_pyauth.c
auth_plugin_pyauth.c: In function ‘pyauth_mosquitto_log_printf’:
auth_plugin_pyauth.c:80:5: warning: implicit declaration of function ‘mosquitto_log_printf’ [-Wimplicit-function-declaration]
     mosquitto_log_printf(loglevel, "%s", fmt);
     ^
auth_plugin_pyauth.c: At top level:
auth_plugin_pyauth.c:161:5: error: conflicting types for ‘mosquitto_auth_plugin_init’
 int mosquitto_auth_plugin_init(void **user_data, struct mosquitto_auth_opt *aut
     ^
In file included from auth_plugin_pyauth.c:8:0:
/home/maxwell/Desktop/project/mosquitto/src/mosquitto_plugin.h:118:5: note: previous declaration of ‘mosquitto_auth_plugin_init’ was here
 int mosquitto_auth_plugin_init(void **user_data, struct mosquitto_opt *opts, in
     ^
auth_plugin_pyauth.c:217:5: error: conflicting types for ‘mosquitto_auth_plugin_cleanup’
 int mosquitto_auth_plugin_cleanup(void *user_data, struct mosquitto_auth_opt *a
     ^
In file included from auth_plugin_pyauth.c:8:0:
/home/maxwell/Desktop/project/mosquitto/src/mosquitto_plugin.h:140:5: note: previous declaration of ‘mosquitto_auth_plugin_cleanup’ was here
 int mosquitto_auth_plugin_cleanup(void *user_data, struct mosquitto_opt *opts, 
     ^
auth_plugin_pyauth.c:242:5: error: conflicting types for ‘mosquitto_auth_security_init’
 int mosquitto_auth_security_init(void *user_data, struct mosquitto_auth_opt *au
     ^
In file included from auth_plugin_pyauth.c:8:0:
/home/maxwell/Desktop/project/mosquitto/src/mosquitto_plugin.h:168:5: note: previous declaration of ‘mosquitto_auth_security_init’ was here
 int mosquitto_auth_security_init(void *user_data, struct mosquitto_opt *opts, i
     ^
auth_plugin_pyauth.c:274:5: error: conflicting types for ‘mosquitto_auth_security_cleanup’
 int mosquitto_auth_security_cleanup(void *user_data, struct mosquitto_auth_opt 
     ^
In file included from auth_plugin_pyauth.c:8:0:
/home/maxwell/Desktop/project/mosquitto/src/mosquitto_plugin.h:196:5: note: previous declaration of ‘mosquitto_auth_security_cleanup’ was here
 int mosquitto_auth_security_cleanup(void *user_data, struct mosquitto_opt *opts
     ^
auth_plugin_pyauth.c:295:5: error: conflicting types for ‘mosquitto_auth_acl_check’
 int mosquitto_auth_acl_check(void *user_data, const char *clientid, const char 
     ^
In file included from auth_plugin_pyauth.c:8:0:
/home/maxwell/Desktop/project/mosquitto/src/mosquitto_plugin.h:223:5: note: previous declaration of ‘mosquitto_auth_acl_check’ was here
 int mosquitto_auth_acl_check(void *user_data, int access, const struct mosquitt
     ^
auth_plugin_pyauth.c:313:5: error: conflicting types for ‘mosquitto_auth_unpwd_check’
 int mosquitto_auth_unpwd_check(void *user_data, const char *username, const cha
     ^
In file included from auth_plugin_pyauth.c:8:0:
/home/maxwell/Desktop/project/mosquitto/src/mosquitto_plugin.h:237:5: note: previous declaration of ‘mosquitto_auth_unpwd_check’ was here
 int mosquitto_auth_unpwd_check(void *user_data, const struct mosquitto *client,
     ^

I am guessing that the abstract functions in mosquitto_plugin.h have different paramters compared to the ones you used.

Thanks for the making the plugin!

mbachry commented 6 years ago

Hi! Thanks for bug report. Looks like mosquitto version 1.5 has new plugin C API. I pushed a change which migrates pyauth plugin to the new API (and makes 1.5.1 minimal required version). Try again with current master branch and let me know if it helped.