Endless loop in foreign_require

The “vsftpd-webmin” module from 2009 triggers an endless loop when you do:

foreign_require(“vsftpd”)

This is problematic because webmin’s own config-lib.pl does this before attempting to parse the config file when saving the module configuration. (around line 280)

I think the module tries to do something fancy with internal modularization that it shouldn’t. I’m not the original author but I’ve been working on bringing it up to date, and it works fine now apart from the above issue.

This is the code that I’m working in GitHub - rdmark/vsftpd-webmin: vsftpd Webmin Module - forked from SourceForge

My first question to the community is: Where exactly is foreign_require implemented? I haven’t been able to find it, since there are nearly 1000 references to it in the codebase on github. If I can see how it’s implemented it will help me understand what part of vsftpd triggers this.

Thanks in advance!

Responding to myself: I figured out what triggered the endless loop. “ReadParse” was called in the core library (vsftpd-lib.pl) instead of in each relevant cgi script.

The commit referenced here did the trick: Module configuration form cannot be saved · Issue #1 · rdmark/vsftpd-webmin · GitHub

As a side note: It would be super handy if the Webmin API threw an error in this scenario instead of getting stuck in an endless loop!

1 Like

glad to hear you fixed it.

I myself switched some time ago to ProFtpD – have you ever considered that as a replacement to vsftpd ?

Good question! I chose vsftpd because it’s more light-weight, as well as straight forward to set up an insecure FTP server.

My primary usecase is running the server on a low powered device such as an RPi Zero, together with the SCSI emulator software PiSCSI and other file sharing services. The FTP server is serving very old retro computers, hence the insecure setup.

Anyhow, the research I did a few months ago suggested that vsftpd is the better choice over proftpd for this particular scenario. Please correct me if I got the wrong impression. :slight_smile:

This topic was automatically closed 120 days after the last reply. New replies are no longer allowed.