Skip to content
Snippets Groups Projects

Compare revisions

Changes are shown as if the source revision was being merged into the target revision. Learn more about comparing revisions.

Source

Select target project
No results found

Target

Select target project
  • openldap/openldap
  • hyc/openldap
  • ryan/openldap
  • iboukris/openldap
  • ondra/openldap
  • sshanks-kx/openldap
  • blaggacao/openldap
  • pbrezina/openldap
  • quanah/openldap
  • dragos_h/openldap
  • lorenz/openldap
  • tsaarni/openldap
  • fei.ding/openldap
  • orent/openldap
  • arrowplum/openldap
  • barchiesi/openldap
  • jotik/openldap
  • hamano/openldap
  • ingovoss/openldap
  • henson/openldap
  • jlrine2/openldap
  • howeverAT/openldap
  • nivanova/openldap
  • orbea/openldap
  • rdubner/openldap
  • smckinney/openldap
  • jklowden/openldap
  • dpa-openldap/openldap
  • rouzier/openldap
  • orgads/openldap
  • ffontaine/openldap
  • jiaqingz/openldap
  • dcoutadeur/openldap
  • begeragus/openldap
  • pubellit/openldap
  • glandium/openldap
  • facboy/openldap
  • thesamesam/openldap
  • Johan/openldap
  • fkooman/openldap
  • gburd/openldap
  • h-homma/openldap
  • sgallagher/openldap
  • ahmed_zaki/openldap
  • gnoe/openldap
  • mid/openldap
  • clan/openldap
