Ignore:
Timestamp:
Nov 27, 2012, 4:43:17 PM (13 years ago)
Author:
Silvan Scherrer
Message:

Samba Server: updated trunk to 3.6.0

Location:
trunk/server
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/server

  • trunk/server/source3/include/smbldap.h

    r414 r745  
    2323
    2424struct smbldap_state;
     25
     26#include "smb_ldap.h"
    2527
    2628#ifdef HAVE_LDAP
     
    4244#define LDAP_OBJ_TRUST_PASSWORD         "sambaTrustPassword"
    4345#define LDAP_OBJ_TRUSTDOM_PASSWORD      "sambaTrustedDomainPassword"
     46#define LDAP_OBJ_TRUSTED_DOMAIN         "sambaTrustedDomain"
    4447
    4548#define LDAP_OBJ_ACCOUNT                "account"
     
    136139const char** get_attr_list( TALLOC_CTX *mem_ctx, ATTRIB_MAP_ENTRY table[] );
    137140void smbldap_set_mod (LDAPMod *** modlist, int modop, const char *attribute, const char *value);
     141void smbldap_set_mod_blob(LDAPMod *** modlist, int modop, const char *attribute, const DATA_BLOB *newblob);
    138142void smbldap_make_mod(LDAP *ldap_struct, LDAPMessage *existing,
    139143                      LDAPMod ***mods,
    140144                      const char *attribute, const char *newval);
     145void smbldap_make_mod_blob(LDAP *ldap_struct, LDAPMessage *existing,
     146                           LDAPMod ***mods,
     147                           const char *attribute, const DATA_BLOB *newblob);
    141148bool smbldap_get_single_attribute (LDAP * ldap_struct, LDAPMessage * entry,
    142149                                   const char *attribute, char *value,
     
    154161        LDAP *ldap_struct;
    155162        pid_t pid;
    156         time_t last_ping;
     163        time_t last_ping; /* monotonic */
    157164        /* retrive-once info */
    158165        const char *uri;
     
    167174        unsigned int num_failures;
    168175
    169         time_t last_use;
     176        time_t last_use; /* monotonic */
    170177        struct event_context *event_context;
    171178        struct timed_event *idle_event;
    172179
    173         struct timeval last_rebind;
     180        struct timeval last_rebind; /* monotonic */
    174181};
    175182
    176183/* struct used by both pdb_ldap.c and pdb_nds.c */
     184
     185struct ipasam_privates;
    177186
    178187struct ldapsam_privates {
     
    185194
    186195        const char *domain_name;
    187         DOM_SID domain_sid;
     196        struct dom_sid domain_sid;
    188197
    189198        /* configuration items */
     
    194203        /* Is this NDS ldap? */
    195204        int is_nds_ldap;
     205
     206        /* Is this IPA ldap? */
     207        int is_ipa_ldap;
     208        struct ipasam_privates *ipasam_privates;
    196209
    197210        /* ldap server location parameter */
     
    205218
    206219/* Functions shared between pdb_ldap.c and pdb_nds.c. */
     220struct pdb_methods;
    207221NTSTATUS pdb_init_ldapsam_compat( struct pdb_methods **pdb_method, const char *location);
    208222void private_data_free_fn(void **result);
     
    232246char *smbldap_talloc_dn(TALLOC_CTX *mem_ctx, LDAP *ld,
    233247                              LDAPMessage *entry);
    234 
    235 
    236 #else
    237 #define LDAP void
    238 #define LDAPMod void
    239 #define LDAP_CONST const
    240 #define LDAPControl void
    241 struct berval;
    242 struct ldapsam_privates;
     248LDAP *priv2ld(struct ldapsam_privates *priv);
     249
     250/* The following definitions come from lib/smbldap.c  */
     251
     252int smb_ldap_start_tls(LDAP *ldap_struct, int version);
     253int smb_ldap_setup_full_conn(LDAP **ldap_struct, const char *uri);
     254int smbldap_search(struct smbldap_state *ldap_state,
     255                   const char *base, int scope, const char *filter,
     256                   const char *attrs[], int attrsonly,
     257                   LDAPMessage **res);
     258int smbldap_search_paged(struct smbldap_state *ldap_state,
     259                         const char *base, int scope, const char *filter,
     260                         const char **attrs, int attrsonly, int pagesize,
     261                         LDAPMessage **res, void **cookie);
     262int smbldap_modify(struct smbldap_state *ldap_state, const char *dn, LDAPMod *attrs[]);
     263int smbldap_add(struct smbldap_state *ldap_state, const char *dn, LDAPMod *attrs[]);
     264int smbldap_delete(struct smbldap_state *ldap_state, const char *dn);
     265int smbldap_extended_operation(struct smbldap_state *ldap_state,
     266                               LDAP_CONST char *reqoid, struct berval *reqdata,
     267                               LDAPControl **serverctrls, LDAPControl **clientctrls,
     268                               char **retoidp, struct berval **retdatap);
     269int smbldap_search_suffix (struct smbldap_state *ldap_state,
     270                           const char *filter, const char **search_attr,
     271                           LDAPMessage ** result);
     272void smbldap_free_struct(struct smbldap_state **ldap_state) ;
     273NTSTATUS smbldap_init(TALLOC_CTX *mem_ctx, struct event_context *event_ctx,
     274                      const char *location,
     275                      struct smbldap_state **smbldap_state);
     276bool smbldap_has_control(LDAP *ld, const char *control);
     277bool smbldap_has_extension(LDAP *ld, const char *extension);
     278bool smbldap_has_naming_context(LDAP *ld, const char *naming_context);
     279bool smbldap_set_creds(struct smbldap_state *ldap_state, bool anon, const char *dn, const char *secret);
     280
     281/* The following definitions come from lib/smbldap_util.c  */
     282
     283NTSTATUS smbldap_search_domain_info(struct smbldap_state *ldap_state,
     284                                    LDAPMessage ** result, const char *domain_name,
     285                                    bool try_add);
     286
    243287#endif  /* HAVE_LDAP */
    244288
     
    247291#define LDAP_PAGE_SIZE 1024
    248292
     293#define ADS_PAGE_CTL_OID        "1.2.840.113556.1.4.319"
     294
     295/*
     296 * Work around versions of the LDAP client libs that don't have the OIDs
     297 * defined, or have them defined under the old name.
     298 * This functionality is really a factor of the server, not the client
     299 *
     300 */
     301
     302#if defined(LDAP_EXOP_X_MODIFY_PASSWD) && !defined(LDAP_EXOP_MODIFY_PASSWD)
     303#define LDAP_EXOP_MODIFY_PASSWD LDAP_EXOP_X_MODIFY_PASSWD
     304#elif !defined(LDAP_EXOP_MODIFY_PASSWD)
     305#define LDAP_EXOP_MODIFY_PASSWD "1.3.6.1.4.1.4203.1.11.1"
     306#endif
     307
     308#if defined(LDAP_EXOP_X_MODIFY_PASSWD_ID) && !defined(LDAP_EXOP_MODIFY_PASSWD_ID)
     309#define LDAP_TAG_EXOP_MODIFY_PASSWD_ID LDAP_EXOP_X_MODIFY_PASSWD_ID
     310#elif !defined(LDAP_EXOP_MODIFY_PASSWD_ID)
     311#define LDAP_TAG_EXOP_MODIFY_PASSWD_ID        ((ber_tag_t) 0x80U)
     312#endif
     313
     314#if defined(LDAP_EXOP_X_MODIFY_PASSWD_NEW) && !defined(LDAP_EXOP_MODIFY_PASSWD_NEW)
     315#define LDAP_TAG_EXOP_MODIFY_PASSWD_NEW LDAP_EXOP_X_MODIFY_PASSWD_NEW
     316#elif !defined(LDAP_EXOP_MODIFY_PASSWD_NEW)
     317#define LDAP_TAG_EXOP_MODIFY_PASSWD_NEW       ((ber_tag_t) 0x82U)
     318#endif
     319
    249320#endif  /* _SMBLDAP_H */
Note: See TracChangeset for help on using the changeset viewer.