#endif /* LDAP_CONTROL_X_CHAINING_BEHAVIOR */
#ifdef LDAP_CONTROL_X_SESSION_TRACKING
static int sessionTracking = 0;
+static char *sessionTrackingName;
struct berval stValue;
#endif /* LDAP_CONTROL_X_SESSION_TRACKING */
ber_int_t vlvPos;
}
}
+ if ( sessionTrackingName != NULL ) {
+ ber_str2bv( sessionTrackingName , 0, 0, &id );
+ } else
#ifdef HAVE_CYRUS_SASL
if ( sasl_authz_id != NULL ) {
ber_str2bv( sasl_authz_id, 0, 0, &id );
BER_BVZERO( &passwd );
}
+#ifdef HAVE_CYRUS_SASL
+ if ( sasl_mech != NULL ) {
+ ber_memfree( sasl_mech );
+ sasl_mech = NULL;
+ }
+#endif /* HAVE_CYRUS_SASL */
+
if ( infile != NULL ) {
ber_memfree( infile );
infile = NULL;
ber_memfree( postread_attrs );
postread_attrs = NULL;
}
+
+#ifdef LDAP_CONTROL_X_SESSION_TRACKING
+ if ( !BER_BVISNULL( &stValue ) ) {
+ ber_memfree( stValue.bv_val );
+ BER_BVZERO( &stValue );
+ }
+
+ if ( sessionTrackingName ) {
+ ber_memfree( sessionTrackingName );
+ sessionTrackingName = NULL;
+ }
+#endif /* LDAP_CONTROL_X_SESSION_TRACKING */
}
void
N_(" [!]preread[=<attrs>] (RFC 4527; comma-separated attr list)\n")
N_(" [!]relax\n")
#ifdef LDAP_CONTROL_X_SESSION_TRACKING
-N_(" [!]sessiontracking\n")
+N_(" [!]sessiontracking[=<username>]\n")
#endif /* LDAP_CONTROL_X_SESSION_TRACKING */
N_(" abandon, cancel, ignore (SIGINT sends abandon/cancel,\n"
" or ignores response; if critical, doesn't wait for SIGINT.\n"
exit( EXIT_FAILURE );
}
sessionTracking = 1;
- if( crit ) {
+ if ( crit ) {
fprintf( stderr, "sessiontracking: critical flag not allowed\n" );
usage();
}
+ if ( cvalue ) {
+ sessionTrackingName = ber_strdup( cvalue );
+ }
#endif /* LDAP_CONTROL_X_SESSION_TRACKING */
/* this shouldn't go here, really; but it's a feature... */
if ( sessionTracking ) {
LDAPControl c;
- if (stValue.bv_val == NULL && st_value( ld, &stValue ) ) {
+ if ( BER_BVISNULL( &stValue) && st_value( ld, &stValue ) ) {
exit( EXIT_FAILURE );
}
c.ldctl_oid = LDAP_CONTROL_X_SESSION_TRACKING;
c.ldctl_iscritical = 0;
- ber_dupbv( &c.ldctl_value, &stValue );
+ c.ldctl_value = stValue;
sctrl[nsctrls] = c;
sctrls[nsctrls] = &sctrl[nsctrls];
#ifdef LDAP_CONTROL_X_SESSION_TRACKING
if ( sessionTracking ) {
- if ( stValue.bv_val == NULL && st_value( ld, &stValue ) ) {
+ if ( BER_BVISNULL( &stValue ) && st_value( ld, &stValue ) ) {
exit( EXIT_FAILURE );
}
c[i].ldctl_oid = LDAP_CONTROL_X_SESSION_TRACKING;
c[i].ldctl_iscritical = 0;
- ber_dupbv( &c[i].ldctl_value, &stValue );
+ c[i].ldctl_value = stValue;
ctrls[i] = &c[i];
i++;
[!]postread[=<attrs>] (a comma-separated attribute list)
[!]preread[=<attrs>] (a comma-separated attribute list)
[!]relax
- sessiontracking
+ sessiontracking[=<username>]
abandon,cancel,ignore (SIGINT sends abandon/cancel,
or ignores response; if critical, doesn't wait for SIGINT.
not really controls)
[!]postread[=<attrs>] (a comma-separated attribute list)
[!]preread[=<attrs>] (a comma-separated attribute list)
[!]relax
- sessiontracking
+ sessiontracking[=<username>]
abandon,cancel,ignore (SIGINT sends abandon/cancel,
or ignores response; if critical, doesn't wait for SIGINT.
not really controls)
[!]postread[=<attrs>] (a comma-separated attribute list)
[!]preread[=<attrs>] (a comma-separated attribute list)
[!]relax
- sessiontracking
+ sessiontracking[=<username>]
abandon,cancel,ignore (SIGINT sends abandon/cancel,
or ignores response; if critical, doesn't wait for SIGINT.
not really controls)
[!]postread[=<attrs>] (a comma-separated attribute list)
[!]preread[=<attrs>] (a comma-separated attribute list)
[!]relax
- sessiontracking
+ sessiontracking[=<username>]
abandon,cancel,ignore (SIGINT sends abandon/cancel,
or ignores response; if critical, doesn't wait for SIGINT.
not really controls)
[!]postread[=<attrs>] (a comma-separated attribute list)
[!]preread[=<attrs>] (a comma-separated attribute list)
[!]relax
- sessiontracking
+ sessiontracking[=<username>]
abandon,cancel,ignore (SIGINT sends abandon/cancel,
or ignores response; if critical, doesn't wait for SIGINT.
not really controls)
[!]postread[=<attrs>] (a comma-separated attribute list)
[!]preread[=<attrs>] (a comma-separated attribute list)
[!]relax
- sessiontracking
+ sessiontracking[=<username>]
abandon,cancel,ignore (SIGINT sends abandon/cancel,
or ignores response; if critical, doesn't wait for SIGINT.
not really controls)
[!]postread[=<attrs>] (a comma-separated attribute list)
[!]preread[=<attrs>] (a comma-separated attribute list)
[!]relax
- sessiontracking
+ sessiontracking[=<username>]
abandon,cancel,ignore (SIGINT sends abandon/cancel,
or ignores response; if critical, doesn't wait for SIGINT.
not really controls)
[!]postread[=<attrs>] (a comma-separated attribute list)
[!]preread[=<attrs>] (a comma-separated attribute list)
[!]relax
- sessiontracking
+ sessiontracking[=<username>]
abandon,cancel,ignore (SIGINT sends abandon/cancel,
or ignores response; if critical, doesn't wait for SIGINT.
not really controls)
[!]postread[=<attrs>] (a comma-separated attribute list)
[!]preread[=<attrs>] (a comma-separated attribute list)
[!]relax
- sessiontracking
+ sessiontracking[=<username>]
abandon,cancel,ignore (SIGINT sends abandon/cancel,
or ignores response; if critical, doesn't wait for SIGINT.
not really controls)