* add possibility for multiselect to setup
authorWilfried Göesgens <willi@citadel.org>
Thu, 30 Jul 2009 22:20:54 +0000 (22:20 +0000)
committerWilfried Göesgens <willi@citadel.org>
Thu, 30 Jul 2009 22:20:54 +0000 (22:20 +0000)
* add ldap / AD to debconf

citadel/debian/changelog
citadel/debian/citadel-server.config
citadel/debian/citadel-server.postinst
citadel/debian/citadel-server.templates
citadel/setup.c

index a92b6d1cacfeaab5926434deaf0b97077f8ea429..26f0a85c0e68b63cc29af87b662ae0c2df10c628 100644 (file)
@@ -1,3 +1,10 @@
+citadel (7.60-80) stable; urgency=low
+
+  * new upstream release
+  * add debconf code for ldap/ad auth
+
+ -- Wilfried Goesgens <w.goesgens@outgesourced.org>  Tue, 28 Aug 2009 8:00:00 +0002
+
 citadel (7.50-73) stable; urgency=low
 
   * release
index ffdf372ec5bb7c82fb6834da610ddd8d8ce63e75..c095a488175376c154de5e65aad78f547ae580ca 100755 (executable)
@@ -26,7 +26,7 @@ fi
 
 if test "$DO_CONFIGURE" = "yes"; then
     STATE=1
-    LASTSTATE=4
+    LASTSTATE=8
     while [ "$STATE" != 0 -a "$STATE" -le "$LASTSTATE" ]; do
 
        case "$STATE" in
@@ -38,6 +38,35 @@ if test "$DO_CONFIGURE" = "yes"; then
                ;;
            3)
                db_input high citadel/LoginType || true
+               db_get citadel/LoginType 
+               case "$RET" in
+                   Internal)
+                       STATE=8
+                       ;;
+                   Host)
+                       STATE=8
+                       ;;
+               esac
+               ;;
+
+           4)
+               db_input citadel/LDAPServer || true
+               ;;
+
+           5)
+               db_input citadel/LDAPServerPort || true 
+               ;;
+
+           6)
+               db_input citadel/LDAPBaseDN || true 
+               ;;
+
+           7)
+               db_input citadel/LDAPBindDN || true
+               ;;
+
+           8)
+               db_input citadel/LDAPBindDNPassword || true
                ;;
 
 
index cdb7cdfed93e69e4f0c2e0afceedc46fc49aff9e..363258de7c4947232e6b51f6507b9755e8f12c7b 100644 (file)
@@ -22,15 +22,15 @@ case "$1" in
        move_file /etc/citadel/citadel.control /var/lib/citadel/data/citadel.control
        move_file /etc/citadel/citadel.config /var/lib/citadel/data/citadel.config
 
-        db_get citadel/Administrator && admin="$RET"
-        db_get citadel/ServerIPAddress && ip_addr="$RET"
-        db_get citadel/LoginType && deb_enable_unix_auth="$RET"
-
-        if test "$deb_enable_unix_auth" = "true"; then
-            export ENABLE_UNIX_AUTH=yes
-        else
-            export ENABLE_UNIX_AUTH=no
-        fi
+        db_get citadel/Administrator &&      admin="$RET"
+        db_get citadel/ServerIPAddress &&    ip_addr="$RET"
+        db_get citadel/LoginType &&          deb_enable_unix_auth="$RET"
+        db_get citadel/LDAPServer &&         LDAP_HOST="$RET"; export LDAP_HOST
+        db_get citadel/LDAPServerPort &&     LDAP_PORT="$RET"; export LDAP_PORT
+        db_get citadel/LDAPBaseDN &&         LDAP_BASE_DN="$RET"; export LDAP_BASE_DN
+        db_get citadel/LDAPBindDN &&         LDAP_BIND_DN="$RET"; export LDAP_BIND_DN
+        db_get citadel/LDAPBindDNPassword && LDAP_BIND_PW="$RET"; export LDAP_BIND_PW
+
 
         export IP_ADDR=$ip_addr
         export CITADEL='/var/run/citadel'
