User error triggers Virtualmin bug

1 post / 0 new
#1 Fri, 01/29/2016 - 21:31
joe443

User error triggers Virtualmin bug

I had a proftpd configuration file /etc/proftpd.conf in which I absent-mindedly deleted a line at the end. So it ended up like this at the end:

<IfModule mod_sftp.c>
  other lines
  SFTPEngine on
  other lines

As you can see, the closing

</IfModule>

is missing. This is syntactically invalid, but Proftpd did not report any error. Perhaps it assumed that end-of-file closes the IfModule section.

Virtualmin GPL did not report any error either. It added a virtual server, and it also added an IP-based virtualhost into /etc/proftpd.conf. So now the file looked like this:

<IfModule mod_sftp.c>
  other lines
  SFTPEngine on
  other lines
<VirtualHost 198.51.100.2>
  other lines
</VirtualHost>

But when I deleted the virtual server, Virtualmin deleted all traces of it except for the virtualhost entry in proftp.conf, which it left untouched. As I created and deleted virtual servers while testing Virtualmin GPL, it kept adding virtualhost entries into proftp.conf but never deleting any. Finally I ended up with a dozen virtualhost entries in proftp.conf even though I had deleted all the virtual servers.

I think this is a bug. Virtualmin should either refuse to add a virtualhost entry into a syntactically-invalid file or, having added one, should be able to remove it too.