@ -1,5 +1,5 @@
/***************************************************************************
/***************************************************************************
* Copyright ( C ) 2012 - 201 3 by Timothy Pearson *
* Copyright ( C ) 2012 - 201 5 by Timothy Pearson *
* kb9vqf @ pearsoncomputing . net *
* kb9vqf @ pearsoncomputing . net *
* *
* *
* This program is free software ; you can redistribute it and / or modify *
* This program is free software ; you can redistribute it and / or modify *
@ -21,16 +21,19 @@
# ifndef _LIBTDELDAP_H_
# ifndef _LIBTDELDAP_H_
# define _LIBTDELDAP_H_
# define _LIBTDELDAP_H_
# include <stdint.h>
# include <unistd.h>
# include <unistd.h>
# include <sys/stat.h>
# include <sys/stat.h>
# include <ldap.h>
# include <ldap.h>
# include <kadm5/admin.h>
# include <tqobject.h>
# include <tqobject.h>
# include <tqstring.h>
# include <tqstring.h>
# include <tqdatetime.h>
# include <tqdatetime.h>
# include <tqvaluelist.h>
# include <tqvaluelist.h>
# include <tqfile.h>
# include < k simpleconfig.h>
# include < tde simpleconfig.h>
// FIXME
// FIXME
// Connect this to CMake/Automake
// Connect this to CMake/Automake
@ -47,6 +50,8 @@
# define KERBEROS_PKI_PEM_FILE KERBEROS_PKI_ANCHORDIR "tdeca.pem"
# define KERBEROS_PKI_PEM_FILE KERBEROS_PKI_ANCHORDIR "tdeca.pem"
# define KERBEROS_PKI_PEMKEY_FILE KERBEROS_PKI_ANCHORDIR "tdeca.key.pem"
# define KERBEROS_PKI_PEMKEY_FILE KERBEROS_PKI_ANCHORDIR "tdeca.key.pem"
# define KERBEROS_PKI_CRL_FILE KERBEROS_PKI_ANCHORDIR "tdecrl.pem"
# define KERBEROS_PKI_CRLDB_FILE KERBEROS_PKI_ANCHORDIR "tdecrl.db"
# define KERBEROS_PKI_KDC_FILE KERBEROS_PKI_PUBLICDIR "@@@KDCSERVER@@@.pki.crt"
# define KERBEROS_PKI_KDC_FILE KERBEROS_PKI_PUBLICDIR "@@@KDCSERVER@@@.pki.crt"
# define KERBEROS_PKI_KDCKEY_FILE KERBEROS_PKI_PRIVATEDIR "@@@KDCSERVER@@@.pki.key"
# define KERBEROS_PKI_KDCKEY_FILE KERBEROS_PKI_PRIVATEDIR "@@@KDCSERVER@@@.pki.key"
# define KERBEROS_PKI_KDCREQ_FILE KERBEROS_PKI_PRIVATEDIR "@@@KDCSERVER@@@.pki.req"
# define KERBEROS_PKI_KDCREQ_FILE KERBEROS_PKI_PRIVATEDIR "@@@KDCSERVER@@@.pki.req"
@ -54,14 +59,23 @@
# define LDAP_CERT_FILE KERBEROS_PKI_PUBLICDIR "@@@ADMINSERVER@@@.ldap.crt"
# define LDAP_CERT_FILE KERBEROS_PKI_PUBLICDIR "@@@ADMINSERVER@@@.ldap.crt"
# define LDAP_CERTKEY_FILE KERBEROS_PKI_PRIVATEDIR "@@@ADMINSERVER@@@.ldap.key"
# define LDAP_CERTKEY_FILE KERBEROS_PKI_PRIVATEDIR "@@@ADMINSERVER@@@.ldap.key"
# define LDAP_CERTREQ_FILE KERBEROS_PKI_PRIVATEDIR "@@@ADMINSERVER@@@.ldap.req"
# define LDAP_CERTREQ_FILE KERBEROS_PKI_PRIVATEDIR "@@@ADMINSERVER@@@.ldap.req"
# define LDAP_CERTREVOC_FILE KERBEROS_PKI_PUBLICDIR "@@@ADMINSERVER@@@.ldap.crl"
# define OPENSSL_EXTENSIONS_FILE TDE_CERTIFICATE_DIR " pki_ext ension s"
# define OPENSSL_EXTENSIONS_FILE TDE_CERTIFICATE_DIR " o penssl.cfg "
# define DEFAULT_IGNORED_USERS_LIST "avahi,avahi-autoipd,backup,bin,colord,daemon,games,gnats,haldaemon,hplip,irc,klog,landscape,libuuid,list,lp,mail,man,messagebus,news,ntp,polkituser,postfix,proxy,pulse,root,rtkit,saned,sshd,statd,sync,sys,syslog,timidity,usbmux,uucp,www-data"
# define DEFAULT_IGNORED_USERS_LIST "avahi,avahi-autoipd,backup,bin,colord,daemon,games,gnats,haldaemon,hplip,irc,klog,landscape,libuuid,list,lp,mail,man,messagebus,news,ntp,polkituser,postfix,proxy,pulse,root,rtkit,saned,sshd,statd,sync,sys,syslog,timidity,usbmux,uucp,www-data"
# define CRON_UPDATE_PRIMARY_REALM_CERTIFICATES_FILE " / etc / cron.daily / tde-upd-pri-rlm-certs"
# define CRON_UPDATE_PRIMARY_REALM_CERTIFICATES_FILE " / etc / cron.daily / tde-upd-pri-rlm-certs"
# define CRON_UPDATE_PRIMARY_REALM_CERTIFICATES_COMMAND TDE_BINDIR " / primaryrccertupdater"
# define CRON_UPDATE_PRIMARY_REALM_CERTIFICATES_COMMAND TDE_BINDIR " / primaryrccertupdater"
// 1 year
# define KERBEROS_PKI_PEMKEY_EXPIRY_DAYS 365
// 1 month
# define KERBEROS_PKI_CRL_EXPIRY_DAYS 30
# define KERBEROS_PKI_KRB_EXPIRY_DAYS 30
# define KERBEROS_PKI_LDAP_EXPIRY_DAYS 30
// Values from hdb.asn1
// Values from hdb.asn1
enum LDAPKRB5Flags {
enum LDAPKRB5Flags {
KRB5_INITIAL = 0x00000001 ,
KRB5_INITIAL = 0x00000001 ,
@ -141,7 +155,20 @@ inline KRB5TicketFlags operator&(KRB5TicketFlags a, KRB5TicketFlags b)
typedef TQValueList < uid_t > UserList ;
typedef TQValueList < uid_t > UserList ;
typedef TQValueList < gid_t > GroupList ;
typedef TQValueList < gid_t > GroupList ;
class LDAPCredentials
namespace PKICertificateStatus {
enum PKICertificateStatusEnum {
Invalid = 0 ,
Valid = 1 ,
Revoked = 2
} ;
}
typedef TQValueList < TQByteArray > TQByteArrayList ;
typedef TQPair < uint32_t , TQByteArray > PKICertificateEntry ;
typedef TQValueList < PKICertificateEntry > PKICertificateEntryList ;
class TDE_EXPORT LDAPCredentials
{
{
public :
public :
LDAPCredentials ( ) ;
LDAPCredentials ( ) ;
@ -149,15 +176,16 @@ class LDAPCredentials
public :
public :
TQString username ;
TQString username ;
TQ C String password ;
TQ String password ;
TQString realm ;
TQString realm ;
bool use_tls ;
bool use_tls ;
bool use_gssapi ;
bool use_gssapi ;
bool use_smartcard ;
TQString service ;
TQString service ;
} ;
} ;
// PRIVATE
// PRIVATE
class LDAPRealmConfig
class TDE_EXPORT LDAPRealmConfig
{
{
public :
public :
TQString name ;
TQString name ;
@ -173,11 +201,16 @@ class LDAPRealmConfig
bool pkinit_require_krbtgt_otherName ;
bool pkinit_require_krbtgt_otherName ;
bool win2k_pkinit ;
bool win2k_pkinit ;
bool win2k_pkinit_require_binding ;
bool win2k_pkinit_require_binding ;
TQString certificate_revocation_list_url ;
} ;
} ;
// PRIVATE
// PRIVATE
class LDAPCertConfig
class TDE_EXPORT LDAPCertConfig
{
{
public :
LDAPCertConfig ( ) ;
~ LDAPCertConfig ( ) ;
public :
public :
bool generate_certs ;
bool generate_certs ;
TQString provided_kerberos_pem ;
TQString provided_kerberos_pem ;
@ -187,6 +220,11 @@ class LDAPCertConfig
TQString provided_ldap_crt ;
TQString provided_ldap_crt ;
TQString provided_ldap_key ;
TQString provided_ldap_key ;
int caExpiryDays ;
int caCrlExpiryDays ;
int kerberosExpiryDays ;
int ldapExpiryDays ;
TQString countryName ;
TQString countryName ;
TQString stateOrProvinceName ;
TQString stateOrProvinceName ;
TQString localityName ;
TQString localityName ;
@ -197,13 +235,15 @@ class LDAPCertConfig
} ;
} ;
// PRIVATE
// PRIVATE
class LDAPPamConfig
class TDE_EXPORT LDAPPamConfig
{
{
public :
public :
LDAPPamConfig ( ) ;
LDAPPamConfig ( ) ;
~ LDAPPamConfig ( ) ;
~ LDAPPamConfig ( ) ;
public :
public :
bool enable_pkcs11_login ;
int pkcs11_login_card_slot ;
bool enable_cached_credentials ;
bool enable_cached_credentials ;
bool autocreate_user_directories_enable ;
bool autocreate_user_directories_enable ;
mode_t autocreate_user_directories_umask ;
mode_t autocreate_user_directories_umask ;
@ -211,7 +251,7 @@ class LDAPPamConfig
} ;
} ;
// PRIVATE
// PRIVATE
class LDAPClientRealmConfig
class TDE_EXPORT LDAPClientRealmConfig
{
{
public :
public :
bool enable_bonding ;
bool enable_bonding ;
@ -234,7 +274,7 @@ class LDAPClientRealmConfig
typedef TQMap < TQString , LDAPRealmConfig > LDAPRealmConfigList ;
typedef TQMap < TQString , LDAPRealmConfig > LDAPRealmConfigList ;
class LDAPUserInfo
class TDE_EXPORT LDAPUserInfo
{
{
public :
public :
LDAPUserInfo ( ) ;
LDAPUserInfo ( ) ;
@ -252,7 +292,7 @@ class LDAPUserInfo
gid_t primary_gid ;
gid_t primary_gid ;
bool tde_builtin_account ;
bool tde_builtin_account ;
LDAPKRB5Flags status ; // Default active user is 586 [KRB5_ACTIVE_DEFAULT] and locked out user is 7586 [KRB5_DISABLED_ACCOUNT]
LDAPKRB5Flags status ; // Default active user is 586 [KRB5_ACTIVE_DEFAULT] and locked out user is 7586 [KRB5_DISABLED_ACCOUNT]
TQ C String new_password ;
TQ String new_password ;
TQDateTime account_created ;
TQDateTime account_created ;
TQDateTime account_modified ;
TQDateTime account_modified ;
TQDateTime password_last_changed ;
TQDateTime password_last_changed ;
@ -312,9 +352,12 @@ class LDAPUserInfo
TQString businessCategory ;
TQString businessCategory ;
TQString carLicense ;
TQString carLicense ;
TQString notes ;
TQString notes ;
// PKI
PKICertificateEntryList pkiCertificates ;
} ;
} ;
class LDAPGroupInfo
class TDE_EXPORT LDAPGroupInfo
{
{
public :
public :
LDAPGroupInfo ( ) ;
LDAPGroupInfo ( ) ;
@ -331,7 +374,7 @@ class LDAPGroupInfo
TQStringList userlist ;
TQStringList userlist ;
} ;
} ;
class LDAPMachineInfo
class TDE_EXPORT LDAPMachineInfo
{
{
public :
public :
LDAPMachineInfo ( ) ;
LDAPMachineInfo ( ) ;
@ -348,7 +391,7 @@ class LDAPMachineInfo
LDAPKRB5Flags status ; // Default is 126 [KRB5_MACHINE_ACCOUNT_DEFAULT]
LDAPKRB5Flags status ; // Default is 126 [KRB5_MACHINE_ACCOUNT_DEFAULT]
} ;
} ;
class LDAPServiceInfo
class TDE_EXPORT LDAPServiceInfo
{
{
public :
public :
LDAPServiceInfo ( ) ;
LDAPServiceInfo ( ) ;
@ -366,7 +409,7 @@ class LDAPServiceInfo
LDAPKRB5Flags status ; // Default is 126 [KRB5_SERVICE_PRINCIPAL_DEFAULT]
LDAPKRB5Flags status ; // Default is 126 [KRB5_SERVICE_PRINCIPAL_DEFAULT]
} ;
} ;
class LDAPTDEBuiltinsInfo
class TDE_EXPORT LDAPTDEBuiltinsInfo
{
{
public :
public :
LDAPTDEBuiltinsInfo ( ) ;
LDAPTDEBuiltinsInfo ( ) ;
@ -380,7 +423,7 @@ class LDAPTDEBuiltinsInfo
TQString builtinStandardUserGroup ;
TQString builtinStandardUserGroup ;
} ;
} ;
class LDAPMasterReplicationMapping
class TDE_EXPORT LDAPMasterReplicationMapping
{
{
public :
public :
LDAPMasterReplicationMapping ( ) ;
LDAPMasterReplicationMapping ( ) ;
@ -393,7 +436,7 @@ class LDAPMasterReplicationMapping
typedef TQValueList < LDAPMasterReplicationMapping > LDAPMasterReplicationMap ;
typedef TQValueList < LDAPMasterReplicationMapping > LDAPMasterReplicationMap ;
class LDAPMasterReplicationInfo
class TDE_EXPORT LDAPMasterReplicationInfo
{
{
public :
public :
LDAPMasterReplicationInfo ( ) ;
LDAPMasterReplicationInfo ( ) ;
@ -407,14 +450,14 @@ class LDAPMasterReplicationInfo
int timeout ;
int timeout ;
int syncMethod ;
int syncMethod ;
TQString syncDN ;
TQString syncDN ;
TQ C String syncPassword ;
TQ String syncPassword ;
TQString certificateFile ;
TQString certificateFile ;
TQString caCertificateFile ;
TQString caCertificateFile ;
bool ignore_ssl_failure ;
bool ignore_ssl_failure ;
bool replicate_olcGlobal ;
bool replicate_olcGlobal ;
} ;
} ;
class KerberosTicketInfo
class TDE_EXPORT KerberosTicketInfo
{
{
public :
public :
KerberosTicketInfo ( ) ;
KerberosTicketInfo ( ) ;
@ -445,8 +488,8 @@ typedef TQValueList<KerberosTicketInfo> KerberosTicketInfoList;
class PtyProcess ;
class PtyProcess ;
class LDAPManager : public TQObject {
class TDE_EXPORT LDAPManager : public TQObject {
Q_OBJECT
T Q_OBJECT
public :
public :
LDAPManager ( TQString realm , TQString host , TQObject * parent = 0 , const char * name = 0 ) ;
LDAPManager ( TQString realm , TQString host , TQObject * parent = 0 , const char * name = 0 ) ;
@ -479,37 +522,54 @@ class LDAPManager : public TQObject {
int deleteServiceInfo ( LDAPServiceInfo service , TQString * errstr = 0 ) ;
int deleteServiceInfo ( LDAPServiceInfo service , TQString * errstr = 0 ) ;
int exportKeytabForPrincipal ( TQString principal , TQString fileName , TQString * errstr = 0 ) ;
int exportKeytabForPrincipal ( TQString principal , TQString fileName , TQString * errstr = 0 ) ;
int deleteKeytabEntriesForPrincipal ( TQString principal , TQString fileName , TQString * errstr = 0 ) ;
LDAPCredentials currentLDAPCredentials ( ) ;
LDAPCredentials currentLDAPCredentials ( bool inferGSSAPIData = false ) ;
int moveKerberosEntries ( TQString newSuffix , TQString * errstr = 0 ) ;
int moveKerberosEntries ( TQString newSuffix , TQString * errstr = 0 ) ;
int writeCertificateFileIntoDirectory ( TQByteArray cert , TQString attr , TQString * errstr = 0 ) ;
int writeCertificateFileIntoDirectory ( TQByteArray cert , TQString attr , TQString * errstr = 0 ) ;
int writePKICertificateFilesIntoDirectory ( LDAPUserInfo user , TQString attr , TQString * errstr = 0 ) ;
TQString getRealmCAMaster ( TQString * errstr = 0 ) ;
TQString getRealmCAMaster ( TQString * errstr = 0 ) ;
int setRealmCAMaster ( TQString masterFQDN , TQString * errstr = 0 ) ;
int setRealmCAMaster ( TQString masterFQDN , TQString * errstr = 0 ) ;
int getLdapCertificateStoreAttribute ( TQString attribute , TQString * value , TQString * errstr = 0 ) ;
int setLdapCertificateStoreAttribute ( TQString attribute , TQString value , TQString * errstr = 0 ) ;
LDAPTDEBuiltinsInfo getTDEBuiltinMappings ( TQString * errstr = 0 ) ;
LDAPTDEBuiltinsInfo getTDEBuiltinMappings ( TQString * errstr = 0 ) ;
LDAPMasterReplicationInfo getLDAPMasterReplicationSettings ( TQString * errstr = 0 ) ;
LDAPMasterReplicationInfo getLDAPMasterReplicationSettings ( TQString * errstr = 0 ) ;
int setLDAPMasterReplicationSettings ( LDAPMasterReplicationInfo replicationinfo , TQString * errstr = 0 ) ;
int setLDAPMasterReplicationSettings ( LDAPMasterReplicationInfo replicationinfo , TQString * errstr = 0 ) ;
int writeSudoersConfFile ( TQString * errstr = 0 ) ;
int writeSudoersConfFile ( TQString * errstr = 0 ) ;
int getTDECertificate ( TQString certificateName , TQFile * fileHandle , TQString * errstr = 0 ) ;
int getTDECertificate ( TQString certificateName , TQString fileName , TQString * errstr = 0 ) ;
int getTDECertificate ( TQString certificateName , TQString fileName , TQString * errstr = 0 ) ;
int getTDECertificate ( TQString certificateName , TQByteArray * certificate , TQString * errstr = 0 ) ;
int setPasswordForUser ( LDAPUserInfo user , TQString * errstr ) ;
int setPasswordForUser ( LDAPUserInfo user , TQString * errstr ) ;
static int writePrimaryRealmCertificateUpdateCronFile ( TQString * errstr = 0 ) ;
static int writePrimaryRealmCertificateUpdateCronFile ( TQString * errstr = 0 ) ;
static int installCACertificateInHostCAStore ( TQString * errstr = 0 ) ;
static int retrieveAndInstallCaCrl ( LDAPManager * manager = 0 , TQString * errstr = 0 ) ;
static TQString getMachineFQDN ( ) ;
static TQString getMachineFQDN ( ) ;
static int writeTDERealmList ( LDAPRealmConfigList realms , KSimpleConfig * config , TQString * errstr = 0 ) ;
static int writeTDERealmList ( LDAPRealmConfigList realms , TDESimpleConfig * config , TQString * errstr = 0 ) ;
static LDAPRealmConfigList readTDERealmList ( KSimpleConfig * config , bool disableAllBonds = false ) ;
static LDAPRealmConfigList fetchAndReadTDERealmList ( TQString * defaultRealm = 0 ) ;
static LDAPRealmConfigList readTDERealmList ( TDESimpleConfig * config , bool disableAllBonds = false ) ;
static TQDateTime getCertificateExpiration ( TQString certfile ) ;
static TQDateTime getCertificateExpiration ( TQString certfile ) ;
static TQDateTime getCertificateExpiration ( TQByteArray certfileContents ) ;
static int generatePublicKerberosCACertificate ( LDAPCertConfig certinfo );
static int generatePublicKerberosCACertificate ( LDAPCertConfig certinfo , LDAPRealmConfig realmcfg );
static int generatePublicKerberosCertificate ( LDAPCertConfig certinfo , LDAPRealmConfig realmcfg ) ;
static int generatePublicKerberosCertificate ( LDAPCertConfig certinfo , LDAPRealmConfig realmcfg ) ;
static int generatePublicLDAPCertificate ( LDAPCertConfig certinfo , LDAPRealmConfig realmcfg , uid_t ldap_uid , gid_t ldap_gid ) ;
static int generatePublicLDAPCertificate ( LDAPCertConfig certinfo , LDAPRealmConfig realmcfg , uid_t ldap_uid , gid_t ldap_gid ) ;
static int generateClientCertificatePair ( int expirydays , LDAPUserInfo user , LDAPRealmConfig realmcfg , TQString signingPrivateKeyFile , TQString privateKeyFile , TQString publicCertFile , int clientKeyBitLength = 2048 , TQString autoLoginPIN = TQString : : null , TQString * errstr = 0 ) ;
static int generateClientCertificatePrivateKey ( TQString privateKeyFile , int clientKeyBitLength = 2048 , TQString * errstr = 0 ) ;
static int generateClientCertificatePublicCertificate ( int expirydays , LDAPUserInfo user , LDAPRealmConfig realmcfg , TQString signingPrivateKeyFile , TQString privateKeyFile , TQString publicCertFile , TQString autoLoginPIN = TQString : : null , TQString * errstr = 0 ) ;
int generatePKICRL ( int expirydays , LDAPRealmConfig realmcfg , TQString crlFile , TQString signingPrivateKeyFile , TQString revocationDatabaseFile , TQString * errstr = 0 ) ;
static TQString ldapdnForRealm ( TQString realm ) ;
static TQString ldapdnForRealm ( TQString realm ) ;
static TQString openssldcForRealm ( TQString realm ) ;
static TQString cnFromDn ( TQString dn ) ;
static TQString cnFromDn ( TQString dn ) ;
static KerberosTicketInfoList getKerberosTicketList ( TQString cache = TQString : : null , TQString * cacheFileName = 0 ) ;
static KerberosTicketInfoList getKerberosTicketList ( TQString cache = TQString : : null , TQString * cacheFileName = 0 ) ;
static int getKerberosPassword ( LDAPCredentials & creds , TQString prompt , bool requestServicePrincipal = false , TQWidget * parent = 0 ) ;
static int getKerberosPassword ( LDAPCredentials & creds , TQString prompt , bool requestServicePrincipal = false , bool allowSmartCard = false , TQWidget * parent = 0 ) ;
static int obtainKerberosTicket ( LDAPCredentials creds , TQString principal , TQString * errstr = 0 ) ;
static int obtainKerberosTicket ( LDAPCredentials creds , TQString principal , TQString * errstr = 0 ) ;
static int obtainKerberosServiceTicket ( TQString principal , TQString * errstr = 0 ) ;
static int obtainKerberosServiceTicket ( TQString principal , TQString * errstr = 0 ) ;
static int destroyKerberosTicket ( TQString principal , TQString * errstr = 0 ) ;
static int destroyKerberosTicket ( TQString principal , TQString * errstr = 0 ) ;
@ -517,18 +577,28 @@ class LDAPManager : public TQObject {
static TQString detailedKAdminErrorMessage ( TQString initialMessage ) ;
static TQString detailedKAdminErrorMessage ( TQString initialMessage ) ;
static TQString readFullLineFromPtyProcess ( PtyProcess * proc ) ;
static TQString readFullLineFromPtyProcess ( PtyProcess * proc ) ;
static LDAPClientRealmConfig loadClientRealmConfig ( K SimpleConfig* config , bool useDefaults = false ) ;
static LDAPClientRealmConfig loadClientRealmConfig ( TDE SimpleConfig* config , bool useDefaults = false ) ;
static int saveClientRealmConfig ( LDAPClientRealmConfig clientRealmConfig , K SimpleConfig* config , TQString * errstr = 0 ) ;
static int saveClientRealmConfig ( LDAPClientRealmConfig clientRealmConfig , TDE SimpleConfig* config , TQString * errstr = 0 ) ;
static int writeClientKrb5ConfFile ( LDAPClientRealmConfig clientRealmConfig , LDAPRealmConfigList realmList , TQString * errstr = 0 ) ;
static int writeClientKrb5ConfFile ( LDAPClientRealmConfig clientRealmConfig , LDAPRealmConfigList realmList , TQString * errstr = 0 ) ;
static int writeLDAPConfFile ( LDAPRealmConfig realmcfg , LDAPMachineRole machineRole , TQString * errstr = 0 ) ;
static int writeLDAPConfFile ( LDAPRealmConfig realmcfg , LDAPMachineRole machineRole , TQString * errstr = 0 ) ;
static int writeNSSwitchFile ( TQString * errstr = 0 ) ;
static int writeNSSwitchFile ( TQString * errstr = 0 ) ;
static int writeOpenSSLConfigurationFile ( LDAPRealmConfig realmcfg , TQString * errstr = 0 ) ;
static int writeOpenSSLConfigurationFile ( LDAPRealmConfig realmcfg , LDAPUserInfo user , TQString opensslConfigFile , TQString caRootKeyFile = TQString : : null , TQString caRootCertFile = TQString : : null , TQString caRootDatabaseFile = TQString : : null , TQString autoLoginPIN = TQString : : null , TQString * errstr = 0 ) ;
static int writeClientCronFiles ( TQString * errstr = 0 ) ;
static int writeClientCronFiles ( TQString * errstr = 0 ) ;
static int rehashClientPKCSCertificates ( TQString * errstr = 0 ) ;
static int writePAMFiles ( LDAPPamConfig pamConfig , TQString * errstr = 0 ) ;
static int writePAMFiles ( LDAPPamConfig pamConfig , TQString * errstr = 0 ) ;
static bool pkcsLoginEnabled ( ) ;
static int bondRealm ( TQString adminUserName , const char * adminPassword , TQString adminRealm , TQString * errstr = 0 ) ;
static int bondRealm ( const TQString & adminUserName , const TQString & adminPassword ,
static int unbondRealm ( LDAPRealmConfig realmcfg , TQString adminUserName , const char * adminPassword , TQString adminRealm , TQString * errstr = 0 ) ;
const TQString & adminRealm , TQString * errstr = 0 ) ;
static int unbondRealm ( LDAPRealmConfig realmcfg , const TQString & adminUserName ,
const TQString & adminPassword , const TQString & adminRealm , TQString * errstr = 0 ) ;
private :
private :
int bindKAdmin ( LDAPCredentials * administrativeCredentials = NULL , TQString * errstr = 0 ) ;
int unbindKAdmin ( TQString * errstr = 0 ) ;
int kAdminAddNewPrincipal ( TQString principalName , TQString newPassword , TQString * errstr = 0 ) ;
int kAdminDeletePrincipal ( TQString principalName , TQString * errstr = 0 ) ;
LDAPUserInfo parseLDAPUserRecord ( LDAPMessage * entry ) ;
LDAPUserInfo parseLDAPUserRecord ( LDAPMessage * entry ) ;
LDAPGroupInfo parseLDAPGroupRecord ( LDAPMessage * entry ) ;
LDAPGroupInfo parseLDAPGroupRecord ( LDAPMessage * entry ) ;
LDAPMachineInfo parseLDAPMachineRecord ( LDAPMessage * entry ) ;
LDAPMachineInfo parseLDAPMachineRecord ( LDAPMessage * entry ) ;
@ -537,6 +607,7 @@ class LDAPManager : public TQObject {
LDAPMasterReplicationInfo parseLDAPMasterReplicationRecord ( LDAPMasterReplicationInfo replicationinfo , LDAPMessage * entry ) ;
LDAPMasterReplicationInfo parseLDAPMasterReplicationRecord ( LDAPMasterReplicationInfo replicationinfo , LDAPMessage * entry ) ;
TQString parseLDAPSyncProvOverlayConfigRecord ( LDAPMessage * entry ) ;
TQString parseLDAPSyncProvOverlayConfigRecord ( LDAPMessage * entry ) ;
bool parseLDAPTDEStringAttribute ( LDAPMessage * entry , TQString attribute , TQString & retval ) ;
bool parseLDAPTDEStringAttribute ( LDAPMessage * entry , TQString attribute , TQString & retval ) ;
static TQString getOpenSSLVersion ( ) ;
private :
private :
TQString m_realm ;
TQString m_realm ;
@ -545,6 +616,12 @@ class LDAPManager : public TQObject {
TQString m_basedc ;
TQString m_basedc ;
LDAPCredentials * m_creds ;
LDAPCredentials * m_creds ;
LDAP * m_ldap ;
LDAP * m_ldap ;
// kadmin interface
krb5_context m_krb5admContext ;
void * m_krb5admHandle ;
char * m_krb5admKeytabFilename ;
char * m_krb5admRealmName ;
} ;
} ;
# endif // _LIBTDELDAP_H_
# endif // _LIBTDELDAP_H_