Ignore:
Timestamp:
Nov 14, 2012, 12:59:34 PM (12 years ago)
Author:
Silvan Scherrer
Message:

Samba Server: update vendor to 3.6.0

File:
1 edited

Legend:

Unmodified
Added
Removed
  • TabularUnified vendor/current/source3/include/passdb.h

    r414 r740  
    2424#define _PASSDB_H
    2525
     26#include "../librpc/gen_ndr/lsa.h"
     27
     28#include "mapping.h"
     29
    2630/**********************************************************************
    2731 * Masks for mappings between unix uid and gid types and
     
    2933 **********************************************************************/
    3034
    31 #define BASE_RID (0x000003E8L)
    32 
    3335/* Take the bottom bit. */
    3436#define RID_TYPE_MASK           1
     
    3840#define USER_RID_TYPE           0
    3941#define GROUP_RID_TYPE          1
     42
     43/*
     44 * Flags for local user manipulation.
     45 */
     46
     47#define LOCAL_ADD_USER 0x1
     48#define LOCAL_DELETE_USER 0x2
     49#define LOCAL_DISABLE_USER 0x4
     50#define LOCAL_ENABLE_USER 0x8
     51#define LOCAL_TRUST_ACCOUNT 0x10
     52#define LOCAL_SET_NO_PASSWORD 0x20
     53#define LOCAL_SET_PASSWORD 0x40
     54#define LOCAL_SET_LDAP_ADMIN_PW 0x80
     55#define LOCAL_INTERDOM_ACCOUNT 0x100
     56#define LOCAL_AM_ROOT 0x200  /* Act as root */
     57
     58/*
     59 * Size of new password account encoding string.  This is enough space to
     60 * hold 11 ACB characters, plus the surrounding [] and a terminating null.
     61 * Do not change unless you are adding new ACB bits!
     62 */
     63
     64#define NEW_PW_FORMAT_SPACE_PADDED_LEN 14
     65
     66/* Password history contants. */
     67#define PW_HISTORY_SALT_LEN 16
     68#define SALTED_MD5_HASH_LEN 16
     69#define PW_HISTORY_ENTRY_LEN (PW_HISTORY_SALT_LEN+SALTED_MD5_HASH_LEN)
     70#define MAX_PW_HISTORY_LEN 24
    4071
    4172/*
     
    73104        PDB_BAD_PASSWORD_COUNT,
    74105        PDB_LOGON_COUNT,
     106        PDB_COUNTRY_CODE,
     107        PDB_CODE_PAGE,
    75108        PDB_UNKNOWN6,
    76109        PDB_LMPASSWD,
     
    105138
    106139/* cache for bad password lockout data, to be used on replicated SAMs */
    107 typedef struct logon_cache_struct {
     140struct login_cache {
    108141        time_t entry_timestamp;
    109         uint32 acct_ctrl;
    110         uint16 bad_password_count;
     142        uint32_t acct_ctrl;
     143        uint16_t bad_password_count;
    111144        time_t bad_password_time;
    112 } LOGIN_CACHE;
     145};
    113146
    114147#define SAMU_BUFFER_V0          0
     
    119152#define SAMU_BUFFER_V4          4
    120153#define SAMU_BUFFER_LATEST      SAMU_BUFFER_V4
     154
     155#define MAX_HOURS_LEN 32
    121156
    122157struct samu {
     
    148183        const char *munged_dial;  /* munged path name and dial-back tel number */
    149184
    150         DOM_SID user_sid; 
    151         DOM_SID *group_sid;
     185        struct dom_sid user_sid;
     186        struct dom_sid *group_sid;
    152187
    153188        DATA_BLOB lm_pw; /* .data is Null if no password */
     
    156191        char* plaintext_pw; /* is Null if not available */
    157192
    158         uint32 acct_ctrl; /* account info (ACB_xxxx bit-mask) */
    159         uint32 fields_present; /* 0x00ff ffff */
    160 
    161         uint16 logon_divs; /* 168 - number of hours in a week */
    162         uint32 hours_len; /* normally 21 bytes */
    163         uint8 hours[MAX_HOURS_LEN];
     193        uint32_t acct_ctrl; /* account info (ACB_xxxx bit-mask) */
     194        uint32_t fields_present; /* 0x00ff ffff */
     195
     196        uint16_t logon_divs; /* 168 - number of hours in a week */
     197        uint32_t hours_len; /* normally 21 bytes */
     198        uint8_t hours[MAX_HOURS_LEN];
    164199
    165200        /* Was unknown_5. */
    166         uint16 bad_password_count;
    167         uint16 logon_count;
    168 
    169         uint32 unknown_6; /* 0x0000 04ec */
     201        uint16_t bad_password_count;
     202        uint16_t logon_count;
     203
     204        uint16_t country_code;
     205        uint16_t code_page;
     206
     207        uint32_t unknown_6; /* 0x0000 04ec */
    170208
    171209        /* a tag for who added the private methods */
     
    183221        fstring acct_name; /* account name */
    184222        fstring acct_desc; /* account name */
    185         uint32 rid; /* domain-relative RID */
     223        uint32_t rid; /* domain-relative RID */
    186224};
    187225
    188226struct samr_displayentry {
    189         uint32 idx;
    190         uint32 rid;
    191         uint32 acct_flags;
     227        uint32_t idx;
     228        uint32_t rid;
     229        uint32_t acct_flags;
    192230        const char *account_name;
    193231        const char *fullname;
     
    204242        enum pdb_search_type type;
    205243        struct samr_displayentry *cache;
    206         uint32 num_entries;
     244        uint32_t num_entries;
    207245        ssize_t cache_size;
    208246        bool search_ended;
     
    219257        struct dom_sid sid;
    220258        struct GUID guid;
     259};
     260
     261struct pdb_trusted_domain {
     262        char *domain_name;
     263        char *netbios_name;
     264        struct dom_sid security_identifier;
     265        DATA_BLOB trust_auth_incoming;
     266        DATA_BLOB trust_auth_outgoing;
     267        uint32_t trust_direction;
     268        uint32_t trust_type;
     269        uint32_t trust_attributes;
     270        DATA_BLOB trust_forest_trust_info;
     271};
     272
     273/*
     274 * trusted domain entry/entries returned by secrets_get_trusted_domains
     275 * (used in _lsa_enum_trust_dom call)
     276 */
     277struct trustdom_info {
     278        char *name;
     279        struct dom_sid sid;
    221280};
    222281
     
    237296};
    238297
    239 #define PDB_CAP_STORE_RIDS      0x0001
    240 #define PDB_CAP_ADS             0x0002
     298#define PDB_CAP_STORE_RIDS              0x0001
     299#define PDB_CAP_ADS                     0x0002
     300#define PDB_CAP_TRUSTED_DOMAINS_EX      0x0004
    241301
    242302/*****************************************************************
     
    252312 * the pdb module. Remove the latter, this might happen more often. VL.
    253313 * changed to version 14 to move lookup_rids and lookup_names to return
    254  * enum lsa_SidType rather than uint32.
     314 * enum lsa_SidType rather than uint32_t.
    255315 * Changed to 16 for access to the trusted domain passwords (obnox).
    256316 * Changed to 17, the sampwent interface is gone.
     
    270330        NTSTATUS (*getsampwnam)(struct pdb_methods *, struct samu *sam_acct, const char *username);
    271331
    272         NTSTATUS (*getsampwsid)(struct pdb_methods *, struct samu *sam_acct, const DOM_SID *sid);
     332        NTSTATUS (*getsampwsid)(struct pdb_methods *, struct samu *sam_acct, const struct dom_sid *sid);
    273333
    274334        NTSTATUS (*create_user)(struct pdb_methods *, TALLOC_CTX *tmp_ctx,
    275                                 const char *name, uint32 acct_flags,
    276                                 uint32 *rid);
     335                                const char *name, uint32_t acct_flags,
     336                                uint32_t *rid);
    277337
    278338        NTSTATUS (*delete_user)(struct pdb_methods *, TALLOC_CTX *tmp_ctx,
     
    289349        NTSTATUS (*update_login_attempts)(struct pdb_methods *methods, struct samu *sam_acct, bool success);
    290350
    291         NTSTATUS (*getgrsid)(struct pdb_methods *methods, GROUP_MAP *map, DOM_SID sid);
     351        NTSTATUS (*getgrsid)(struct pdb_methods *methods, GROUP_MAP *map, struct dom_sid sid);
    292352
    293353        NTSTATUS (*getgrgid)(struct pdb_methods *methods, GROUP_MAP *map, gid_t gid);
     
    297357        NTSTATUS (*create_dom_group)(struct pdb_methods *methods,
    298358                                     TALLOC_CTX *mem_ctx, const char *name,
    299                                      uint32 *rid);
     359                                     uint32_t *rid);
    300360
    301361        NTSTATUS (*delete_dom_group)(struct pdb_methods *methods,
    302                                      TALLOC_CTX *mem_ctx, uint32 rid);
     362                                     TALLOC_CTX *mem_ctx, uint32_t rid);
    303363
    304364        NTSTATUS (*add_group_mapping_entry)(struct pdb_methods *methods,
     
    309369
    310370        NTSTATUS (*delete_group_mapping_entry)(struct pdb_methods *methods,
    311                                                DOM_SID sid);
     371                                               struct dom_sid sid);
    312372
    313373        NTSTATUS (*enum_group_mapping)(struct pdb_methods *methods,
    314                                        const DOM_SID *sid, enum lsa_SidType sid_name_use,
     374                                       const struct dom_sid *sid, enum lsa_SidType sid_name_use,
    315375                                       GROUP_MAP **pp_rmap, size_t *p_num_entries,
    316376                                       bool unix_only);
     
    318378        NTSTATUS (*enum_group_members)(struct pdb_methods *methods,
    319379                                       TALLOC_CTX *mem_ctx,
    320                                        const DOM_SID *group,
    321                                        uint32 **pp_member_rids,
     380                                       const struct dom_sid *group,
     381                                       uint32_t **pp_member_rids,
    322382                                       size_t *p_num_members);
    323383
     
    325385                                           TALLOC_CTX *mem_ctx,
    326386                                           struct samu *user,
    327                                            DOM_SID **pp_sids, gid_t **pp_gids,
    328                                            size_t *p_num_groups);
     387                                           struct dom_sid **pp_sids, gid_t **pp_gids,
     388                                           uint32_t *p_num_groups);
    329389
    330390        NTSTATUS (*set_unix_primary_group)(struct pdb_methods *methods,
     
    334394        NTSTATUS (*add_groupmem)(struct pdb_methods *methods,
    335395                                 TALLOC_CTX *mem_ctx,
    336                                  uint32 group_rid, uint32 member_rid);
     396                                 uint32_t group_rid, uint32_t member_rid);
    337397
    338398        NTSTATUS (*del_groupmem)(struct pdb_methods *methods,
    339399                                 TALLOC_CTX *mem_ctx,
    340                                  uint32 group_rid, uint32 member_rid);
     400                                 uint32_t group_rid, uint32_t member_rid);
    341401
    342402        NTSTATUS (*create_alias)(struct pdb_methods *methods,
    343                                  const char *name, uint32 *rid);
     403                                 const char *name, uint32_t *rid);
    344404
    345405        NTSTATUS (*delete_alias)(struct pdb_methods *methods,
    346                                  const DOM_SID *sid);
     406                                 const struct dom_sid *sid);
    347407
    348408        NTSTATUS (*get_aliasinfo)(struct pdb_methods *methods,
    349                                   const DOM_SID *sid,
     409                                  const struct dom_sid *sid,
    350410                                  struct acct_info *info);
    351411
    352412        NTSTATUS (*set_aliasinfo)(struct pdb_methods *methods,
    353                                   const DOM_SID *sid,
     413                                  const struct dom_sid *sid,
    354414                                  struct acct_info *info);
    355415
    356416        NTSTATUS (*add_aliasmem)(struct pdb_methods *methods,
    357                                  const DOM_SID *alias, const DOM_SID *member);
     417                                 const struct dom_sid *alias, const struct dom_sid *member);
    358418        NTSTATUS (*del_aliasmem)(struct pdb_methods *methods,
    359                                  const DOM_SID *alias, const DOM_SID *member);
     419                                 const struct dom_sid *alias, const struct dom_sid *member);
    360420        NTSTATUS (*enum_aliasmem)(struct pdb_methods *methods,
    361                                   const DOM_SID *alias, TALLOC_CTX *mem_ctx,
    362                                   DOM_SID **members, size_t *p_num_members);
     421                                  const struct dom_sid *alias, TALLOC_CTX *mem_ctx,
     422                                  struct dom_sid **members, size_t *p_num_members);
    363423        NTSTATUS (*enum_alias_memberships)(struct pdb_methods *methods,
    364424                                           TALLOC_CTX *mem_ctx,
    365                                            const DOM_SID *domain_sid,
    366                                            const DOM_SID *members,
     425                                           const struct dom_sid *domain_sid,
     426                                           const struct dom_sid *members,
    367427                                           size_t num_members,
    368                                            uint32 **pp_alias_rids,
     428                                           uint32_t **pp_alias_rids,
    369429                                           size_t *p_num_alias_rids);
    370430
    371431        NTSTATUS (*lookup_rids)(struct pdb_methods *methods,
    372                                 const DOM_SID *domain_sid,
     432                                const struct dom_sid *domain_sid,
    373433                                int num_rids,
    374                                 uint32 *rids,
     434                                uint32_t *rids,
    375435                                const char **pp_names,
    376436                                enum lsa_SidType *attrs);
    377437
    378438        NTSTATUS (*lookup_names)(struct pdb_methods *methods,
    379                                  const DOM_SID *domain_sid,
     439                                 const struct dom_sid *domain_sid,
    380440                                 int num_names,
    381441                                 const char **pp_names,
    382                                  uint32 *rids,
     442                                 uint32_t *rids,
    383443                                 enum lsa_SidType *attrs);
    384444
     
    395455        bool (*search_users)(struct pdb_methods *methods,
    396456                             struct pdb_search *search,
    397                              uint32 acct_flags);
     457                             uint32_t acct_flags);
    398458        bool (*search_groups)(struct pdb_methods *methods,
    399459                              struct pdb_search *search);
    400460        bool (*search_aliases)(struct pdb_methods *methods,
    401461                               struct pdb_search *search,
    402                                const DOM_SID *sid);
     462                               const struct dom_sid *sid);
    403463
    404464        bool (*uid_to_sid)(struct pdb_methods *methods, uid_t uid,
    405                            DOM_SID *sid);
     465                           struct dom_sid *sid);
    406466        bool (*gid_to_sid)(struct pdb_methods *methods, gid_t gid,
    407                            DOM_SID *sid);
    408         bool (*sid_to_id)(struct pdb_methods *methods, const DOM_SID *sid,
     467                           struct dom_sid *sid);
     468        bool (*sid_to_id)(struct pdb_methods *methods, const struct dom_sid *sid,
    409469                          union unid_t *id, enum lsa_SidType *type);
    410470
    411471        uint32_t (*capabilities)(struct pdb_methods *methods);
    412         bool (*new_rid)(struct pdb_methods *methods, uint32 *rid);
     472        bool (*new_rid)(struct pdb_methods *methods, uint32_t *rid);
    413473
    414474
    415475        bool (*get_trusteddom_pw)(struct pdb_methods *methods,
    416476                                  const char *domain, char** pwd,
    417                                   DOM_SID *sid, time_t *pass_last_set_time);
     477                                  struct dom_sid *sid, time_t *pass_last_set_time);
    418478        bool (*set_trusteddom_pw)(struct pdb_methods *methods,
    419479                                  const char* domain, const char* pwd,
    420                                   const DOM_SID *sid);
     480                                  const struct dom_sid *sid);
    421481        bool (*del_trusteddom_pw)(struct pdb_methods *methods,
    422482                                  const char *domain);
    423483        NTSTATUS (*enum_trusteddoms)(struct pdb_methods *methods,
    424                                      TALLOC_CTX *mem_ctx, uint32 *num_domains,
     484                                     TALLOC_CTX *mem_ctx, uint32_t *num_domains,
    425485                                     struct trustdom_info ***domains);
     486
     487
     488        NTSTATUS (*get_trusted_domain)(struct pdb_methods *methods,
     489                                       TALLOC_CTX *mem_ctx,
     490                                       const char *domain,
     491                                       struct pdb_trusted_domain **td);
     492        NTSTATUS (*get_trusted_domain_by_sid)(struct pdb_methods *methods,
     493                                              TALLOC_CTX *mem_ctx,
     494                                              struct dom_sid *sid,
     495                                              struct pdb_trusted_domain **td);
     496        NTSTATUS (*set_trusted_domain)(struct pdb_methods *methods,
     497                                       const char* domain,
     498                                       const struct pdb_trusted_domain *td);
     499        NTSTATUS (*del_trusted_domain)(struct pdb_methods *methods,
     500                                       const char *domain);
     501        NTSTATUS (*enum_trusted_domains)(struct pdb_methods *methods,
     502                                         TALLOC_CTX *mem_ctx,
     503                                         uint32_t *num_domains,
     504                                         struct pdb_trusted_domain ***domains);
    426505
    427506        void *private_data;  /* Private data of some kind */
     
    441520};
    442521
     522#include "passdb/proto.h"
     523#include "passdb/machine_sid.h"
     524#include "passdb/lookup_sid.h"
     525
    443526#endif /* _PASSDB_H */
Note: See TracChangeset for help on using the changeset viewer.