[Date Prev][Date Next] [Chronological] [Thread] [Top]

RE: Custom SASL path (ITS#2721)



I don't see why this patch belongs in OpenLDAP. If the Debian policy mandates
that config files must reside in a particular place, then the logical
solution (to me) is to change the libsasl library to use that particular
place. Then you only need to makethis change once (in libsasl) as opposed to
changing it in every application that might use SASL. In particular, since
many apps unrelated to OpenLDAP can/will use SASL, creating
/etc/openldap/sasl is counter-intuitive.

  -- Howard Chu
  Chief Architect, Symas Corp.       Director, Highland Sun
  http://www.symas.com               http://highlandsun.com/hyc
  Symas: Premier OpenSource Development and Support

> -----Original Message-----
> From: owner-openldap-bugs@OpenLDAP.org
> [mailto:owner-openldap-bugs@OpenLDAP.org]On Behalf Of rb@debian.org
> Sent: Monday, September 15, 2003 1:56 PM
> To: openldap-its@OpenLDAP.org
> Subject: Custom SASL path (ITS#2721)
>
>
> Full_Name: Roland Bauerschmidt
> Version: 2.1.22
> OS: Debian GNU/Linux unstable
> URL: ftp://ftp.openldap.org/incoming/
> Submission from: (NULL) (213.168.198.111)
>
>
> SASL uses /usr/lib/sasl(2) as default path for configuration
> files. The Debian
> Policy requires that all configuration files are located
> under /etc. Therefore,
> I'd like to propose the attached patch that overrides SASL's
> default location,
> so that /etc/openldap/sasl/slapd.conf could be used instead of
> /usr/lib/sasl2/slapd.conf.
>
> Index: include/ldap_defaults.h
> ===================================================================
> --- include/ldap_defaults.h     (revision 222)
> +++ include/ldap_defaults.h     (working copy)
> @@ -90,4 +90,6 @@
>         /* dn of the default "monitor" subentry */
>  #define SLAPD_MONITOR_DN               "cn=Monitor"
>
> +#define SASL_CONFIGPATH
> LDAP_SYSCONFDIR LDAP_DIRSEP
> "sasl"
> +
>  #endif /* _LDAP_CONFIG_H */
> Index: servers/slapd/sasl.c
> ===================================================================
> --- servers/slapd/sasl.c        (revision 222)
> +++ servers/slapd/sasl.c        (working copy)
> @@ -946,12 +946,38 @@
>  }
>  #endif
>
> +static int
> +slap_sasl_getpath( void * context, char ** path )
> +{
> +       char * sasl_default_configpath;
> +       size_t len;
> +
> +#if SASL_VERSION_MAJOR >= 2
> +       sasl_default_configpath = "/usr/lib/sasl2";
> +#else
> +       sasl_default_configpath = "/usr/lib/sasl";
> +#endif
> +
> +       len = strlen(SASL_CONFIGPATH) + 1 /* colon */ +
> +               strlen(sasl_default_configpath) + 1 /* \0 */;
> +       *path = malloc( len );
> +       if ( *path == NULL )
> +               return SASL_FAIL;
> +
> +       if (snprintf( *path, len, "%s:%s", SASL_CONFIGPATH,
> +                       sasl_default_configpath ) != len-1 )
> +               return SASL_FAIL;
> +
> +       return SASL_OK;
> +}
> +
>  int slap_sasl_init( void )
>  {
>  #ifdef HAVE_CYRUS_SASL
>         int rc;
>         static sasl_callback_t server_callbacks[] = {
>                 { SASL_CB_LOG, &slap_sasl_log, NULL },
> +               { SASL_CB_GETPATH, &slap_sasl_getpath, NULL },
>                 { SASL_CB_LIST_END, NULL, NULL }
>         };
>