PostgreSQL username wrongly escaped

Suddenly (don't knof if since Virtualmin 3.90 or some kind of Debian PostgreSQL update) Virtualmin wrongly creates the usernames on PostgreSQL. My username schema is the domain name, so usenames should be like "domain.tld". However, it now creates "domain\.tld" and the domain fails validation in Virtualmin. Also, it gets errors when trying to disable or enable PostgreSQL for the domain, since it tries to delete "domain\\.tld" which it can't find, and then tries to create "domain\.tld" which still exists cause it wasn't deleted.

Status: 
Closed (fixed)

Comments

Oh, btw I am also unable to delete the username from within the Webmin module. It tries to delete domain\\.tld instead of domain\.tld

This is a Virtualmin bug - it is doing un-necessary escaping for PostgreSQL users.

The fix (till the next release) is to edit /usr/share/webmin/virtual-server/feature-postgres.pl and change line 164 to :

return """.$str.""";

then run /etc/webmin/restart

Thanks, that fixed the username creation. However, I am still unable to delete the wrongly created user from the webmin module. When I select mydomain\.com and hit delete, I get the following error message: Failed to delete users : SQL drop user "mydomain\\.com" failed : ERROR: role "mydomain\\.com" does not exist so it looks like it's escaping there as well.

That will be fixed in the next Webmin release..

Automatically closed -- issue fixed for 2 weeks with no activity.