Skip to content

Commit

Permalink
porting to mosquitto 1.6 and configuration for RMAP
Browse files Browse the repository at this point in the history
  • Loading branch information
pat1 committed Dec 20, 2019
1 parent 34c1ab0 commit 7aa1c26
Show file tree
Hide file tree
Showing 3 changed files with 37 additions and 4 deletions.
1 change: 0 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -6,5 +6,4 @@ np
jp*.conf
Makefile
*.a
config.mk
sundry
8 changes: 5 additions & 3 deletions auth-plug.c
Original file line number Diff line number Diff line change
Expand Up @@ -499,7 +499,7 @@ int mosquitto_auth_security_cleanup(void *userdata, struct mosquitto_auth_opt *a


#if MOSQ_AUTH_PLUGIN_VERSION >=3
int mosquitto_auth_unpwd_check(void *userdata, const struct mosquitto *client, const char *username, const char *password)
int mosquitto_auth_unpwd_check(void *userdata, struct mosquitto *client, const char *username, const char *password)
#else
int mosquitto_auth_unpwd_check(void *userdata, const char *username, const char *password)
#endif
Expand Down Expand Up @@ -598,7 +598,7 @@ int mosquitto_auth_unpwd_check(void *userdata, const char *username, const char
}

#if MOSQ_AUTH_PLUGIN_VERSION >= 3
int mosquitto_auth_acl_check(void *userdata, int access, const struct mosquitto *client, const struct mosquitto_acl_msg *msg)
int mosquitto_auth_acl_check(void *userdata, int access, struct mosquitto *client, const struct mosquitto_acl_msg *msg)
#else
int mosquitto_auth_acl_check(void *userdata, const char *clientid, const char *username, const char *topic, int access)
#endif
Expand Down Expand Up @@ -642,6 +642,7 @@ int mosquitto_auth_acl_check(void *userdata, const char *clientid, const char *u
* id to bypass ACL checks (or have a username/client id that cannot
* publish or receive messages to its own place in the hierarchy).
*/
/*
if(username && strpbrk(username, "+#/")){
_log(MOSQ_LOG_NOTICE, "ACL denying access to client with dangerous username \"%s\"", username);
return MOSQ_DENY_ACL;
Expand All @@ -651,6 +652,7 @@ int mosquitto_auth_acl_check(void *userdata, const char *clientid, const char *u
_log(MOSQ_LOG_NOTICE, "ACL denying access to client with dangerous client id \"%s\"", clientid);
return MOSQ_DENY_ACL;
}
*/

_log(LOG_DEBUG, "mosquitto_auth_acl_check(..., %s, %s, %s, %s)",
clientid ? clientid : "NULL",
Expand Down Expand Up @@ -749,7 +751,7 @@ int mosquitto_auth_acl_check(void *userdata, const char *clientid, const char *u


#if MOSQ_AUTH_PLUGIN_VERSION >= 3
int mosquitto_auth_psk_key_get(void *userdata, const struct mosquitto *client, const char *hint, const char *identity, char *key, int max_key_len)
int mosquitto_auth_psk_key_get(void *userdata, struct mosquitto *client, const char *hint, const char *identity, char *key, int max_key_len)
#else
int mosquitto_auth_psk_key_get(void *userdata, const char *hint, const char *identity, char *key, int max_key_len)
#endif
Expand Down
32 changes: 32 additions & 0 deletions config.mk
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
# Select your backends from this list
BACKEND_CDB ?= no
BACKEND_MYSQL ?= no
BACKEND_SQLITE ?= no
BACKEND_REDIS ?= no
BACKEND_POSTGRES ?= no
BACKEND_LDAP ?= no
BACKEND_HTTP ?= yes
BACKEND_JWT ?= no
BACKEND_MONGO ?= no
BACKEND_FILES ?= no
BACKEND_MEMCACHED ?= no

# Specify the path to the Mosquitto sources here
# MOSQUITTO_SRC = /usr/local/Cellar/mosquitto/1.4.12
MOSQUITTO_SRC =

# Specify the path the OpenSSL here
OPENSSLDIR = /usr

# Add support for django hashers algorithm name
SUPPORT_DJANGO_HASHERS ?= no

# Specify optional/additional linker/compiler flags here
# On macOS, add
# CFG_LDFLAGS = -undefined dynamic_lookup
# as described in https://github.com/eclipse/mosquitto/issues/244
#
# CFG_LDFLAGS = -undefined dynamic_lookup -L/usr/local/Cellar/openssl/1.0.2l/lib
# CFG_CFLAGS = -I/usr/local/Cellar/openssl/1.0.2l/include -I/usr/local/Cellar/mosquitto/1.4.12/include
CFG_LDFLAGS =
CFG_CFLAGS =

0 comments on commit 7aa1c26

Please sign in to comment.