Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

mosquitto_passwd -b is using username as password #1949

Closed
jado opened this issue Dec 13, 2020 · 3 comments
Closed

mosquitto_passwd -b is using username as password #1949

jado opened this issue Dec 13, 2020 · 3 comments
Milestone

Comments

@jado
Copy link

jado commented Dec 13, 2020

I am reinstalling my mqtt broker using 2.0.2, and the ansible role creates the passwd file using a loop with:

mosquitto_passwd -b /etc/mosquitto/passwd  user1  password1

None of the users could connect.
I confirmed on the command line that mosquitto_passwd is using the username as password.

I could connect using

username: user1
password: password1
@jado
Copy link
Author

jado commented Dec 13, 2020

the error seems to be in mosquitto/apps/mosquitto_passwd/mosquitto_passwd.c

line 505

	}else if(batch_mode == true && idx+3 == argc){
		password_file_tmp = argv[idx];
		username = argv[idx+1];
		password_cmd = argv[idx+1];

should be

	}else if(batch_mode == true && idx+3 == argc){
		password_file_tmp = argv[idx];
		username = argv[idx+1];
		password_cmd = argv[idx+2];  <<<<--- change here

@ralight
Copy link
Contributor

ralight commented Dec 13, 2020

Thanks very much, I agree with your suggestion. That is now fixed and will be in 2.0.3.

@ralight ralight closed this as completed Dec 13, 2020
ralight added a commit that referenced this issue Dec 13, 2020
Only applies if if `-c` is not also used.

Closes #1949. Thanks to J. Augusto de Oliveira.
@ralight ralight added this to the 2.0.3 milestone Dec 13, 2020
@jado
Copy link
Author

jado commented Dec 13, 2020

Great. Glad to help.

fAuernigg pushed a commit to fAuernigg/mosquitto that referenced this issue Jan 4, 2021
Only applies if if `-c` is not also used.

Closes eclipse#1949. Thanks to J. Augusto de Oliveira.
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Aug 11, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants