Package: libsasl2-modules-sql
Version: 2.1.23.dfsg1-5
Severity: wishlist
Tags: patch

When using the %r variable in an sql_select statement, the value
substituted for that variable is the machine's FQDN for all users
not specifying a realm during login. The attached patch adds an
sql_defaultrealm option taking a realm to use for any unqualified
user ids.

-- System Information:
Debian Release: 5.0.3
  APT prefers stable
  APT policy: (990, 'stable'), (500, 'oldstable'), (50, 'unstable')
Architecture: i386 (i686)

Kernel: Linux 2.6.33-686 (SMP w/2 CPU cores)
Locale: LANG=de_DE.UTF-8, LC_CTYPE=de_DE.UTF-8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/bash

Versions of packages libsasl2-modules-sql depends on:
ii  libc6                  2.7-18            GNU C Library: Shared libraries
ii  libmysqlclient15off    5.0.51a-24+lenny2 MySQL database client library
ii  libpq5                 8.3.9-0lenny1     PostgreSQL C client library
ii  libsasl2-modules       2.1.23.dfsg1-5    Cyrus SASL - pluggable authenticat
ii  libsqlite0             2.8.17-4          SQLite shared library

libsasl2-modules-sql recommends no packages.

libsasl2-modules-sql suggests no packages.

-- no debconf information
#! /bin/sh /usr/share/dpatch/dpatch-run
## 0024_add_sql_defaultrealm_option.dpatch by  <c...@schulte.it>
##
## All lines beginning with `## DP:' are a description of the patch.
## DP: A patch adding an sql_defaultrealm option.

@DPATCH@

--- cyrus-sasl2_2.1.23.dfsg1.orig/plugins/sql.c	2009-04-28 17:09:17.000000000 +0200
+++ cyrus-sasl2_2.1.23.dfsg1/plugins/sql.c	2009-12-31 20:27:48.000000000 +0100
@@ -53,6 +53,7 @@
     const char *sql_select;
     const char *sql_insert;
     const char *sql_update;
+    const char *sql_defaultrealm;
     int sql_usessl;
 } sql_settings_t;
 
@@ -677,6 +678,12 @@
 	settings->sql_update = SQL_BLANK_STRING;
     }
 
+    r = utils->getopt(utils->getopt_context, "SQL", "sql_defaultrealm",
+		      &settings->sql_defaultrealm, NULL);
+    if(r || !settings->sql_defaultrealm) {
+	settings->sql_defaultrealm = NULL;
+    }
+
     r = utils->getopt(utils->getopt_context, "SQL", "sql_usessl",
 		  &usessl, NULL);
     if (r || !usessl) usessl = "no";
@@ -781,6 +788,8 @@
     
     if(sparams->user_realm) {
 	user_realm = sparams->user_realm;
+    } else if(settings->sql_defaultrealm) {
+        user_realm = settings->sql_defaultrealm;
     } else {
 	user_realm = sparams->serverFQDN;
     }

Reply via email to