~lefteris-nikoltsios/+junk/samba-lp1016895

« back to all changes in this revision

Viewing changes to source3/include/auth.h

  • Committer: Package Import Robot
  • Author(s): Chuck Short
  • Date: 2011-12-21 13:18:04 UTC
  • mfrom: (0.39.21 sid)
  • Revision ID: package-import@ubuntu.com-20111221131804-xtlr39wx6njehxxr
Tags: 2:3.6.1-3ubuntu1
* Merge from Debian testing.  Remaining changes:
  + debian/patches/VERSION.patch:
    - set SAMBA_VERSION_SUFFIX to Ubuntu.
  + debian/patches/error-trans.fix-276472:
    - Add the translation of Unix Error code -ENOTSUP to NT Error Code
    - NT_STATUS_NOT_SUPPORTED to prevent the Permission denied error.
  + debian/smb.conf:
    - add "(Samba, Ubuntu)" to server string.
    - comment out the default [homes] share, and add a comment about
      "valid users = %S" to show users how to restrict access to
      \\server\username to only username.
    - Set 'usershare allow guests', so that usershare admins are 
      allowed to create public shares in addition to authenticated
      ones.
    - add map to guest = Bad user, maps bad username to guest access.
  + debian/samba-common.config:
    - Do not change priority to high if dhclient3 is installed.
    - Use priority medium instead of high for the workgroup question.
  + debian/control:
    - Don't build against or suggest ctdb.
    - Add dependency on samba-common-bin to samba.
  + Add ufw integration:
    - Created debian/samba.ufw.profile
    - debian/rules, debian/samba.dirs, debian/samba.files: install
      profile
    - debian/control: have samba suggest ufw
  + Add apport hook:
    - Created debian/source_samba.py.
    - debian/rules, debian/samba.dirs, debian/samba-common-bin.files: install
  + Switch to upstart:
    - Add debian/samba.{nmbd,smbd}.upstart.
  + debian/samba.logrotate, debian/samba-common.dhcp, debian/samba.if-up:
    - Make them upstart compatible
  + debian/samba.postinst: 
    - Avoid scary pdbedit warnings on first import.
  + debian/samba-common.postinst: Add more informative error message for
    the case where smb.conf was manually deleted
  + debian/patches/fix-debuglevel-name-conflict.patch: don't use 'debug_level'
    as a global variable name in an NSS module 
  + Dropped:
    - debian/patches/error-trans.fix-276472
    - debian/patches/fix-debuglevel-name-conflict.patch

Show diffs side-by-side

added added

removed removed

Lines of Context:
19
19
   along with this program.  If not, see <http://www.gnu.org/licenses/>.
20
20
*/
21
21
 
22
 
typedef struct auth_usersupplied_info {
23
 
        DATA_BLOB lm_resp;
24
 
        DATA_BLOB nt_resp;
25
 
        DATA_BLOB lm_interactive_pwd;
26
 
        DATA_BLOB nt_interactive_pwd;
27
 
        DATA_BLOB plaintext_password;
28
 
 
29
 
        bool encrypted;
30
 
 
31
 
        bool was_mapped;              /* Did the username map actually match? */
32
 
        char *client_domain;          /* domain name string */
33
 
        char *domain;                 /* domain name after mapping */
34
 
        char *internal_username;      /* username after mapping */
35
 
        char *smb_name;               /* username before mapping */
36
 
        char *wksta_name;             /* workstation name (netbios calling
37
 
                                       * name) unicode string */
38
 
 
39
 
        uint32 logon_parameters;
40
 
 
41
 
} auth_usersupplied_info;
42
 
 
43
 
