implement password option for debconf/default
authorgregor herrmann <gregoa@debian.org>
Fri, 22 Jun 2007 12:44:23 +0000 (12:44 -0000)
committergregor herrmann <gregoa@debian.org>
Fri, 22 Jun 2007 12:44:23 +0000 (12:44 -0000)
debian/config
debian/iodine.iodined.init
debian/postinst
debian/templates

index df31ec13f91a271e425d2c4addd971c9e22f7f10..36e43452b69e985305724b8bc310db95bd40d3d0 100644 (file)
@@ -10,7 +10,10 @@ if [ -s /etc/default/iodine ] ; then
                db_set iodine/start_daemon "$START_IODINED"
        fi
        if [ -n "$IODINED_ARGS" ] ; then
                db_set iodine/start_daemon "$START_IODINED"
        fi
        if [ -n "$IODINED_ARGS" ] ; then
-               db_set iodine/daemon_options "$DAEMON_IODINED_ARGS"
+               db_set iodine/daemon_options "$IODINED_ARGS"
+       fi
+       if [ -n "$IODINED_PASSWORD" ] ; then
+               db_set iodine/daemon_password "$IODINED_PASSWORD"
        fi
 fi
 
        fi
 fi
 
@@ -22,5 +25,6 @@ START_DAEMON=$RET
 
 if [ "x$START_DAEMON" = "xtrue" ] ; then
        db_input medium iodine/daemon_options || true
 
 if [ "x$START_DAEMON" = "xtrue" ] ; then
        db_input medium iodine/daemon_options || true
+       db_input medium iodine/daemon_password || true
        db_go
 fi
        db_go
 fi
index d3bc8c8c94210c97ad6aebcbe3f79c9920bcdbe5..c1f19a2d45400963511ba819559f1465b7ac740c 100644 (file)
@@ -43,8 +43,8 @@ get_config() {
                log_warning_msg "$NAME is not configured to start automatically. Change this in /etc/default/$DEFAULT or run dpkg-reconfigure $DEFAULT."
                exit 0
        else
                log_warning_msg "$NAME is not configured to start automatically. Change this in /etc/default/$DEFAULT or run dpkg-reconfigure $DEFAULT."
                exit 0
        else
-               if [ -n "$IODINED_ARGS" ] ; then
-                       DAEMON_ARGS=$IODINED_ARGS
+               if [ -n "$IODINED_ARGS" ] && [ -n "$IODINED_PASSWORD" ] ; then
+                       DAEMON_ARGS="-P $IODINED_PASSWORD $IODINED_ARGS"
                else
                        log_warning_msg "$NAME is not fully configured. Change this in /etc/default/$DEFAULT or run dpkg-reconfigure $DEFAULT."
                        exit 0
                else
                        log_warning_msg "$NAME is not fully configured. Change this in /etc/default/$DEFAULT or run dpkg-reconfigure $DEFAULT."
                        exit 0
index a94e9d0ee366c2d84cbb1bcfa17a3575ba080b5e..d04bbdb49f6b2d2a949f63d3167d1a24f1fbd2c9 100644 (file)
@@ -32,11 +32,14 @@ case "$1" in
       START_IODINED=$RET
       db_get iodine/daemon_options
       IODINED_ARGS=$RET
       START_IODINED=$RET
       db_get iodine/daemon_options
       IODINED_ARGS=$RET
+      db_get iodine/daemon_password
+      IODINED_PASSWORD=$RET
       cat <<EOF > /etc/default/iodine
 # Default settings for iodine. This file is sourced from
 # /etc/init.d/iodined
 START_IODINED="$START_IODINED"
 IODINED_ARGS="$IODINED_ARGS"
       cat <<EOF > /etc/default/iodine
 # Default settings for iodine. This file is sourced from
 # /etc/init.d/iodined
 START_IODINED="$START_IODINED"
 IODINED_ARGS="$IODINED_ARGS"
+IODINED_PASSWORD="$IODINED_PASSWORD"
 EOF
     ;;
 
 EOF
     ;;
 
index c46ffb93a2218e844e5a30ee968270793ab36644..f28d7bcdb6162bfad8a9f2db025a5bffeaff7198 100644 (file)
@@ -9,3 +9,10 @@ Type: string
 _Description: Options to iodined (server):
  You need to give the necessary arguments to iodined; see iodined(8) for help.
  Example: 10.0.0.1 tunnel.mydomain.example
 _Description: Options to iodined (server):
  You need to give the necessary arguments to iodined; see iodined(8) for help.
  Example: 10.0.0.1 tunnel.mydomain.example
+
+Template: iodine/daemon_password
+Type: password
+_Description: Password for iodined (server):
+ Enter the password iodined uses at startup. It has to be used by clients
+ when connecting.
+ This password will be stored in plain text in /etc/default/iodine.