fix postinst with new function
[bacula-cn.git] / debian / postinst
index d0f161d..693c254 100644 (file)
@@ -52,7 +52,7 @@ Director {
   # directors to verify the authenticity of this file daemon
   TLS Certificate = "/etc/bacula/bacula-fd.pem"
   TLS Key = "/etc/bacula/bacula-fd.pem"
-  TLS DH File = "/etc/bacula/dh1024.pem"
+  TLS DH File = "/etc/bacula/dh2048.pem"
 }
 
 #
@@ -131,7 +131,7 @@ EOF
 }
 
 generate_dh() {
-    DH_FILE=/etc/bacula/dh1024.pem
+    DH_FILE=/etc/bacula/dh2048.pem
 
     if [ -s $DH_FILE ]; then
         echo $DH_FILE already exists, skipping.
@@ -139,7 +139,9 @@ generate_dh() {
         umask 077
 
         echo Generating $DH_FILE
-        openssl dhparam -out $DH_FILE -5 1024
+        ###openssl dhparam -out $DH_FILE -5 1024
+        openssl dhparam -out $DH_FILE -2 2048
+       
     fi
 }
 
@@ -256,13 +258,20 @@ EOF
     # cleanup
     rm -f $DF_FILE $DB_FILE $FD_FILE $PEM_FILE
 
-    # report problems
+   # report problems
     if [ ! -e $REQUEST_FILE ]; then
         db_input high bacula-cn/request-failed || true
         db_go || true
     fi
 }
-
+   
+fix_privileges() {
+   # fix privileges 
+   
+    chown root:bacula /etc/bacula/bacula-fd.pem /etc/bacula/bacula-fd.conf /etc/bacula/bconsole.conf
+    chmod 640 /etc/bacula/bacula-fd.pem /etc/bacula/bacula-fd.conf /etc/bacula/bconsole.conf  
+}
 load_config() {
     db_get bacula-cn/hostname
     HOST=$RET
@@ -292,6 +301,8 @@ case "$1" in
         generate_fd_config
         generate_bconsole_config
 
+       fix_privileges
+
         restart_bacula
         send_request