summaryrefslogtreecommitdiff
path: root/source3/nsswitch
diff options
context:
space:
mode:
authorStefan Metzmacher <metze@samba.org>2008-03-24 20:44:34 +0100
committerStefan Metzmacher <metze@samba.org>2008-03-28 15:11:42 +0100
commitb6e3a9b8e5fe3d3d1dd4b04631e7f32ccf33153d (patch)
tree7cee684a2cff0e5a3d36f1c3c3d1f34cd597abac /source3/nsswitch
parent8686d47bad3b1ea59834974c30a5b380677db429 (diff)
downloadsamba-b6e3a9b8e5fe3d3d1dd4b04631e7f32ccf33153d.tar.gz
samba-b6e3a9b8e5fe3d3d1dd4b04631e7f32ccf33153d.tar.bz2
samba-b6e3a9b8e5fe3d3d1dd4b04631e7f32ccf33153d.zip
wbinfo: use wbcGetgrnam()
metze (This used to be commit 8945dce4a18874bdf1a57f1ff8116a66a6f699a0)
Diffstat (limited to 'source3/nsswitch')
-rw-r--r--source3/nsswitch/wbinfo.c31
1 files changed, 12 insertions, 19 deletions
diff --git a/source3/nsswitch/wbinfo.c b/source3/nsswitch/wbinfo.c
index f8d77cec60..fad13d292b 100644
--- a/source3/nsswitch/wbinfo.c
+++ b/source3/nsswitch/wbinfo.c
@@ -174,29 +174,22 @@ static bool wbinfo_get_uidinfo(int uid)
}
/* pull grent for a given group */
-static bool wbinfo_get_groupinfo(char *group)
+static bool wbinfo_get_groupinfo(const char *group)
{
- struct winbindd_request request;
- struct winbindd_response response;
- NSS_STATUS result;
-
- ZERO_STRUCT(request);
- ZERO_STRUCT(response);
-
- /* Send request */
-
- fstrcpy(request.data.groupname, group);
-
- result = winbindd_request_response(WINBINDD_GETGRNAM, &request,
- &response);
+ wbcErr wbc_status = WBC_ERR_UNKNOWN_FAILURE;
+ struct group *grp;
- if ( result != NSS_STATUS_SUCCESS)
+ wbc_status = wbcGetgrnam(group, &grp);
+ if (!WBC_ERROR_IS_OK(wbc_status)) {
return false;
+ }
+
+ d_printf("%s:%s:%d\n",
+ grp->gr_name,
+ grp->gr_passwd,
+ grp->gr_gid);
- d_printf( "%s:%s:%d\n",
- response.data.gr.gr_name,
- response.data.gr.gr_passwd,
- response.data.gr.gr_gid );
+ wbcFreeMemory(grp);
return true;
}