s3-auth: Use the gensec-supplied DNS domain name and hostname.
[nivanova/samba-autobuild/.git] / auth / common_auth.h
index ce3444ce7a0923e33d0f14e76dde46ac16513db2..d9996e1ee48167c69cc75d209259d400f164f62f 100644 (file)
@@ -33,6 +33,11 @@ enum auth_password_state {
        AUTH_PASSWORD_RESPONSE = 3
 };
 
+#define AUTH_SESSION_INFO_DEFAULT_GROUPS     0x01 /* Add the user to the default world and network groups */
+#define AUTH_SESSION_INFO_AUTHENTICATED      0x02 /* Add the user to the 'authenticated users' group */
+#define AUTH_SESSION_INFO_SIMPLE_PRIVILEGES  0x04 /* Use a trivial map between users and privilages, rather than a DB */
+#define AUTH_SESSION_INFO_UNIX_TOKEN         0x08 /* The returned token must have the unix_token and unix_info elements provided */
+
 struct auth_usersupplied_info
 {
        const char *workstation_name;
@@ -97,10 +102,14 @@ struct auth4_context {
        /* SAM database for this local machine - to fill in local groups, or to authenticate local NTLM users */
        struct ldb_context *sam_ctx;
 
+       /* Private data for the callbacks on this auth context */
+       void *private_data;
+
        NTSTATUS (*check_password)(struct auth4_context *auth_ctx,
                                   TALLOC_CTX *mem_ctx,
                                   const struct auth_usersupplied_info *user_info,
-                                  struct auth_user_info_dc **user_info_dc);
+                                  void **server_returned_info,
+                                  DATA_BLOB *nt_session_key, DATA_BLOB *lm_session_key);
 
        NTSTATUS (*get_challenge)(struct auth4_context *auth_ctx, uint8_t chal[8]);
 
@@ -110,7 +119,8 @@ struct auth4_context {
 
        NTSTATUS (*generate_session_info)(TALLOC_CTX *mem_ctx,
                                          struct auth4_context *auth_context,
-                                         struct auth_user_info_dc *user_info_dc,
+                                         void *server_returned_info,
+                                         const char *original_user_name,
                                          uint32_t session_info_flags,
                                          struct auth_session_info **session_info);