2 Unix SMB/CIFS implementation.
6 Copyright (C) Tim Potter 2000
7 Copyright (C) Andrew Tridgell 2000
9 This library is free software; you can redistribute it and/or
10 modify it under the terms of the GNU Lesser General Public
11 License as published by the Free Software Foundation; either
12 version 3 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 Lesser General Public License
20 along with this program. If not, see <http://www.gnu.org/licenses/>.
24 #include "nsswitch/winbind_nss.h"
25 #include "libwbclient/wbclient.h"
28 #define DBGC_CLASS DBGC_WINBIND
30 NSS_STATUS
winbindd_request_response(int req_type
,
31 struct winbindd_request
*request
,
32 struct winbindd_response
*response
);
34 bool winbind_set_mapping(const struct id_map
*map
)
36 struct winbindd_request request
;
37 struct winbindd_response response
;
40 /* Initialise request */
43 ZERO_STRUCT(response
);
47 request
.data
.dual_idmapset
.id
= map
->xid
.id
;
48 request
.data
.dual_idmapset
.type
= map
->xid
.type
;
49 sid_to_fstring(request
.data
.dual_idmapset
.sid
, map
->sid
);
51 result
= winbindd_request_response(WINBINDD_SET_MAPPING
, &request
, &response
);
53 return (result
== NSS_STATUS_SUCCESS
);
56 bool winbind_set_uid_hwm(unsigned long id
)
58 struct winbindd_request request
;
59 struct winbindd_response response
;
62 /* Initialise request */
65 ZERO_STRUCT(response
);
69 request
.data
.dual_idmapset
.id
= id
;
70 request
.data
.dual_idmapset
.type
= ID_TYPE_UID
;
72 result
= winbindd_request_response(WINBINDD_SET_HWM
, &request
, &response
);
74 return (result
== NSS_STATUS_SUCCESS
);
77 bool winbind_set_gid_hwm(unsigned long id
)
79 struct winbindd_request request
;
80 struct winbindd_response response
;
83 /* Initialise request */
86 ZERO_STRUCT(response
);
90 request
.data
.dual_idmapset
.id
= id
;
91 request
.data
.dual_idmapset
.type
= ID_TYPE_GID
;
93 result
= winbindd_request_response(WINBINDD_SET_HWM
, &request
, &response
);
95 return (result
== NSS_STATUS_SUCCESS
);