diff options
author | Ermal Luçi <eri@pfsense.org> | 2009-07-01 18:08:40 +0000 |
---|---|---|
committer | Ermal Luçi <eri@pfsense.org> | 2009-07-01 18:08:40 +0000 |
commit | 06e28ceb7e13b102984b2b8d04b060b4a635877c (patch) | |
tree | 58324b12d063067c94cf835e12bcac3f2e780dfb | |
parent | 24e3d98679e16396efe864aa6b15d3d981ec9a47 (diff) | |
download | pfsense-06e28ceb7e13b102984b2b8d04b060b4a635877c.zip pfsense-06e28ceb7e13b102984b2b8d04b060b4a635877c.tar.gz |
Convert even ssh key gen to the new subsystem_dirty calls.
-rw-r--r-- | etc/inc/config.inc | 2 | ||||
-rwxr-xr-x | etc/sshd | 14 |
2 files changed, 6 insertions, 10 deletions
diff --git a/etc/inc/config.inc b/etc/inc/config.inc index 9fc50f4..2f8c8a2 100644 --- a/etc/inc/config.inc +++ b/etc/inc/config.inc @@ -487,7 +487,7 @@ function conf_mount_ro() { return; /* do not umount if generating ssh keys */ - if(file_exists("/tmp/keys_generating")) + if (is_subsystem_dirty('sshdkeys')) return; /* do not umount on cdrom or pfSense platforms */ @@ -28,9 +28,7 @@ ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ - require_once("globals.inc"); require_once("config.inc"); - require_once("notices.inc"); if(isset($config['system']['enablesshd'])) { /* do nothing, we're enabled */ @@ -145,23 +143,21 @@ } /* are we already running? if so exit */ - if(file_exists("/tmp/keys_generating")) { + if(is_subsystem_dirty('sshdkeys')) { conf_mount_ro(); exit; } - if (!file_exists("$sshConfigDir/ssh_host_key") or file_exists("/etc/keys_generating")) { + if (!file_exists("$sshConfigDir/ssh_host_key")) { /* remove previous keys and regen later */ file_notice("SSH", "{$g['product_name']} has started creating your SSH keys. SSH Startup will be delayed. Please note that reloading the filter rules and changes will be delayed until this operation is completed.", "SSH KeyGen", ""); mwexec("rm /etc/ssh/ssh_host_*"); - touch("/etc/keys_generating"); - touch("/tmp/keys_generating"); + mark_subsystem_dirty('sshdkeys'); echo " Generating Keys:\n"; system("/usr/bin/nice -n20 /usr/bin/ssh-keygen -t rsa1 -N '' -f $sshConfigDir/ssh_host_key"); system("/usr/bin/nice -n20 /usr/bin/ssh-keygen -t rsa -N '' -f $sshConfigDir/ssh_host_rsa_key"); system("/usr/bin/nice -n20 /usr/bin/ssh-keygen -t dsa -N '' -f $sshConfigDir/ssh_host_dsa_key"); - unlink("/etc/keys_generating"); - unlink("/tmp/keys_generating"); + clear_subsystem_dirty('sshdkeys'); file_notice("SSH", "{$g['product_name']} has completed creating your SSH keys. SSH is now started.", "SSH Startup", ""); echo "Starting SSH... "; } @@ -189,4 +185,4 @@ } conf_mount_ro(); -?>
\ No newline at end of file +?> |