[pkg-dspam-commits] r45 - trunk/debian

Matthijs Mohlmann active2-guest at costa.debian.org
Sat Nov 5 19:23:36 UTC 2005


Author: active2-guest
Date: Sat Nov  5 19:23:35 2005
New Revision: 45

Modified:
   trunk/debian/dspam-webfrontend.postinst
   trunk/debian/dspam-webfrontend.postrm
   trunk/debian/dspam.postinst
   trunk/debian/dspam.postrm
Log:
 * Removed the debconf configuration as we moved it to libdspam7-drv-mysql
   using dbconfig-common
 * Modified the useradd so that it is a system user and also added a system
   group for dspam.
 * Added some "exit 0" at the end of the postinst / postrm scripts.
 * Remove the system user, otherwise it's possible to remove a user by accident.


Modified: trunk/debian/dspam-webfrontend.postinst
==============================================================================
--- trunk/debian/dspam-webfrontend.postinst	(original)
+++ trunk/debian/dspam-webfrontend.postinst	Sat Nov  5 19:23:35 2005
@@ -53,3 +53,5 @@
 
 #DEBHELPER#
 
+exit 0
+

Modified: trunk/debian/dspam-webfrontend.postrm
==============================================================================
--- trunk/debian/dspam-webfrontend.postrm	(original)
+++ trunk/debian/dspam-webfrontend.postrm	Sat Nov  5 19:23:35 2005
@@ -41,3 +41,6 @@
 
 
 #DEBHELPER#
+
+exit 0
+

Modified: trunk/debian/dspam.postinst
==============================================================================
--- trunk/debian/dspam.postinst	(original)
+++ trunk/debian/dspam.postinst	Sat Nov  5 19:23:35 2005
@@ -2,20 +2,19 @@
 
 set -e
 
-. /usr/share/debconf/confmodule
 test $DEBIAN_SCRIPT_DEBUG && set -v -x
 
 create_user() {
     # idea stolen from postfix.postinst: make sure our user exists,
     # simplest portable way to check is to chown something.
-    cd /var/spool/dspam
-    touch temp
-    if ! chown dspam temp 2>/dev/null; then
-    adduser --quiet --home /var/spool/dspam \
-        --no-create-home --disabled-password \
-        --gecos 'DSPAM' dspam
+    touch /var/spool/dspam/temp
+    if ! chown dspam /var/spool/dspam/temp 2>/dev/null; then
+        addgroup --quiet --system dspam
+        adduser --quiet --system --ingroup dspam --home /var/spool/dspam \
+            --no-create-home --disabled-password \
+            --gecos 'DSPAM' dspam
     fi
-    rm -f temp 2>/dev/null
+    rm -f /var/spool/dspam/temp 2>/dev/null
     return 0
 }
 
@@ -58,86 +57,13 @@
     return 0
 }
 
-do_debconf_config(){
-    
-    db_get dspam-mysql/configure_db
-    if  [ "$RET" = "true" ]; then
-        
-        db_get dspam-mysql/db_host || true; DB_HOST=$RET
-        db_get dspam-mysql/db_database || true; DB_DATABASE=$RET
-        db_get dspam-mysql/db_user || true; DB_USER=$RET
-        db_get dspam-mysql/db_pass || true; DB_PASS=$RET
-        db_get dspam-mysql/db_port || true; DB_PORT=$RET
-
-        #MySQLServer        /var/lib/mysql/mysql.sock
-        #MySQLPort
-        #MySQLUser          dspam
-        #MySQLPass          changeme
-        #MySQLDb            dspam
-        #MySQLCompress      true
-
-        # Here we put the database stuff in the config file.
-        TEMPFILE=`mktemp`
-        cat /etc/dspam/dspam.conf | while read LINE
-        do
-            if [ "$LINE" = "# (#DBSTART#)" ]
-            then
-                echo "# (#DBSTART#)" >> $TEMPFILE
-                if [ $DB_USER ]
-                then
-                    echo -n "MySQLUser=$DB_USER " >> $TEMPFILE
-                fi
-                if [ $DB_PASS ]
-                then
-                    echo -n "MySQLPass=$DB_PASS " >> $TEMPFILE
-                fi
-                if [ $DB_DATABASE ]
-                then
-                    echo -n "MySQLDb=$DB_DATABASE " >> $TEMPFILE
-                fi
-                if [ $DB_HOST ]
-                then
-                    echo -n "MySQLServer=$DB_HOST " >> $TEMPFILE
-                fi
-                if [ $DB_PORT ]
-                then
-                    echo -n "MySQLPort=$DB_PORT " >> $TEMPFILE
-                fi
-
-                echo " " >> $TEMPFILE
-                echo "# (#DBEND#)" >> $TEMPFILE
-                break
-            else
-                echo $LINE >> $TEMPFILE
-            fi
-        done
-
-        WRITE=0
-        cat /etc/dspam/dspam.conf | while read LINE
-        do
-            if [ $WRITE -eq 1 ]
-            then
-                echo $LINE >> $TEMPFILE
-            fi
-
-            if [ "$LINE" = "# (#DBEND#)" ]
-            then
-                WRITE=1
-            fi
-        done
-        mv -f $TEMPFILE /etc/dspam/dspam.conf
-    fi
-}
-
 case "$1" in
     configure)
         create_user
         set_dspam_perms
-        #do_debconf_config
     ;;
 
     reconfigure)
-        #do_debconf_config
     ;;
 
     abort-upgrade|abort-remove|abort-deconfigure)
@@ -148,4 +74,8 @@
         exit 1
     ;;
 esac
+
 #DEBHELPER#
+
+exit 0
+

Modified: trunk/debian/dspam.postrm
==============================================================================
--- trunk/debian/dspam.postrm	(original)
+++ trunk/debian/dspam.postrm	Sat Nov  5 19:23:35 2005
@@ -1,10 +1,9 @@
 #!/bin/sh
-#!/bin/sh
 
 set -e
 
 remove_user() {
-    userdel dspam
+    userdel --system dspam
 }
 
 remove_dspam_perms() {
@@ -35,3 +34,6 @@
 esac
 
 #DEBHELPER#
+
+exit 0
+



More information about the Pkg-dspam-commits mailing list