diff options
author | Stefan Metzmacher <metze@samba.org> | 2008-03-24 20:44:34 +0100 |
---|---|---|
committer | Stefan Metzmacher <metze@samba.org> | 2008-03-28 15:11:42 +0100 |
commit | b6e3a9b8e5fe3d3d1dd4b04631e7f32ccf33153d (patch) | |
tree | 7cee684a2cff0e5a3d36f1c3c3d1f34cd597abac /source3/nsswitch | |
parent | 8686d47bad3b1ea59834974c30a5b380677db429 (diff) | |
download | samba-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.c | 31 |
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; } |