2 Unix SMB/CIFS implementation.
4 Winbind daemon for ntdom nss module
6 Copyright (C) Tim Potter 2000
8 This library is free software; you can redistribute it and/or
9 modify it under the terms of the GNU Library General Public
10 License as published by the Free Software Foundation; either
11 version 2 of the License, or (at your option) any later version.
13 This library is distributed in the hope that it will be useful,
14 but WITHOUT ANY WARRANTY; without even the implied warranty of
15 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
16 Library General Public License for more details.
18 You should have received a copy of the GNU Library General Public
19 License along with this library; if not, write to the
20 Free Software Foundation, Inc., 59 Temple Place - Suite 330,
21 Boston, MA 02111-1307, USA.
25 #define SAFE_FREE(x) do { if(x) {free(x); x=NULL;} } while(0)
28 #ifndef _WINBINDD_NTDOM_H
29 #define _WINBINDD_NTDOM_H
31 #define WINBINDD_SOCKET_NAME "pipe" /* Name of PF_UNIX socket */
32 #define WINBINDD_SOCKET_DIR "/tmp/.winbindd" /* Name of PF_UNIX dir */
33 #define WINBINDD_PRIV_SOCKET_SUBDIR "winbindd_privileged" /* name of subdirectory of lp_lockdir() to hold the 'privileged' pipe */
34 #define WINBINDD_DOMAIN_ENV "WINBINDD_DOMAIN" /* Environment variables */
35 #define WINBINDD_DONT_ENV "_NO_WINBINDD"
37 /* Update this when you change the interface. */
39 #define WINBIND_INTERFACE_VERSION 7
45 WINBINDD_INTERFACE_VERSION, /* Always a well known value */
47 /* Get users and groups */
55 /* Enumerate users and groups */
64 /* PAM authenticate and password change */
67 WINBINDD_PAM_AUTH_CRAP,
68 WINBINDD_PAM_CHAUTHTOK,
70 /* List various things */
72 WINBINDD_LIST_USERS, /* List w/o rid->id mapping */
73 WINBINDD_LIST_GROUPS, /* Ditto */
74 WINBINDD_LIST_TRUSTDOM,
81 /* Lookup functions */
88 /* Miscellaneous other stuff */
90 WINBINDD_CHECK_MACHACC, /* Check machine account pw works */
91 WINBINDD_PING, /* Just tell me winbind is running */
92 WINBINDD_INFO, /* Various bit of info. Currently just tidbits */
93 WINBINDD_DOMAIN_NAME, /* The domain this winbind server is a member of (lp_workgroup()) */
95 WINBINDD_SHOW_SEQUENCE, /* display sequence numbers of domains */
100 WINBINDD_WINS_BYNAME,
102 /* this is like GETGRENT but gives an empty group list */
105 WINBINDD_NETBIOS_NAME, /* The netbios name of the server */
106 /* Placeholder for end of cmd list */
108 /* find the location of our privileged pipe */
109 WINBINDD_PRIV_PIPE_DIR,
114 #define WBFLAG_PAM_INFO3_NDR 0x0001
115 #define WBFLAG_PAM_INFO3_TEXT 0x0002
116 #define WBFLAG_PAM_NTKEY 0x0004
117 #define WBFLAG_PAM_LMKEY 0x0008
118 #define WBFLAG_PAM_CONTACT_TRUSTDOM 0x0010
119 #define WBFLAG_QUERY_ONLY 0x0020
121 /* Winbind request structure */
123 struct winbindd_request {
125 enum winbindd_cmd cmd; /* Winbindd command to execute */
126 pid_t pid; /* pid of calling process */
127 uint32 flags; /* flags relavant to a given request */
130 fstring winsreq; /* WINS request */
131 fstring username; /* getpwnam */
132 fstring groupname; /* getgrnam */
133 uid_t uid; /* getpwuid, uid_to_sid */
134 gid_t gid; /* getgrgid, gid_to_sid */
136 /* We deliberatedly don't split into domain/user to
137 avoid having the client know what the separator
141 } auth; /* pam_winbind auth module */
143 unsigned char chal[8];
156 } chauthtok; /* pam_winbind passwd module */
157 fstring sid; /* lookupsid, sid_to_[ug]id */
159 fstring dom_name; /* lookupname */
162 uint32 num_entries; /* getpwent, getgrent */
167 /* Response values */
169 enum winbindd_result {
174 /* Winbind response structure */
176 struct winbindd_response {
178 /* Header information */
180 uint32 length; /* Length of response */
181 enum winbindd_result result; /* Result code */
183 /* Fixed length return data */
186 int interface_version; /* Try to ensure this is always in the same spot... */
188 fstring winsresp; /* WINS response */
190 /* getpwnam, getpwuid */
202 /* getgrnam, getgrgid */
209 int gr_mem_ofs; /* offset to group membership */
212 uint32 num_entries; /* getpwent, getgrent */
213 struct winbindd_sid {
214 fstring sid; /* lookupname, [ug]id_to_sid */
217 struct winbindd_name {
218 fstring dom_name; /* lookupsid */
222 uid_t uid; /* sid_to_uid */
223 gid_t gid; /* sid_to_gid */
224 struct winbindd_info {
225 char winbind_separator;
226 fstring samba_version;
229 fstring netbios_name;
233 fstring nt_status_string;
234 fstring error_string;
236 char nt_session_key[16];
237 char first_8_lm_hash[8];
241 /* Variable length return data */
243 void *extra_data; /* getgrnam, getgrgid, getgrent */