2 Unix SMB/CIFS implementation.
4 Winbind daemon for ntdom nss module
6 Copyright (C) Tim Potter 2000
8 You are free to use this interface definition in any way you see
9 fit, including without restriction, using this header in your own
10 products. You do not need to give any attribution.
14 #define SAFE_FREE(x) do { if(x) {free(x); x=NULL;} } while(0)
17 #ifndef _WINBINDD_NTDOM_H
18 #define _WINBINDD_NTDOM_H
20 #define WINBINDD_SOCKET_NAME "pipe" /* Name of PF_UNIX socket */
21 #define WINBINDD_SOCKET_DIR "/tmp/.winbindd" /* Name of PF_UNIX dir */
22 #define WINBINDD_PRIV_SOCKET_SUBDIR "winbindd_privileged" /* name of subdirectory of lp_lockdir() to hold the 'privileged' pipe */
23 #define WINBINDD_DOMAIN_ENV "WINBINDD_DOMAIN" /* Environment variables */
24 #define WINBINDD_DONT_ENV "_NO_WINBINDD"
26 /* Update this when you change the interface. */
28 #define WINBIND_INTERFACE_VERSION 10
34 WINBINDD_INTERFACE_VERSION
, /* Always a well known value */
36 /* Get users and groups */
44 /* Enumerate users and groups */
53 /* PAM authenticate and password change */
56 WINBINDD_PAM_AUTH_CRAP
,
57 WINBINDD_PAM_CHAUTHTOK
,
59 /* List various things */
61 WINBINDD_LIST_USERS
, /* List w/o rid->id mapping */
62 WINBINDD_LIST_GROUPS
, /* Ditto */
63 WINBINDD_LIST_TRUSTDOM
,
70 /* Lookup functions */
76 WINBINDD_ALLOCATE_RID
,
78 /* Miscellaneous other stuff */
80 WINBINDD_CHECK_MACHACC
, /* Check machine account pw works */
81 WINBINDD_PING
, /* Just tell me winbind is running */
82 WINBINDD_INFO
, /* Various bit of info. Currently just tidbits */
83 WINBINDD_DOMAIN_NAME
, /* The domain this winbind server is a member of (lp_workgroup()) */
85 WINBINDD_DOMAIN_INFO
, /* Most of what we know from
86 struct winbindd_domain */
88 WINBINDD_SHOW_SEQUENCE
, /* display sequence numbers of domains */
95 /* account management commands */
98 WINBINDD_CREATE_GROUP
,
99 WINBINDD_ADD_USER_TO_GROUP
,
100 WINBINDD_REMOVE_USER_FROM_GROUP
,
101 WINBINDD_SET_USER_PRIMARY_GROUP
,
102 WINBINDD_DELETE_USER
,
103 WINBINDD_DELETE_GROUP
,
105 /* this is like GETGRENT but gives an empty group list */
108 WINBINDD_NETBIOS_NAME
, /* The netbios name of the server */
110 /* find the location of our privileged pipe */
111 WINBINDD_PRIV_PIPE_DIR
,
113 /* return a list of group sids for a user sid */
114 WINBINDD_GETUSERSIDS
,
116 /* Placeholder for end of cmd list */
120 typedef struct winbindd_pw
{
131 typedef struct winbindd_gr
{
136 int gr_mem_ofs
; /* offset to group membership */
141 #define WBFLAG_PAM_INFO3_NDR 0x0001
142 #define WBFLAG_PAM_INFO3_TEXT 0x0002
143 #define WBFLAG_PAM_USER_SESSION_KEY 0x0004
144 #define WBFLAG_PAM_LMKEY 0x0008
145 #define WBFLAG_PAM_CONTACT_TRUSTDOM 0x0010
146 #define WBFLAG_QUERY_ONLY 0x0020
147 #define WBFLAG_ALLOCATE_RID 0x0040
148 #define WBFLAG_PAM_UNIX_NAME 0x0080
149 #define WBFLAG_PAM_AFS_TOKEN 0x0100
150 #define WBFLAG_PAM_NT_STATUS_SQUASH 0x0200
152 /* Winbind request structure */
154 struct winbindd_request
{
156 enum winbindd_cmd cmd
; /* Winbindd command to execute */
157 pid_t pid
; /* pid of calling process */
158 uint32 flags
; /* flags relavant to a given request */
159 fstring domain_name
; /* name of domain for which the request applies */
162 fstring winsreq
; /* WINS request */
163 fstring username
; /* getpwnam */
164 fstring groupname
; /* getgrnam */
165 uid_t uid
; /* getpwuid, uid_to_sid */
166 gid_t gid
; /* getgrgid, gid_to_sid */
168 /* We deliberatedly don't split into domain/user to
169 avoid having the client know what the separator
173 fstring require_membership_of_sid
;
174 } auth
; /* pam_winbind auth module */
176 unsigned char chal
[8];
184 fstring require_membership_of_sid
;
190 } chauthtok
; /* pam_winbind passwd module */
191 fstring sid
; /* lookupsid, sid_to_[ug]id */
193 fstring dom_name
; /* lookupname */
196 uint32 num_entries
; /* getpwent, getgrent */
205 /* Response values */
207 enum winbindd_result
{
212 /* Winbind response structure */
214 struct winbindd_response
{
216 /* Header information */
218 uint32 length
; /* Length of response */
219 enum winbindd_result result
; /* Result code */
221 /* Fixed length return data */
224 int interface_version
; /* Try to ensure this is always in the same spot... */
226 fstring winsresp
; /* WINS response */
228 /* getpwnam, getpwuid */
230 struct winbindd_pw pw
;
232 /* getgrnam, getgrgid */
234 struct winbindd_gr gr
;
236 uint32 num_entries
; /* getpwent, getgrent */
237 struct winbindd_sid
{
238 fstring sid
; /* lookupname, [ug]id_to_sid */
241 struct winbindd_name
{
242 fstring dom_name
; /* lookupsid */
246 uid_t uid
; /* sid_to_uid */
247 gid_t gid
; /* sid_to_gid */
248 struct winbindd_info
{
249 char winbind_separator
;
250 fstring samba_version
;
253 fstring netbios_name
;
257 fstring nt_status_string
;
258 fstring error_string
;
260 char user_session_key
[16];
261 char first_8_lm_hash
[8];
263 uint32 rid
; /* create user or group or allocate rid */
269 BOOL active_directory
;
271 uint32 sequence_number
;
275 /* Variable length return data */
277 void *extra_data
; /* getgrnam, getgrgid, getgrent */