Skip to content

Commit

Permalink
Multiple users with hashedPassword is broken in mosquitto
Browse files Browse the repository at this point in the history
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.

fixes #34804

(cherry picked from commit 7e76b12)
  • Loading branch information
noqqe authored and Mic92 committed Feb 10, 2018
1 parent 59890bb commit b1cbce8
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion nixos/modules/services/networking/mosquitto.nix
Expand Up @@ -198,7 +198,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);
Expand Down

0 comments on commit b1cbce8

Please sign in to comment.