GithubHelp home page GithubHelp logo

mbachry / mosquitto_pyauth Goto Github PK

View Code? Open in Web Editor NEW
63.0 9.0 33.0 24 KB

Mosquitto auth plugin that lets you write your auth plugins in Python!

License: MIT License

C 80.88% Python 13.58% Makefile 5.55%

mosquitto_pyauth's Introduction

mosquitto_pyauth

Mosquitto auth plugin that lets you write your auth plugins in Python.

Compiling

You need mosquitto version 1.5.1 or higher.

Make sure you have Python dev package installed (apt-get install python-dev or apt-get install python3-dev under Debian/Ubuntu).

You must either have mosquitto header files installed globally in /usr/include, etc. or clone this repository at the top of the mosquitto source directory. Then:

cd mosquitto_pyauth
make USE_CARES=1

Remove USE_CARES if c-ares library isn't installed in your system.

Alternatively you can pass full path to mosquitto sources using MOSQUITTO_SRC variable:

make MOSQUITTO_SRC=/path/to/mosquitto-src

Pass PYTHON_VERSION variable to compile with other other Python version than default (3.6):

make PYTHON_VERSION=2.7

If all goes ok, there should be auth_plugin_pyauth.so file in the current directory. Copy it under path accessible for mosquitto daemon, e.g.: /usr/local/lib/mosquitto/.

Troubleshooting

If you get errors while compiling the plugin about -lmosquitto then you have a missing link to libmosquitto. Just check the file /usr/lib/libmosquitto.so or /usr/lib/mosquitto.so.1 exists and create a symlink:

ln -s /usr/lib/libmosquitto.so.1 /usr/lib/libmosquitto.so

And make again the plugin. This time it should work.

Running

Add following line to mosquitto.conf:

auth_plugin /path/to/auth_plugin_pyauth.so

