Kaynağa Gözat

Add option to disable secret key generation

tags/1.0
Timo Röhling 12 yıl önce
ebeveyn
işleme
74cfa490e1
2 değiştirilmiş dosya ile 4 ekleme ve 1 silme
  1. 2
    0
      CMakeLists.txt
  2. 2
    1
      postinstall.cmake.in

+ 2
- 0
CMakeLists.txt Dosyayı Görüntüle

@@ -1,6 +1,8 @@
1 1
 cmake_minimum_required(VERSION 2.8)
2 2
 project(postsrsd C)
3 3
 
4
+option(GENERATE_SRS_SECRET "Generate a random SRS secret if none exists during install" ON)
5
+
4 6
 find_program(HELP2MAN help2man DOC "path to help2man executable")
5 7
 find_program(DD dd DOC "path to dd executable")
6 8
 find_program(BASE64 base64 DOC "path to base64 executable")

+ 2
- 1
postinstall.cmake.in Dosyayı Görüntüle

@@ -1,3 +1,4 @@
1
+set(GENERATE_SRS_SECRET "@GENERATE_SRS_SECRET@")
1 2
 set(INIT_FLAVOR "@INIT_FLAVOR@")
2 3
 set(SECRET_FILE "@PROJECT_NAME@.secret")
3 4
 set(DD "@DD@")
@@ -19,7 +20,7 @@ elseif(INIT_FLAVOR STREQUAL "upstart")
19 20
 	file(INSTALL "@CMAKE_CURRENT_BINARY_DIR@/@PROJECT_NAME@.upstart" DESTINATION "/etc/init" RENAME "@PROJECT_NAME@.conf")
20 21
 endif()
21 22
 
22
-if(DD AND BASE64 AND EXISTS "/dev/urandom" AND NOT EXISTS "$ENV{DESTDIR}/etc/${SECRET_FILE}")
23
+if(GENERATE_SRS_SECRET AND DD AND BASE64 AND EXISTS "/dev/urandom" AND NOT EXISTS "$ENV{DESTDIR}/etc/${SECRET_FILE}")
23 24
 	message(STATUS "Generating secret key")
24 25
 	execute_process(
25 26
 		COMMAND ${DD} if=/dev/urandom bs=18 count=1

Loading…
İptal
Kaydet