From db3f3df89acc33740af35b4860b23aebce6aff62 Mon Sep 17 00:00:00 2001 From: Guilhem Moulin Date: Wed, 28 Oct 2015 18:42:15 +0100 Subject: genkeypair: use install(1) for atomic file creation with permission mode. --- roles/common/files/usr/local/bin/gendhparam.sh | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) (limited to 'roles/common/files/usr/local/bin/gendhparam.sh') 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" -- cgit v1.2.3