[PATCH] saslauthd realm as mech param
Gianluigi Tiesi
cyrux at netfarm.it
Sun Sep 25 06:01:01 EDT 2005
I've been used a configuration where realm was different than
hostname() (a mailserver + a backup), I wrote this small patch
to pass realm as mech param. It can be usefull.
Bye
--
Gianluigi Tiesi <sherpya at netfarm.it>
EDP Project Leader
Netfarm S.r.l. - http://www.netfarm.it/
Free Software: http://oss.netfarm.it/
-------------- next part --------------
Index: saslauthd/auth_sasldb.c
===================================================================
RCS file: /cvs/src/sasl/saslauthd/auth_sasldb.c,v
retrieving revision 1.5
diff -u -r1.5 auth_sasldb.c
--- saslauthd/auth_sasldb.c 27 Jul 2002 18:44:46 -0000 1.5
+++ saslauthd/auth_sasldb.c 25 Sep 2005 09:56:57 -0000
@@ -50,6 +50,7 @@
#include "../include/sasl.h"
#include "../include/saslplug.h"
#include "../sasldb/sasldb.h"
+#include "globals.h"
static int
vf(void *context __attribute__((unused)),
@@ -140,14 +141,20 @@
_sasl_check_db(&utils, (void *)0x1);
- if(!realm || !strlen(realm)) {
+ /* Forcing a realm */
+ if (mech_option && strlen(mech_option) && (strlen(mech_option) < MAXHOSTNAMELEN))
+ {
+ memcpy(realm_buf, mech_option, strlen(mech_option)+1);
+ use_realm = realm_buf;
+ } else {
+ if(!realm || !strlen(realm)) {
ret = gethostname(realm_buf,MAXHOSTNAMELEN);
if(ret) RETURN("NO");
use_realm = realm_buf;
- } else {
+ } else {
use_realm = realm;
+ }
}
-
ret = _sasldb_getdata(&utils, (void *)0x1, login, use_realm,
"userPassword", pw, 1024, &outsize);
More information about the Info-cyrus
mailing list