How to tweak Samba on ASUSWRT with both public and protected folders

ASUSWRT does a decent job at providing Samba shares to the Windows clients on the network and this will work in most cases. However, if you need to mix password protected with public (open) folders, the firmware cannot handle this scenario.

Fortunately, Asus made a decent job at making the firmware customizable enough that this functionality can be enabled with a bit of custom tweaking.