1. I will start with a very small typo bug for Debian flavors. In webmin/webmin-lib.pl "get_install_type" subroutine should set deb mode for "/usr/shared/webmin" which is mistyped as "/usr/shard/webmin"
2. The main problem that I am actually reporting, is the upgrade process that runs on Gentoo. As a prerequisite the installation on Gentoo sets the /usr/libexec/webmin/install-type to "gentoo" (BTW I am the Webmin's ebuild maintainer in Gentoo).
a) The problem is that Gentoo's preferred way to install things is using the portage or overlays. Any commands like "emerge --pretend /tmp/.webmin/webmin-upgrade-file.ebuild" or "emerge --pretend /tmp/.webmin/webmin-upgrade-file.tar.gz" (as set in line 385 and 407 in webmin/upgrade.cgi code) etc will fail. So interface options like "from local/uploaded file or http/ftp url" are not valid and will fail using the current subroutines. So the only valid option would be "Latest version from Emerge repository"
b) Having in mind the previous situation, checking the signature is done inside the ebuild itself, so the check in webmin/upgrade.cgi line 132 is unnecessary + its option is already hidden in the interface.
c) When the upgrade is done through "Webmin Configuration->Webmin Upgrade->Upgrade Webmin button" everything goes well with the exception that at the end of the emerge/install process "Webmin" is stopped as service and not restarted (this is part of the emerge process/gentoo install script itself). So the upgrade in the subroutines should end up with something like "$config_dir/start" (i.e /etc/webmin/start), so we can get back to a running Webmin again.
d) When the update is done through cron or the notifications on the "System info" page the whole part of the subroutine "get_webmin_notifications" after line 1150 calling the webmin/upgrade.cgi with the $source=2 does the things wrongly, downloading first the tar.gz, and then checking it against emerge and fail (see a)
Since I am not familiar with the Webmin's code in detail, and I do not want to propose patches fixing the problem partially, could you please look at this problem so we can find a solution?