47 results
Show changes
Showing
with 542 additions and 217 deletions
......@@ -6,73 +6,79 @@
lib_LTLIBRARIES = libldapcpp.la
libldapcpp_la_SOURCES = LDAPAddRequest.cpp \
LDAPAsynConnection.cpp \
LDAPAttribute.cpp \
LDAPAttributeList.cpp \
LDAPAttrType.cpp \
LDAPBindRequest.cpp \
LDAPCompareRequest.cpp \
LDAPConnection.cpp \
LDAPConstraints.cpp \
LDAPControl.cpp \
LDAPControlSet.cpp \
LDAPDeleteRequest.cpp \
LDAPEntry.cpp \
LDAPEntryList.cpp \
LDAPException.cpp \
LDAPExtRequest.cpp \
LDAPExtResult.cpp \
LDAPMessage.cpp \
LDAPMessageQueue.cpp \
LDAPModDNRequest.cpp \
LDAPModification.cpp \
LDAPModifyRequest.cpp \
LDAPModList.cpp \
LDAPObjClass.cpp \
LDAPRebind.cpp \
LDAPRebindAuth.cpp \
LDAPReferralException.cpp \
LDAPReferenceList.cpp \
LDAPRequest.cpp \
LDAPResult.cpp \
LDAPSchema.cpp \
LDAPSearchReference.cpp \
LDAPSearchRequest.cpp \
LDAPSearchResult.cpp \
LDAPSearchResults.cpp \
LDAPUrl.cpp \
LDAPUrlList.cpp \
StringList.cpp
LDAPAsynConnection.cpp \
LDAPAttribute.cpp \
LDAPAttributeList.cpp \
LDAPAttrType.cpp \
LDAPBindRequest.cpp \
LDAPCompareRequest.cpp \
LDAPConnection.cpp \
LDAPConstraints.cpp \
LDAPControl.cpp \
LDAPControlSet.cpp \
LDAPDeleteRequest.cpp \
LDAPEntry.cpp \
LDAPEntryList.cpp \
LDAPException.cpp \
LDAPExtRequest.cpp \
LDAPExtResult.cpp \
LDAPMessage.cpp \
LDAPMessageQueue.cpp \
LDAPModDNRequest.cpp \
LDAPModification.cpp \
LDAPModifyRequest.cpp \
LDAPModList.cpp \
LDAPObjClass.cpp \
LDAPRebind.cpp \
LDAPRebindAuth.cpp \
LDAPReferralException.cpp \
LDAPReferenceList.cpp \
LDAPRequest.cpp \
LDAPResult.cpp \
LDAPSaslBindResult.cpp \
LDAPSchema.cpp \
LDAPSearchReference.cpp \
LDAPSearchRequest.cpp \
LDAPSearchResult.cpp \
LDAPSearchResults.cpp \
LDAPUrl.cpp \
LDAPUrlList.cpp \
SaslInteraction.cpp \
SaslInteractionHandler.cpp \
StringList.cpp
include_HEADERS = LDAPAsynConnection.h \
LDAPAttribute.h \
LDAPAttributeList.h \
LDAPAttrType.h \
LDAPConnection.h \
LDAPConstraints.h \
LDAPControl.h \
LDAPControlSet.h \
LDAPEntry.h \
LDAPEntryList.h \
LDAPException.h \
LDAPExtResult.h \
LDAPMessage.h \
LDAPMessageQueue.h \
LDAPModification.h \
LDAPModList.h \
LDAPObjClass.h \
LDAPRebind.h \
LDAPRebindAuth.h \
LDAPReferralException.h \
LDAPReferenceList.h \
LDAPResult.h \
LDAPSchema.h \
LDAPSearchReference.h \
LDAPSearchResult.h \
LDAPSearchResults.h \
LDAPUrl.h \
LDAPUrlList.h \
StringList.h
LDAPAttribute.h \
LDAPAttributeList.h \
LDAPAttrType.h \
LDAPConnection.h \
LDAPConstraints.h \
LDAPControl.h \
LDAPControlSet.h \
LDAPEntry.h \
LDAPEntryList.h \
LDAPException.h \
LDAPExtResult.h \
LDAPMessage.h \
LDAPMessageQueue.h \
LDAPModification.h \
LDAPModList.h \
LDAPObjClass.h \
LDAPRebind.h \
LDAPRebindAuth.h \
LDAPReferralException.h \
LDAPReferenceList.h \
LDAPResult.h \
LDAPSaslBindResult.h \
LDAPSchema.h \
LDAPSearchReference.h \
LDAPSearchResult.h \
LDAPSearchResults.h \
LDAPUrl.h \
LDAPUrlList.h \
SaslInteraction.h \
SaslInteractionHandler.h \
StringList.h
noinst_HEADERS = LDAPAddRequest.h \
LDAPBindRequest.h \
......@@ -85,5 +91,5 @@ noinst_HEADERS = LDAPAddRequest.h \
LDAPSearchRequest.h
libldapcpp_la_LIBADD = -lldap -llber
libldapcpp_la_LDFLAGS = -version-info 0:4:0
libldapcpp_la_LDFLAGS = -version-info 0:5:0
This diff is collapsed.
/*
* Copyright 2007, OpenLDAP Foundation, All Rights Reserved.
* COPYING RESTRICTIONS APPLY, see COPYRIGHT file
*/
#include <SaslInteraction.h>
#include <iostream>
#include "debug.h"
SaslInteraction::SaslInteraction( sasl_interact_t *interact ) :
m_interact(interact) {}
SaslInteraction::~SaslInteraction()
{
DEBUG(LDAP_DEBUG_TRACE, "SaslInteraction::~SaslInteraction()" << std::endl);
}
unsigned long SaslInteraction::getId() const
{
return m_interact->id;
}
const std::string SaslInteraction::getPrompt() const
{
return std::string(m_interact->prompt);
}
const std::string SaslInteraction::getChallenge() const
{
return std::string(m_interact->challenge);
}
const std::string SaslInteraction::getDefaultResult() const
{
return std::string(m_interact->defresult);
}
void SaslInteraction::setResult(const std::string &res)
{
m_result = res;
m_interact->result = m_result.data();
m_interact->len = m_result.size();
}
/*
* Copyright 2007, OpenLDAP Foundation, All Rights Reserved.
* COPYING RESTRICTIONS APPLY, see COPYRIGHT file
*/
#ifndef SASL_INTERACTION_H
#define SASL_INTERACTION_H
#include <string>
#include <sasl/sasl.h>
class SaslInteraction {
public:
SaslInteraction( sasl_interact_t *interact );
~SaslInteraction();
unsigned long getId() const;
const std::string getPrompt() const;
const std::string getChallenge() const;
const std::string getDefaultResult() const;
void setResult(const std::string &res);
private:
sasl_interact_t *m_interact;
std::string m_result;
};
#endif /* SASL_INTERACTION_H */
/*
* Copyright 2007, OpenLDAP Foundation, All Rights Reserved.
* COPYING RESTRICTIONS APPLY, see COPYRIGHT file
*/
#include <iostream>
#include <iomanip>
#include <limits>
#include "config.h"
#ifdef HAVE_TERMIOS_H
#include <termios.h>
#endif
#include <string.h>
#include "SaslInteractionHandler.h"
#include "SaslInteraction.h"
#include "debug.h"
void DefaultSaslInteractionHandler::handleInteractions(
const std::list<SaslInteraction*> &cb )
{
DEBUG(LDAP_DEBUG_TRACE, "DefaultSaslInteractionHandler::handleCallbacks()"
<< std::endl );
std::list<SaslInteraction*>::const_iterator i;
for (i = cb.begin(); i != cb.end(); i++ ) {
bool noecho;
cleanupList.push_back(*i);
std::cout << (*i)->getPrompt();
if (! (*i)->getDefaultResult().empty() ) {
std::cout << "(" << (*i)->getDefaultResult() << ")" ;
}
std:: cout << ": ";
switch ( (*i)->getId() ) {
case SASL_CB_PASS:
case SASL_CB_ECHOPROMPT:
noecho = true;
noecho = true;
break;
default:
noecho = false;
break;
}
#ifdef HAVE_TERMIOS_H
/* turn off terminal echo if needed */
struct termios old_attr;
if ( noecho ) {
struct termios attr;
if (tcgetattr(STDIN_FILENO, &attr) < 0) {
perror("tcgetattr");
}
/* save terminal attributes */
memcpy(&old_attr, &attr, sizeof(attr));
/* disable echo */
attr.c_lflag &= ~(ECHO);
/* write attributes to terminal */
if (tcsetattr(STDIN_FILENO, TCSAFLUSH, &attr) < 0) {
perror("tcsetattr");
}
}
#endif /* HAVE_TERMIOS_H */
std::string input;
std::cin >> std::noskipws >> input;
std::cin >> std::skipws;
(*i)->setResult(input);
if( std::cin.fail() ) {
std::cin.clear();
}
/* ignore the rest of the input line */
std::cin.ignore(std::numeric_limits<std::streamsize>::max(), '\n');
#ifdef HAVE_TERMIOS_H
/* restore terminal settings */
if ( noecho ) {
tcsetattr(STDIN_FILENO, TCSANOW, &old_attr);
std::cout << std::endl;
}
#endif /* HAVE_TERMIOS_H */
}
}
DefaultSaslInteractionHandler::~DefaultSaslInteractionHandler()
{
DEBUG(LDAP_DEBUG_TRACE, "DefaultSaslInteractionHandler::~DefaultSaslInteractionHandler()"
<< std::endl );
std::list<SaslInteraction*>::const_iterator i;
for (i = cleanupList.begin(); i != cleanupList.end(); i++ ) {
delete(*i);
}
}
This diff is collapsed.
......@@ -6,6 +6,8 @@
#include "StringList.h"
#include "debug.h"
#include <cstdlib>
using namespace std;
StringList::StringList(){
......
/* Generic time.h */
/* $OpenLDAP$ */
/*
* Copyright 1998-2007 The OpenLDAP Foundation, Redwood City, California, USA
* Copyright 1998-2008 The OpenLDAP Foundation, Redwood City, California, USA
* All rights reserved.
*
* Redistribution and use in source and binary forms are permitted only
......
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.