summaryrefslogtreecommitdiffstats
path: root/roles/common/files/usr/local/bin/gendhparam.sh
diff options
context:
space:
mode:
authorGuilhem Moulin <guilhem@fripost.org>2015-10-28 18:42:15 +0100
committerGuilhem Moulin <guilhem@fripost.org>2015-10-28 18:42:15 +0100
commitdb3f3df89acc33740af35b4860b23aebce6aff62 (patch)
treea4d121cd95ea208be1dffff4b41febbd3e13dadd /roles/common/files/usr/local/bin/gendhparam.sh
parent3ee71788fc14b245f46d85c14d7f9917227434bb (diff)
genkeypair: use install(1) for atomic file creation with permission mode.
Diffstat (limited to 'roles/common/files/usr/local/bin/gendhparam.sh')
-rwxr-xr-xroles/common/files/usr/local/bin/gendhparam.sh4
1 files changed, 1 insertions, 3 deletions
diff --git a/roles/common/files/usr/local/bin/gendhparam.sh b/roles/common/files/usr/local/bin/gendhparam.sh
index 074986b..84b7d56 100755
--- a/roles/common/files/usr/local/bin/gendhparam.sh
+++ b/roles/common/files/usr/local/bin/gendhparam.sh
@@ -7,7 +7,5 @@ privkey="$1"
bits="${2:-2048}"
rand=
-mv -f "$(mktemp)" "$privkey"
-chmod og-rwx "$privkey"
-
+install --mode=0600 /dev/null "$privkey"
openssl dhparam -rand "${rand:-/dev/urandom}" "$bits" >"$privkey"