From 7e76b127cd36d0310fdf98afd66e1999b4fc0d35 Mon Sep 17 00:00:00 2001 From: Florian Baumann Date: Thu, 8 Feb 2018 22:46:06 +0100 Subject: [PATCH] Multiple users with hashedPassword is broken in mosquitto If you have more than 1 User with hasedPassword Option set it generates ``` rm -f /var/lib/mosquitto/passwd touch /var/lib/mosquitto/passwd echo 'user1:$6$xxx' > /var/lib/mosquitto/passwd echo 'user2:$6$xxx' > /var/lib/mosquitto/passwd ``` Which ends up in only having 1 user. --- nixos/modules/services/networking/mosquitto.nix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/nixos/modules/services/networking/mosquitto.nix b/nixos/modules/services/networking/mosquitto.nix index 273ca797b98d..d8135f4d0ffa 100644 --- a/nixos/modules/services/networking/mosquitto.nix +++ b/nixos/modules/services/networking/mosquitto.nix @@ -212,7 +212,7 @@ in '' + concatStringsSep "\n" ( mapAttrsToList (n: c: if c.hashedPassword != null then - "echo '${n}:${c.hashedPassword}' > ${cfg.dataDir}/passwd" + "echo '${n}:${c.hashedPassword}' >> ${cfg.dataDir}/passwd" else optionalString (c.password != null) "${pkgs.mosquitto}/bin/mosquitto_passwd -b ${cfg.dataDir}/passwd ${n} ${c.password}" ) cfg.users);