From 45fa82098930dec666b0525482b5f2ed0af9d36f Mon Sep 17 00:00:00 2001 From: "Roger A. Light" Date: Sun, 13 Jul 2014 14:11:43 +0100 Subject: [PATCH] Anonymous clients are no longer accidently disconnected from the broker after a SIGHUP. --- ChangeLog.txt | 2 ++ src/security_default.c | 3 ++- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/ChangeLog.txt b/ChangeLog.txt index 172606a7..09ae8bcb 100644 --- a/ChangeLog.txt +++ b/ChangeLog.txt @@ -15,6 +15,8 @@ Broker: clients that connect without a username. - Fix subscriptions being deleted when clients subscribed to a topic beginning with a $ but that is not $SYS. +- Anonymous clients are no longer accidently disconnected from the broker + after a SIGHUP. Client library: - Fix topic matching edge case. diff --git a/src/security_default.c b/src/security_default.c index 04bc3c70..c5590f59 100644 --- a/src/security_default.c +++ b/src/security_default.c @@ -624,8 +624,9 @@ int mosquitto_unpwd_check_default(struct mosquitto_db *db, const char *username, int rc; #endif - if(!db || !username) return MOSQ_ERR_INVAL; + if(!db) return MOSQ_ERR_INVAL; if(!db->unpwd) return MOSQ_ERR_SUCCESS; + if(!username) return MOSQ_ERR_INVAL; /* Check must be made only after checking db->unpwd. */ HASH_ITER(hh, db->unpwd, u, tmp){ if(!strcmp(u->username, username)){