mosquitto_pyauth
mosquitto_pyauth copied to clipboard
Dont compile with mosquitto 1.6.3
make:
cc -std=gnu99 -fPIC -I../lib -I../src python3.6-config --includes
-Wall -Wextra -O2 -I.//src/ -I.//lib/ -c -o auth_plugin_pyauth.o auth_plugin_pyauth.c
auth_plugin_pyauth.c:303:5: error: conflicting types for ‘mosquitto_auth_acl_check’
int mosquitto_auth_acl_check(void *user_data, int access, const struct mosquitto *client, const struct mosquitto_acl_msg *msg)
^~~~~~~~~~~~~~~~~~~~~~~~
In file included from auth_plugin_pyauth.c:8:0:
/usr/local/include/mosquitto_plugin.h:237:5: note: previous declaration of ‘mosquitto_auth_acl_check’ was here
int mosquitto_auth_acl_check(void *user_data, int access, struct mosquitto *client, const struct mosquitto_acl_msg *msg);
^~~~~~~~~~~~~~~~~~~~~~~~
auth_plugin_pyauth.c:330:5: error: conflicting types for ‘mosquitto_auth_unpwd_check’
int mosquitto_auth_unpwd_check(void *user_data, const struct mosquitto *client unused, const char *username, const char *password)
^~~~~~~~~~~~~~~~~~~~~~~~~~
In file included from auth_plugin_pyauth.c:8:0:
/usr/local/include/mosquitto_plugin.h:254:5: note: previous declaration of ‘mosquitto_auth_unpwd_check’ was here
int mosquitto_auth_unpwd_check(void *user_data, struct mosquitto *client, const char *username, const char *password);
^~~~~~~~~~~~~~~~~~~~~~~~~~
auth_plugin_pyauth.c:354:5: error: conflicting types for ‘mosquitto_auth_psk_key_get’
int mosquitto_auth_psk_key_get(void *user_data,
^~~~~~~~~~~~~~~~~~~~~~~~~~
In file included from auth_plugin_pyauth.c:8:0:
/usr/local/include/mosquitto_plugin.h:282:5: note: previous declaration of ‘mosquitto_auth_psk_key_get’ was here
int mosquitto_auth_psk_key_get(void *user_data, struct mosquitto *client, const char *hint, const char *identity, char *key, int max_key_len);
^~~~~~~~~~~~~~~~~~~~~~~~~~
Makefile:26: recipe for target 'auth_plugin_pyauth.o' failed
make: *** [auth_plugin_pyauth.o] Error 1
I was able to make things compile by modifying auth_plugin_pyauth.c
. At least on my test system which was an Ubuntu 18.04 system the following small changes allowed it to compile:
https://github.com/amimoto/mosquitto_pyauth/commit/7802491379e3f4fdca01b5b07c11d72dcf4f75f6
Not sure why the const
was dropped but I just wanted to test the code out. Perhaps this will help someone else out.
The attached patch auth_mqtt.txt has allowed me to compile and use the pyauth with mosquitto 2.014 on Ubuntu 20.04 and python3.8.