index ef14ac6f649f2de5bceff5f40011ad31dad9949f..cb5fe15f3103c272dce1ac8450555a5fbb4ac5a7 100644 (file)
@@ -9,17 +9,57 @@ _Description: Listening address for the Citadel server:
  of Citadel are running on the same computer.
 
 Template: citadel/LoginType
-Type: boolean
-Default: false
+Type: select
+_Choices: Internal, Host, LDAP, Active Directory
+Default: Internal
 _Description: Enable external authentication mode?
  Please choose the user authentication mode. By default Citadel will
- use its own internal user accounts database. If you accept this
- option, Citadel users will have accounts on the host system,
- authenticated via /etc/passwd (or LDAP).
+ use its own internal user accounts database. If you choose Host, 
+ Citadel users will have accounts on the host system, 
+ authenticated via /etc/passwd or a PAM source. 
+ LDAP chooses an RFC 2307 compliant directory server, 
+ the last option chooses the nonstandard MS Active Directory LDAP scheme.
  .
- Do not accept this option unless you are sure it is required, since
+ Do not change this option unless you are sure it is required, since
  changing back requires a full reinstall of Citadel.
 
+
+Template: citadel/LDAPServer
+Type: string
+Default: 0.0.0.0
+_Description: LDAP host
+ Please enter the host name or IP address of your LDAP server.
+
+Template: citadel/LDAPServerPort
+Type: integer
+Default: 389
+_Description: LDAP port number
+ Please enter the port number of the LDAP service (usually 389).
+
+Template: citadel/LDAPBaseDN
+Type: string
+Default: dc=example,dc=com
+_Description: LDAP base DN
+ Please enter the Base DN to search for authentication
+ (for example: dc=example,dc=com),
+
+Template: citadel/LDAPBindDN
+Type: string
+Default: 
+_Description: LDAP bind DN
+ Please enter the DN of an account to use for binding to the LDAP server
+ for performing queries.  The account does not require any other
+ privileges.  If your LDAP server allows anonymous queries, you can.
+ leave this blank.
+
+Template: citadel/LDAPBindDNPassword
+Type: string
+Default: OpenSesame
+_Description: LDAP bind password
+ If you entered a Bind DN in the previous question, you must now enter
+ the password associated with that account.  Otherwise, you can leave this
+ blank.
+
 Template: citadel/Administrator
 Type: string
 Default: Administrator
index 8a52b0a0282f91c67112707aaacf86d10c3b07d6..408fc8394c265c299f1a6a8b63546a5fa6be90c8 100644 (file)
@@ -870,12 +870,22 @@ void edit_value(int curr)
        case 6:
                if (setup_type == UI_SILENT)
                {
-                       if (getenv("ENABLE_UNIX_AUTH")) {
-                               if (!strcasecmp(getenv("ENABLE_UNIX_AUTH"), "yes")) {
+                       const char *auth;
+                       config.c_auth_mode = AUTHMODE_NATIVE;
+                       auth = getenv("ENABLE_UNIX_AUTH");
+                       if (auth != NULL)
+                       {
+                               if ((strcasecmp(auth, "yes") == 0) ||
+                                   (strcasecmp(auth, "host") == 0))
+                               {
                                        config.c_auth_mode = AUTHMODE_HOST;
                                }
-                               else {
-                                       config.c_auth_mode = AUTHMODE_NATIVE;
+                               else if (strcasecmp(auth, "ldap") == 0){
+                                       config.c_auth_mode = AUTHMODE_LDAP;
+                               }
+                               else if ((strcasecmp(auth, "ldap_ad") == 0) ||
+                                        (strcasecmp(auth, "active directory") == 0)){
+                                       config.c_auth_mode = AUTHMODE_LDAP_AD;
                                }
                        }
                }