Ignore:
Timestamp:
Nov 24, 2016, 1:14:11 PM (9 years ago)
Author:
Silvan Scherrer
Message:

Samba Server: update vendor to version 4.4.3

File:
1 edited

Legend:

Unmodified
Added
Removed
  • vendor/current/source4/auth/auth.h

    r740 r988  
    4444/* version 4 - subsequent samba4 version - metze */
    4545/* version 0 - till samba4 is stable - metze */
    46 #define AUTH_INTERFACE_VERSION 0
    47 
    48 #define AUTH_SESSION_INFO_DEFAULT_GROUPS     0x01 /* Add the user to the default world and network groups */
    49 #define AUTH_SESSION_INFO_AUTHENTICATED      0x02 /* Add the user to the 'authenticated users' group */
    50 #define AUTH_SESSION_INFO_SIMPLE_PRIVILEGES  0x04 /* Use a trivial map between users and privilages, rather than a DB */
     46#define AUTH4_INTERFACE_VERSION 0
    5147
    5248struct auth_method_context;
    5349struct auth_check_password_request;
    54 struct auth_context;
     50struct auth4_context;
    5551struct auth_session_info;
    5652struct ldb_dn;
     53struct smb_krb5_context;
    5754
    5855struct auth_operations {
    5956        const char *name;
    60 
    61         /* If you are using this interface, then you are probably
    62          * getting something wrong.  This interface is only for
    63          * security=server, and makes a number of compromises to allow
    64          * that.  It is not compatible with being a PDC.  */
    65 
    66         NTSTATUS (*get_challenge)(struct auth_method_context *ctx, TALLOC_CTX *mem_ctx, uint8_t chal[8]);
    6757
    6858        /* Given the user supplied info, check if this backend want to handle the password checking */
     
    7969        /* Lookup a 'session info interim' return based only on the principal or DN */
    8070        NTSTATUS (*get_user_info_dc_principal)(TALLOC_CTX *mem_ctx,
    81                                                        struct auth_context *auth_context,
     71                                                       struct auth4_context *auth_context,
    8272                                                       const char *principal,
    8373                                                       struct ldb_dn *user_dn,
    8474                                                       struct auth_user_info_dc **interim_info);
     75        uint32_t flags;
    8576};
    8677
    8778struct auth_method_context {
    8879        struct auth_method_context *prev, *next;
    89         struct auth_context *auth_ctx;
     80        struct auth4_context *auth_ctx;
    9081        const struct auth_operations *ops;
    9182        int depth;
    9283        void *private_data;
    93 };
    94 
    95 struct auth_context {
    96         struct {
    97                 /* Who set this up in the first place? */
    98                 const char *set_by;
    99 
    100                 bool may_be_modified;
    101 
    102                 DATA_BLOB data;
    103         } challenge;
    104 
    105         /* methods, in the order they should be called */
    106         struct auth_method_context *methods;
    107 
    108         /* the event context to use for calls that can block */
    109         struct tevent_context *event_ctx;
    110 
    111         /* the messaging context which can be used by backends */
    112         struct messaging_context *msg_ctx;
    113 
    114         /* loadparm context */
    115         struct loadparm_context *lp_ctx;
    116 
    117         /* SAM database for this local machine - to fill in local groups, or to authenticate local NTLM users */
    118         struct ldb_context *sam_ctx;
    119 
    120         NTSTATUS (*check_password)(struct auth_context *auth_ctx,
    121                                    TALLOC_CTX *mem_ctx,
    122                                    const struct auth_usersupplied_info *user_info,
    123                                    struct auth_user_info_dc **user_info_dc);
    124 
    125         NTSTATUS (*get_challenge)(struct auth_context *auth_ctx, uint8_t chal[8]);
    126 
    127         bool (*challenge_may_be_modified)(struct auth_context *auth_ctx);
    128 
    129         NTSTATUS (*set_challenge)(struct auth_context *auth_ctx, const uint8_t chal[8], const char *set_by);
    130 
    131         NTSTATUS (*get_user_info_dc_principal)(TALLOC_CTX *mem_ctx,
    132                                                        struct auth_context *auth_ctx,
    133                                                        const char *principal,
    134                                                        struct ldb_dn *user_dn,
    135                                                        struct auth_user_info_dc **user_info_dc);
    136 
    137         NTSTATUS (*generate_session_info)(TALLOC_CTX *mem_ctx,
    138                                           struct auth_context *auth_context,
    139                                           struct auth_user_info_dc *user_info_dc,
    140                                           uint32_t session_info_flags,
    141                                           struct auth_session_info **session_info);
    14284};
    14385
     
    15294};
    15395
    154  NTSTATUS encrypt_user_info(TALLOC_CTX *mem_ctx, struct auth_context *auth_context,
     96 NTSTATUS encrypt_user_info(TALLOC_CTX *mem_ctx, struct auth4_context *auth_context,
    15597                           enum auth_password_state to_state,
    15698                           const struct auth_usersupplied_info *user_info_in,
     
    158100
    159101#include "auth/session.h"
     102#include "auth/unix_token_proto.h"
    160103#include "auth/system_session_proto.h"
    161104#include "libcli/security/security.h"
     
    166109struct cli_credentials;
    167110
    168 NTSTATUS auth_get_challenge(struct auth_context *auth_ctx, uint8_t chal[8]);
     111NTSTATUS auth_get_challenge(struct auth4_context *auth_ctx, uint8_t chal[8]);
    169112NTSTATUS authsam_account_ok(TALLOC_CTX *mem_ctx,
    170113                            struct ldb_context *sam_ctx,
     
    176119                            bool allow_domain_trust,
    177120                            bool password_change);
    178 NTSTATUS authsam_expand_nested_groups(struct ldb_context *sam_ctx,
    179                                       struct ldb_val *dn_val, const bool only_childs, const char *filter,
    180                                       TALLOC_CTX *res_sids_ctx, struct dom_sid ***res_sids,
    181                                       unsigned int *num_res_sids);
     121
    182122struct auth_session_info *system_session(struct loadparm_context *lp_ctx);
    183123NTSTATUS authsam_make_user_info_dc(TALLOC_CTX *mem_ctx, struct ldb_context *sam_ctx,
     
    192132                                           struct auth_session_info **_session_info) ;
    193133
    194 NTSTATUS auth_context_create_methods(TALLOC_CTX *mem_ctx, const char **methods,
     134NTSTATUS auth_context_create_methods(TALLOC_CTX *mem_ctx, const char * const *methods,
    195135                                     struct tevent_context *ev,
    196                                      struct messaging_context *msg,
     136                                     struct imessaging_context *msg,
    197137                                     struct loadparm_context *lp_ctx,
    198138                                     struct ldb_context *sam_ctx,
    199                                      struct auth_context **auth_ctx);
     139                                     struct auth4_context **auth_ctx);
    200140const char **auth_methods_from_lp(TALLOC_CTX *mem_ctx, struct loadparm_context *lp_ctx);
    201141
    202142NTSTATUS auth_context_create(TALLOC_CTX *mem_ctx,
    203143                             struct tevent_context *ev,
    204                              struct messaging_context *msg,
     144                             struct imessaging_context *msg,
    205145                             struct loadparm_context *lp_ctx,
    206                              struct auth_context **auth_ctx);
    207 NTSTATUS auth_context_create_from_ldb(TALLOC_CTX *mem_ctx, struct ldb_context *ldb, struct auth_context **auth_ctx);
     146                             struct auth4_context **auth_ctx);
    208147
    209 NTSTATUS auth_check_password(struct auth_context *auth_ctx,
     148NTSTATUS auth_check_password_wrapper(struct auth4_context *auth_ctx,
    210149                             TALLOC_CTX *mem_ctx,
    211                              const struct auth_usersupplied_info *user_info,
     150                             const struct auth_usersupplied_info *user_info,
     151                             void **server_returned_info,
     152                             DATA_BLOB *user_session_key, DATA_BLOB *lm_session_key);
     153
     154NTSTATUS auth_check_password(struct auth4_context *auth_ctx,
     155                             TALLOC_CTX *mem_ctx,
     156                             const struct auth_usersupplied_info *user_info,
    212157                             struct auth_user_info_dc **user_info_dc);
    213158NTSTATUS auth4_init(void);
     
    216161NTSTATUS authenticate_username_pw(TALLOC_CTX *mem_ctx,
    217162                                  struct tevent_context *ev,
    218                                   struct messaging_context *msg,
     163                                  struct imessaging_context *msg,
    219164                                  struct loadparm_context *lp_ctx,
    220165                                  const char *nt4_domain,
     
    226171struct tevent_req *auth_check_password_send(TALLOC_CTX *mem_ctx,
    227172                                            struct tevent_context *ev,
    228                                             struct auth_context *auth_ctx,
     173                                            struct auth4_context *auth_ctx,
    229174                                            const struct auth_usersupplied_info *user_info);
    230175NTSTATUS auth_check_password_recv(struct tevent_req *req,
     
    232177                                  struct auth_user_info_dc **user_info_dc);
    233178
    234 bool auth_challenge_may_be_modified(struct auth_context *auth_ctx);
    235 NTSTATUS auth_context_set_challenge(struct auth_context *auth_ctx, const uint8_t chal[8], const char *set_by);
     179bool auth_challenge_may_be_modified(struct auth4_context *auth_ctx);
     180NTSTATUS auth_context_set_challenge(struct auth4_context *auth_ctx, const uint8_t chal[8], const char *set_by);
    236181
    237182NTSTATUS auth_get_user_info_dc_principal(TALLOC_CTX *mem_ctx,
    238                                         struct auth_context *auth_ctx,
     183                                        struct auth4_context *auth_ctx,
    239184                                        const char *principal,
    240185                                        struct ldb_dn *user_dn,
     
    243188NTSTATUS samba_server_gensec_start(TALLOC_CTX *mem_ctx,
    244189                                   struct tevent_context *event_ctx,
    245                                    struct messaging_context *msg_ctx,
     190                                   struct imessaging_context *msg_ctx,
    246191                                   struct loadparm_context *lp_ctx,
    247192                                   struct cli_credentials *server_credentials,
Note: See TracChangeset for help on using the changeset viewer.