~ubuntu-branches/ubuntu/maverick/openldap/maverick-proposed

« back to all changes in this revision

Viewing changes to libraries/libldap/cyrus.c

  • Committer: Bazaar Package Importer
  • Author(s): Mathias Gug
  • Date: 2009-09-07 13:41:10 UTC
  • mto: This revision was merged to the branch mainline in revision 19.
  • Revision ID: james.westby@ubuntu.com-20090907134110-jsdrvn0atu1fex4m
Tags: upstream-2.4.18
ImportĀ upstreamĀ versionĀ 2.4.18

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
/* $OpenLDAP: pkg/ldap/libraries/libldap/cyrus.c,v 1.133.2.13 2009/02/08 06:06:04 quanah Exp $ */
 
1
/* $OpenLDAP: pkg/ldap/libraries/libldap/cyrus.c,v 1.133.2.15 2009/08/25 23:04:13 quanah Exp $ */
2
2
/* This work is part of OpenLDAP Software <http://www.openldap.org/>.
3
3
 *
4
4
 * Copyright 1998-2009 The OpenLDAP Foundation.
1013
1013
                        *(int *)arg = (int) LDAP_BOOL_GET(&ld->ld_options, LDAP_BOOL_SASL_NOCANON );
1014
1014
                        break;
1015
1015
 
 
1016
                case LDAP_OPT_X_SASL_USERNAME: {
 
1017
                        int sc;
 
1018
                        char *username;
 
1019
                        sasl_conn_t *ctx;
 
1020
 
 
1021
                        if( ld->ld_defconn == NULL ) {
 
1022
                                return -1;
 
1023
                        }
 
1024
 
 
1025
                        ctx = ld->ld_defconn->lconn_sasl_authctx;
 
1026
 
 
1027
                        if ( ctx == NULL ) {
 
1028
                                return -1;
 
1029
                        }
 
1030
 
 
1031
                        sc = sasl_getprop( ctx, SASL_USERNAME,
 
1032
                                (SASL_CONST void **)(char **) &username );
 
1033
 
 
1034
                        if ( sc != SASL_OK ) {
 
1035
                                return -1;
 
1036
                        }
 
1037
 
 
1038
                        *(char **)arg = username ? LDAP_STRDUP( username ) : NULL;
 
1039
                } break;
 
1040
 
1016
1041
                case LDAP_OPT_X_SASL_SECPROPS:
1017
1042
                        /* this option is write only */
1018
1043
                        return -1;
1034
1059
 
1035
1060
        switch ( option ) {
1036
1061
        case LDAP_OPT_X_SASL_SSF:
 
1062
        case LDAP_OPT_X_SASL_USERNAME:
1037
1063
                /* This option is read-only */
1038
1064
                return -1;
1039
1065