typedef struct auth_serversupplied_info {
 
22
#include "../auth/common_auth.h"
 
23
 
 
24
struct extra_auth_info {
 
25
        struct dom_sid user_sid;
 
26
        struct dom_sid pgid_sid;
 
27
};
 
28
 
 
29
struct auth_serversupplied_info {
44
30
        bool guest;
45
 
 
46
 
        DOM_SID *sids;  /* These SIDs are preliminary between
47
 
                           check_ntlm_password and the token creation. */
48
 
        size_t num_sids;
49
 
 
50
 
        struct unix_user_token utok;
 
31
        bool system;
 
32
 
 
33
        struct security_unix_token utok;
51
34
 
52
35
        /* NT group information taken from the info3 structure */
53
36
 
54
 
        NT_USER_TOKEN *ptok;
 
37
        struct security_token *security_token;
 
38
 
 
39
        /* This is the final session key, as used by SMB signing, and
 
40
         * (truncated to 16 bytes) encryption on the SAMR and LSA pipes
 
41
         * when over ncacn_np.
 
42
         * It is calculated by NTLMSSP from the session key in the info3,
 
43
         * and is  set from the Kerberos session key using
 
44
         * krb5_auth_con_getremotesubkey().
 
45
         *
 
46
         * Bottom line, it is not the same as the session keys in info3.
 
47
         */
55
48
 
56
49
        DATA_BLOB user_session_key;
57
50
        DATA_BLOB lm_session_key;
58
51
 
59
 
        char *login_server; /* which server authorized the login? */
60
 
 
61
 
        struct samu *sam_account;
62
 
 
63
 
        void *pam_handle;
 
52
        struct netr_SamInfo3 *info3;
 
53
 
 
54
        /* this structure is filled *only* in pathological cases where the user
 
55
         * sid or the primary group sid are not sids of the domain. Normally
 
56
         * this happens only for unix accounts that have unix domain sids.
 
57
         * This is checked only when info3.rid and/or info3.primary_gid are set
 
58
         * to the special invalid value of 0xFFFFFFFF */
 
59
        struct extra_auth_info extra;
64
60
 
65
61
        /*
66
62
         * This is a token from /etc/passwd and /etc/group
77
73
         * smb request. See set_current_user_info.
78
74
         */
79
75
        char *sanitized_username;
80
 
} auth_serversupplied_info;
 
76
};
81
77
 
82
78
struct auth_context {
83
79
        DATA_BLOB challenge; 
91
87
        /* What order are the various methods in?   Try to stop it changing under us */ 
92
88
        struct auth_methods *auth_method_list;  
93
89
 
94
 
        TALLOC_CTX *mem_ctx;
95
 
        void (*get_ntlm_challenge)(struct auth_context *auth_context,
96
 
                                   uint8_t chal[8]);
 
90
        NTSTATUS (*get_ntlm_challenge)(struct auth_context *auth_context,
 
91
                                       uint8_t chal[8]);
97
92
        NTSTATUS (*check_ntlm_password)(const struct auth_context *auth_context,
98
93
                                        const struct auth_usersupplied_info *user_info, 
99
94
                                        struct auth_serversupplied_info **server_info);
100
95
        NTSTATUS (*nt_status_squash)(NTSTATUS nt_status);
101
 
        void (*free)(struct auth_context **auth_context);
102
96
};
103
97
 
104
98
typedef struct auth_methods
110
104
                         void *my_private_data, 
111
105
                         TALLOC_CTX *mem_ctx,
112
106
                         const struct auth_usersupplied_info *user_info, 
113
 
                         auth_serversupplied_info **server_info);
 
107
                         struct auth_serversupplied_info **server_info);
114
108
 
115
109
        /* If you are using this interface, then you are probably
116
110
         * getting something wrong.  This interface is only for
136
130
        struct auth_init_function_entry *prev, *next;
137
131
};
138
132
 
139
 
typedef struct auth_ntlmssp_state {
140
 
        TALLOC_CTX *mem_ctx;
141
 
        struct auth_context *auth_context;
142
 
        struct auth_serversupplied_info *server_info;
143
 
        struct ntlmssp_state *ntlmssp_state;
144
 
} AUTH_NTLMSSP_STATE;
 
133
struct auth_ntlmssp_state;
145
134
 
146
135
/* Changed from 1 -> 2 to add the logon_parameters field. */
147
 
#define AUTH_INTERFACE_VERSION 2
 
136
/* Changed from 2 -> 3 when we reworked many auth structures to use IDL or be in common with Samba4 */
 
137
#define AUTH_INTERFACE_VERSION 3
 
138
 
 
139
#include "auth/proto.h"
148
140
 
149
141
#endif /* _SMBAUTH_H_ */