2 Unix SMB/Netbios implementation.
5 Winbind daemon for ntdom nss module
7 Copyright (C) Tim Potter 2000
9 This library is free software; you can redistribute it and/or
10 modify it under the terms of the GNU Library General Public
11 License as published by the Free Software Foundation; either
12 version 2 of the License, or (at your option) any later version.
14 This library is distributed in the hope that it will be useful,
15 but WITHOUT ANY WARRANTY; without even the implied warranty of
16 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
17 Library General Public License for more details.
19 You should have received a copy of the GNU Library General Public
20 License along with this library; if not, write to the
21 Free Software Foundation, Inc., 59 Temple Place - Suite 330,
22 Boston, MA 02111-1307, USA.
26 #define SAFE_FREE(x) do { if(x) {free(x); x=NULL;} } while(0)
29 #ifndef _WINBINDD_NTDOM_H
30 #define _WINBINDD_NTDOM_H
32 #define WINBINDD_SOCKET_NAME "pipe" /* Name of PF_UNIX socket */
33 #define WINBINDD_SOCKET_DIR "/tmp/.winbindd" /* Name of PF_UNIX dir */
35 #define WINBINDD_DOMAIN_ENV "WINBINDD_DOMAIN" /* Environment variables */
36 #define WINBINDD_DONT_ENV "_NO_WINBINDD"
38 /* Update this when you change the interface. */
40 #define WINBIND_INTERFACE_VERSION 3
46 WINBINDD_INTERFACE_VERSION, /* Always a well known value */
48 /* Get users and groups */
56 /* Enumerate users and groups */
65 /* PAM authenticate and password change */
68 WINBINDD_PAM_AUTH_CRAP,
69 WINBINDD_PAM_CHAUTHTOK,
71 /* List various things */
73 WINBINDD_LIST_USERS, /* List w/o rid->id mapping */
74 WINBINDD_LIST_GROUPS, /* Ditto */
75 WINBINDD_LIST_TRUSTDOM,
82 /* Lookup functions */
89 /* Miscellaneous other stuff */
91 WINBINDD_CHECK_MACHACC, /* Check machine account pw works */
92 WINBINDD_PING, /* Just tell me winbind is running */
93 WINBINDD_INFO, /* Various bit of info. Currently just tidbits */
94 WINBINDD_DOMAIN_NAME, /* The domain this winbind server is a member of (lp_workgroup()) */
96 /* Placeholder for end of cmd list */
101 /* Winbind request structure */
103 struct winbindd_request {
105 enum winbindd_cmd cmd; /* Winbindd command to execute */
106 pid_t pid; /* pid of calling process */
109 fstring username; /* getpwnam */
110 fstring groupname; /* getgrnam */
111 uid_t uid; /* getpwuid, uid_to_sid */
112 gid_t gid; /* getgrgid, gid_to_sid */
116 } auth; /* pam_winbind auth module */
118 unsigned char chal[8];
130 } chauthtok; /* pam_winbind passwd module */
131 fstring sid; /* lookupsid, sid_to_[ug]id */
133 fstring dom_name; /* lookupname */
136 uint32 num_entries; /* getpwent, getgrent */
138 fstring domain; /* {set,get,end}{pw,gr}ent() */
141 /* Response values */
143 enum winbindd_result {
148 /* Winbind response structure */
150 struct winbindd_response {
152 /* Header information */
154 uint32 length; /* Length of response */
155 enum winbindd_result result; /* Result code */
157 /* Fixed length return data */
160 int interface_version; /* Try to ensure this is always in the same spot... */
162 /* getpwnam, getpwuid */
174 /* getgrnam, getgrgid */
181 int gr_mem_ofs; /* offset to group membership */
184 uint32 num_entries; /* getpwent, getgrent */
185 struct winbindd_sid {
186 fstring sid; /* lookupname, [ug]id_to_sid */
189 struct winbindd_name {
190 fstring dom_name; /* lookupsid */
194 uid_t uid; /* sid_to_uid */
195 gid_t gid; /* sid_to_gid */
196 struct winbindd_info {
197 char winbind_separator;
198 fstring samba_version;
203 /* Variable length return data */
205 void *extra_data; /* getgrnam, getgrgid, getgrent */