You must also give a pointer to Python module which is going to be loaded (make sure it's in Python path, use PYTHONPATH env variable to the rescue):

auth_opt_pyauth_module some_module

Python module

Python module should do required initializations when it's imported and provide following global functions:

  • plugin_init(opts): called on plugin init, opts holds a tuple of (key, value) 2-tuples with all auth_opt_ params from mosquitto configuration (except auth_opt_pyauth_module)

  • plugin_cleanup(): called on plugin cleanup with no arguments

  • unpwd_check(username, password): return True if given username and password pair is allowed to log in

  • acl_check(client_id, username, topic, access, payload): return True if given user is allowed to subscribe (access = mosquitto_auth.MOSQ_ACL_SUBSCRIBE), read (access = mosquitto_auth.MOSQ_ACL_READ) or publish (access = mosquitto_auth.MOSQ_ACL_WRITE) to given topic (see mosquitto_auth module below). payload argument holds message payload as bytes, or None if not applicable.

  • psk_key_get(identity, hint): return PSK string (in hex format without heading 0x) if given identity and hint pair is allowed to connect else return False or None

  • security_init(opts, reload): called on plugin init and on config reload

  • security_cleanup(reload): called on plugin cleanup and on config reload

Auxiliary module

Authentication module can import an auxiliary module provided by mosquitto:

import mosquitto_auth

The module provides following function:

  • topic_matches_sub(sub, topic): it mirrors mosquitto_topic_matches_sub from libmosquitto C library - the function checks whether topic matches given sub pattern (for example, it returns True if sub is /foo/# and topic is /foo/bar) and is mostly useful is acl_check function above
  • log(loglevel, message): log message into mosquitto's log file with the given loglevel (one of the constants below).

The following constants for access parameter in acl_check are provided:

  • MOSQ_ACL_NONE
  • MOSQ_ACL_SUBSCRIBE
  • MOSQ_ACL_READ
  • MOSQ_ACL_WRITE

The following constants for loglevel parameter in log are provided:

  • LOG_INFO
  • LOG_NOTICE
  • LOG_WARNING
  • LOG_ERR
  • LOG_DEBUG
  • LOG_SUBSCRIBE (not recommended for use by plugins)
  • LOG_UNSUBSCRIBE (not recommended for use by plugins)

mosquitto_pyauth's People

Contributors

dereknex avatar imzack avatar mbachry avatar ndorigatti avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

mosquitto_pyauth's Issues

How to use with python3

I have written a module in python3. I can see the plugin can import from only from python 2 folder. I have trouble setting the python path. Any help will be appreciated.

Python no longer uses libpython<ver>.so, how to link it when compiling auth_plugin_pyauth.c

Compiling mosquitto pyauth

$ cc -std=gnu99 -fPIC -I../lib -I../src -I/usr/include/python3.8 -Wall -Wextra -O2 -I/home/ubuntu/mosquitto_pyauth/mosquitto-2.0.7/src/ -I/home/ubuntu/mosquitto_pyauth/mosquitto-2.0.7/lib/ -shared -o auth_plugin_pyauth.so auth_plugin_pyauth.o -lcrypt -lpthread -ldl -lutil -lm -lm -lmosquitto -L/home/ubuntu/mosquitto_pyauth/mosquitto-2.0.7/lib

Checking shared object dependencies ( libpython3.8.so does not get mentioned here)

$ ldd auth_plugin_pyauth.so
linux-vdso.so.1 (0x00007ffe6d6f0000)
libmosquitto.so.1 => /lib/x86_64-linux-gnu/libmosquitto.so.1 (0x00007fb1162a4000)
libc.so.6 => /lib/x86_64-linux-gnu/libc.so.6 (0x00007fb1160b2000)
libssl.so.1.1 => /lib/x86_64-linux-gnu/libssl.so.1.1 (0x00007fb11601f000)
libcrypto.so.1.1 => /lib/x86_64-linux-gnu/libcrypto.so.1.1 (0x00007fb115d49000)
libpthread.so.0 => /lib/x86_64-linux-gnu/libpthread.so.0 (0x00007fb115d26000)
/lib64/ld-linux-x86-64.so.2 (0x00007fb1162d0000)
libdl.so.2 => /lib/x86_64-linux-gnu/libdl.so.2 (0x00007fb115d20000)

Running the mosquitto mqtt with above compiled plugin (auth_plugin_pyauth.so)

$ mosquitto -c /etc/mosquitto/mosquitto.conf

1614668880: Loading config file /etc/mosquitto/conf.d/default.conf
1614668880: Error: Unable to open log file /var/log/mosquitto/mosquitto.log for writing.
1614668880: Error: Unable to load auth plugin "/var/tmp/auth_plugin_pyauth.so".
1614668880: Load error: /var/tmp/auth_plugin_pyauth.so: undefined symbol: _Py_NoneStruct

If I include libpython3.8.so via LD_PRELOAD variable, mosquitto works with the plugin

$ LD_PRELOAD=/usr/lib/x86_64-linux-gnu/libpython3.8.so mosquitto -c /etc/mosquitto/mosquitto.conf

1614668910: Loading config file /etc/mosquitto/conf.d/default.conf
1614668910: Error: Unable to open log file /var/log/mosquitto/mosquitto.log for writing.
ModuleNotFoundError: No module named 'redis_auth'
failed to import module: redis_auth

Requirement:

I need to include libpython3.8.so as shared object depenencies for auth_plugin_pyauth.so.
So that, I can directly call $ mosquito -c /etc/mosquitto/mosquitto.conf (without LD_PRELOAD variable)

ModuleNotFoundError

I am trying to start mosquitto 1.6.2 using the mosquitto.conf where I put

auth_plugin  /usr/local/lib/mosquitto/auth_plugin_pyauth.so
auth_opt_pyauth_module testauth.py 

I keep getting the ModuleNotFoundError no matter where I put the testauth.py file.

1557196428: mosquitto version 1.6.2 starting 
1557196428: Config loaded from mqtt/mosquitto/mosquitto.conf. 
1557196428: Loading plugin: /usr/local/lib/mosquitto/auth_plugin_pyauth.so
1557196428:  ├── Username/password checking enabled.                                             
1557196428:  ├── TLS-PSK checking not enabled.                                                   
1557196428:  └── Extended authentication not enabled.                                            ModuleNotFoundError: No module named 'testauth'                                                  
failed to import module: testauth.py 

I am running out of ideas on what to try next. Any ideas?

Load error: libmosquitto.so.1:

Error: Unable to load auth plugin "/usr/lib/auth_plugin_pyauth.so".
1459278711: Load error: libmosquitto.so.1: cannot open shared object file: No such file or directory

Problem when compiling and loading on Alpine with Mosquitto 1.5.5

I'm trying to use this plugin in an Alpine Docker image but I'm having a problem where I'm getting the message mosquitto_log_printf: symbol not found

/usr/lib # mosquitto -c /mosquitto/config/mosquitto.conf
1547298826: mosquitto version 1.5.5 starting
1547298826: Config loaded from /mosquitto/config/mosquitto.conf.
1547298826: Error: Unable to load auth plugin "/usr/lib/auth_plugin_pyauth.so".
1547298826: Load error: Error relocating /usr/lib/auth_plugin_pyauth.so: mosquitto_log_printf: symbol not found

Here is some further info about the compiled plugin.

/usr/lib # ldd auth_plugin_pyauth.so
ldd (0x7f7476986000)
libpython2.7.so.1.0 => /usr/lib/libpython2.7.so.1.0 (0x7f74763de000)
libmosquitto.so.1 => /usr/lib/libmosquitto.so.1 (0x7f74761cf000)
libc.musl-x86_64.so.1 => ldd (0x7f7476986000)
libssl.so.45 => /lib/libssl.so.45 (0x7f7475f83000)
libcrypto.so.43 => /lib/libcrypto.so.43 (0x7f7475bd8000)
Error relocating auth_plugin_pyauth.so: mosquitto_log_printf: symbol not found
Error relocating auth_plugin_pyauth.so: mosquitto_client_username: symbol not found
Error relocating auth_plugin_pyauth.so: mosquitto_client_id: symbol not found
/usr/lib #

What could be causing this, and how can I resolve this issue?

I'm compiling it during Docker build, right after compiling Mosquitto. It's only those three symbols which are not found, I would have expected all of the mosquitto_* symbols not getting found, but not just a couple of them.

Error: Unable to load auth plugin "/var/lib/mosquitto/auth_plugin_pyauth.so".

OS: RHEL 7

  1. I downloaded the source code for mosquitto-1.3.5, compiled it and installed it.
  2. I unzipped the master.zip in the root of mosquitto-1.3.5 source and compiled it.
  3. Copied the auth_plugin_pyauth.so to /var/lib/mosquitto/
  4. My mosquitto.conf file is as under
    auth_plugin /var/lib/mosquitto/auth_plugin_pyauth.so
    auth_opt_pyauth_module ldap_module
    pid_file /var/run/mosquitto.pid
    persistence true
    persistence_location /var/lib/mosquitto/
    log_dest file /var/log/mosquitto/mosquitto.log
    include_dir /etc/mosquitto/conf.d
  5. When I run 'mosquitto -c /etc/mosquitto/mosquitto.conf', I get the following log message:
    1413263463: mosquitto version 1.3.5 (build date 2014-10-14 01:01:00-0400) starting
    1413263463: Config loaded from /etc/mosquitto/mosquitto.conf.
    1413263463: Error: Unable to load auth plugin "/var/lib/mosquitto/auth_plugin_pyauth.so".

Crashes when trying to daemonize

This works:

(mypy) root@ubuntu:/mypy# export PYTHONPATH=/mypy; /usr/sbin/mosquitto -c /etc/mosquitto/mosquitto.conf
redis initialized 127.0.0.1 6379

AUTH: user=admin, password matches = True
ACL: user=admin topic=mypy/d256cc9e/ping, matches = True

(mypy) root@ubuntu:/mypy# mosquitto_pub -t 'admin/d256cc9e/ping' -m 'ack' -u 'admin' -P 'password' -I 'd256cc9e' -h mqtt01 -p 8883 --cafile /mypy/certs/ca.crt
(mypy) root@ubuntu:/mypy#
(mypy) root@ubuntu:/mypy# mosquitto_sub -t 'admin/d256cc9e/ping' -u 'admin' -P 'password' -I 'd256cc9e' -h mqtt01 -p 8883 --cafile /mypy/certs/ca.crt

ack

However, running from /etc/init.d fails, and yes I did add the PYTHONPATH variable. NO log error messages, despite every log_type enabled in mosquitto.conf. And mosquitto works without the plugin.

I am on Ubuntu 17.10 and I downloaded the latest mosquitto_pyauth code from github last night. The make options were USE_CARES=1 PYTHON_VERSION=3.6. I am using the example redis_auth.py. Mosquitto version 1.4.12.

(mypy) root@ubuntu:/mypy# grep -C5 PYTHONPATH /etc/init.d/mosquitto
run_by_init() {
    ([ "$previous" ] && [ "$runlevel" ]) || [ "$runlevel" = S ]
}

export PATH="${PATH:+$PATH:}/usr/sbin:/sbin"
export PYTHONPATH="${PYTHONPATH}:/mypy"

case "$1" in
  start)
        if init_is_upstart; then
            exit 1
(mypy) root@ubuntu:/mypy# /etc/init.d/mosquitto restart
Restarting mosquitto (via systemctl): mosquitto.service.
(mypy) root@ubuntu:/mypy# ps -ef | grep -i mosq
root     12679 12669  0 02:26 pts/3    00:00:06 tail -f /var/log/mosquitto/mosquitto.log
root     28560 24666  1 10:13 pts/8    00:00:00 vi /etc/init.d/mosquitto
mosquit+ 28641     1  2 10:13 ?        00:00:00 /usr/sbin/mosquitto -c /etc/mosquitto/mosquitto.conf
root     28646 24653  0 10:13 pts/7    00:00:00 grep --color=auto -i mosq
(mypy) root@ubuntu:/mypy# mv /etc/mosquitto/conf.d/pyauth.conf.disabled /etc/mosquitto/conf.d/pyauth.conf
(mypy) root@ubuntu:/mypy# /etc/init.d/mosquitto restart                                                Restarting mosquitto (via systemctl): mosquitto.service.
(mypy) root@ubuntu:/mypy# ps -ef | grep -i mosq                                                        root     12679 12669  0 02:27 pts/3    00:00:06 tail -f /var/log/mosquitto/mosquitto.log
root     28560 24666  0 10:13 pts/8    00:00:00 vi /etc/init.d/mosquitto
root     28687 24653  2 10:14 pts/7    00:00:00 grep --color=auto -i mosq
(mypy) root@ubuntu:/mypy# /etc/init.d/mosquitto restart
Restarting mosquitto (via systemctl): mosquitto.service.
(mypy) root@ubuntu:/mypy# ps -ef | grep -i mosq
root     28560 24666  0 10:13 pts/8    00:00:00 vi /etc/init.d/mosquitto
root     28693 12669  0 10:14 pts/3    00:00:00 tail -f /var/log/mosquitto/mosquitto.log
root     28735 24653  0 10:14 pts/7    00:00:00 grep --color=auto -i mosq
(mypy) root@ubuntu:/mypy# cat /etc/mosquitto/conf.d/pyauth.conf
auth_plugin /usr/lib/mosquitto_pyauth/auth_plugin_pyauth.so
auth_opt_pyauth_module redis_auth
(mypy) root@ubuntu:/mypy# tail /var/log/mosquitto/mosquitto.log
1524752004: New client connected from 10.0.2.2 as d256cc9e (c1, k60, u'admin').
1524752004: Sending CONNACK to d256cc9e (0, 0)
1524752004: Received PUBLISH from d256cc9e (d0, q1, r1, m601, 'admin/d256cc9e/user_op', ... (34 bytes))
1524752004: Sending PUBACK to d256cc9e (Mid: 601)
1524752046: Error in poll: Interrupted system call.
1524752046: mosquitto version 1.4.12 terminating
1524752047: mosquitto version 1.4.12 (build date Thu, 01 Mar 2018 09:24:46 -0500) starting
1524752047: Config loaded from /etc/mosquitto/mosquitto.conf.
1524752075: mosquitto version 1.4.12 (build date Thu, 01 Mar 2018 09:24:46 -0500) starting
1524752075: Config loaded from /etc/mosquitto/mosquitto.conf.
(mypy) root@ubuntu:/mypy# grep log /etc/mosquitto/mosquitto.conf
log_dest file /var/log/mosquitto/mosquitto.log
log_type all
log_type debug
log_type error
log_type warning
log_type notice
log_type information
log_type subscribe
log_type unsubscribe
log_type websockets
(mypy) root@ubuntu:/mypy#

Oddly, if I copy the init script into my current working directory, it works. So I don't see what's different about using the init script in /etc/init.d. Maybe some environment variable? Something about the interaction between systemd and this plugin?

(mypy) root@ubuntu:/mypy# ./mosquitto.init.d.sh start
 * Starting network daemon: mosquitto
   ...done.
(mypy) root@ubuntu:/mypy# ps -ef | grep -i mosq
root     28693 12669  0 10:32 pts/3    00:00:00 tail -f /var/log/mosquitto/mosquitto.log
root     28802 28771  0 10:46 pts/4    00:00:01 mosquitto_sub -t admin/d256cc9e/ping -u admin -P password -I d256cc9e -h mqtt01 -p 8883 --cafile /mypy/certs/ca.crt
root     29142 28785  1 11:00 pts/5    00:00:00 vim mosquitto.init.d.sh
mosquit+ 29180     1 32 11:01 ?        00:00:00 /usr/sbin/mosquitto -c /etc/mosquitto/mosquitto.conf
root     29183 24666  2 11:01 pts/8    00:00:00 grep --color=auto -i mosq
(mypy) root@ubuntu:/mypy#

Weird bug: can't publish/subscribe when username and topic are the same string

How to reproduce:

The auth python file should implement minimal unpwd_check and acl_check functions:

def unpwd_check(username, password):
    return True

def acl_check(client_id, username, topic, access, payload):
    return True

Then try to pub/sub. Shell1:
mosquitto_sub -h host-with-pyauth-plugin.com -p 8883 -t "foo" -u "foo" -P "" --capath "/etc/ssl/certs" -i "alice"

Shell2:
mosquitto_pub -h host-with-pyauth-plugin.com -p 8883 -t "foo" -u "foo" -P "" --capath "/etc/ssl/certs" -m "foobar" -i "bob"

Works fine if topic and username are different. If they're the same, the published message is acknowledged from perspective of publisher, but not received by subscriber.

Note when controlling for mosquitto_pyauth behaviour versus a plain installation of mosquitto 1.5.1 substitute host-with-pyauth-plugin.com with iot.eclipse.org. Use iot.eclipse.org server because test.mosquitto.org or other public mosquitto servers' ACLs reject connection attempts if a username is provided.

Unable to import the auth_opt_pyauth_module due to ModuleNotFoundError

I've installed mosquitto 1.5.1 from source, and built mosquitto_pyauth successfully. Can't load the python auth module though - here are the relevant lines of the mosquitto.conf file:

auth_plugin /opt/mosquitto/src/mosquitto_pyauth/auth_plugin_pyauth.so
auth_opt_pyauth_module /opt/mosquitto/src/mosquitto_pyauth/my_auth.py

The file's definitely there:

$ ls -l /opt/mosquitto/src/mosquitto_pyauth/my_auth.py
-rw------- 1 mosquitto mosquitto 1276 Sep  7 14:08 /opt/mosquitto/src/mosquitto_pyauth/my_auth.py

I'm running it using mosquitto -c mosquitto.conf, which gives:

1536330652: mosquitto version 1.5.1 starting
1536330652: Config loaded from mosquitto.conf.
ModuleNotFoundError: No module named '/opt/mosquitto/src/mosquitto_pyauth/my_auth'
failed to import module: /opt/mosquitto/src/mosquitto_pyauth/my_auth.py

I've done export PYTHONPATH=/opt/mosquitto/src/mosquitto_pyauth just to see if it makes a difference (shouldn't be needed with absolute paths, and it doesn't make a difference).

How is the python module supposed to be indicated to the auth plugin? Are the README instructions up to date?

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

local unauthenticated access

I'm trying to find a way to authenticate connections that come from the same machine in a different way than from remote connections. any idea if this is feasible?
thanks

THe Program doesn't compile

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!

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.