Sign Up
Log In
Log In
or
Sign Up
Places
All Projects
Status Monitor
Collapse sidebar
SUSE:SLE-12-SP2:GA
google-startup-scripts.3436
regenhostkey_usetmpdir.diff
Overview
Repositories
Revisions
Requests
Users
Attributes
Meta
File regenhostkey_usetmpdir.diff of Package google-startup-scripts.3436
diff --git a/google-startup-scripts/usr/share/google/regenerate-host-keys b/google-startup-scripts/usr/share/google/regenerate-host-keys index bc6bf2d..fb9d7fd 100755 --- a/google-startup-scripts/usr/share/google/regenerate-host-keys +++ b/google-startup-scripts/usr/share/google/regenerate-host-keys @@ -37,7 +37,8 @@ sshd_cmd() { generate_key() { local key_type=$1 local key_dest=$2 - local tmp_file="/tmp/keyfile.$$"; + local tmp_dir=$(mktemp -d /tmp/keystore.XXXXXXXX) + local tmp_file="/${tmp_dir}/keyfile.$$"; local log_file=$(mktemp); log "Regenerating sshd key ${key_dest}" ssh-keygen -N '' -t ${key_type} -f ${tmp_file} > ${log_file} 2>&1 @@ -49,7 +50,7 @@ generate_key() { log "Could not create sshd key ${key_dest}" log "$(cat ${log_file})" fi - rm -f ${tmp_file} + rm -rf ${tmp_dir} rm -f ${log_file} }
Locations
Projects
Search
Status Monitor
Help
OpenBuildService.org
Documentation
API Documentation
Code of Conduct
Contact
Support
@OBShq
Terms
openSUSE Build Service is sponsored by
The Open Build Service is an
openSUSE project
.
Sign Up
Log In
Places
Places
All Projects
Status Monitor