summaryrefslogtreecommitdiff
path: root/nsswitch/winbind_nss_linux.c
diff options
context:
space:
mode:
authorMatthew Newton <matthew-git@newtoncomputing.co.uk>2015-01-23 23:58:53 +0000
committerJeremy Allison <jra@samba.org>2015-03-10 00:50:09 +0100
commit83cfb84b78ce7141652f1fdc7f01978cdb69343f (patch)
treeb5ff07c27602c263710a1b128616459832ab5e55 /nsswitch/winbind_nss_linux.c
parent60c7571984d7f1612828a72fae3ed8e66037d1f7 (diff)
downloadsamba-83cfb84b78ce7141652f1fdc7f01978cdb69343f.tar.gz
Use global context for winbindd_request_response
Updating API call in libwbclient, wbinfo, ntlm_auth and winbind_nss_* as per previous commit to wb_common.c. Signed-off-by: Matthew Newton <matthew-git@newtoncomputing.co.uk> Reviewed-by: Volker Lendecke <vl@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
Diffstat (limited to 'nsswitch/winbind_nss_linux.c')
-rw-r--r--nsswitch/winbind_nss_linux.c49
1 files changed, 30 insertions, 19 deletions
diff --git a/nsswitch/winbind_nss_linux.c b/nsswitch/winbind_nss_linux.c
index 9afa9d42725..3099413ec70 100644
--- a/nsswitch/winbind_nss_linux.c
+++ b/nsswitch/winbind_nss_linux.c
@@ -401,7 +401,7 @@ _nss_winbind_setpwent(void)
winbindd_free_response(&getpwent_response);
}
- ret = winbindd_request_response(WINBINDD_SETPWENT, NULL, NULL);
+ ret = winbindd_request_response(NULL, WINBINDD_SETPWENT, NULL, NULL);
#ifdef DEBUG_NSS
fprintf(stderr, "[%5d]: setpwent returns %s (%d)\n", getpid(),
nss_err_str(ret), ret);
@@ -432,7 +432,7 @@ _nss_winbind_endpwent(void)
winbindd_free_response(&getpwent_response);
}
- ret = winbindd_request_response(WINBINDD_ENDPWENT, NULL, NULL);
+ ret = winbindd_request_response(NULL, WINBINDD_ENDPWENT, NULL, NULL);
#ifdef DEBUG_NSS
fprintf(stderr, "[%5d]: endpwent returns %s (%d)\n", getpid(),
nss_err_str(ret), ret);
@@ -481,7 +481,7 @@ _nss_winbind_getpwent_r(struct passwd *result, char *buffer,
request.data.num_entries = MAX_GETPWENT_USERS;
- ret = winbindd_request_response(WINBINDD_GETPWENT, &request,
+ ret = winbindd_request_response(NULL, WINBINDD_GETPWENT, &request,
&getpwent_response);
if (ret == NSS_STATUS_SUCCESS) {
@@ -569,7 +569,7 @@ _nss_winbind_getpwuid_r(uid_t uid, struct passwd *result, char *buffer,
request.data.uid = uid;
- ret = winbindd_request_response(WINBINDD_GETPWUID, &request, &response);
+ ret = winbindd_request_response(NULL, WINBINDD_GETPWUID, &request, &response);
if (ret == NSS_STATUS_SUCCESS) {
ret = fill_pwent(result, &response.data.pw,
@@ -645,7 +645,7 @@ _nss_winbind_getpwnam_r(const char *name, struct passwd *result, char *buffer,
request.data.username
[sizeof(request.data.username) - 1] = '\0';
- ret = winbindd_request_response(WINBINDD_GETPWNAM, &request, &response);
+ ret = winbindd_request_response(NULL, WINBINDD_GETPWNAM, &request, &response);
if (ret == NSS_STATUS_SUCCESS) {
ret = fill_pwent(result, &response.data.pw, &buffer,
@@ -716,7 +716,7 @@ _nss_winbind_setgrent(void)
winbindd_free_response(&getgrent_response);
}
- ret = winbindd_request_response(WINBINDD_SETGRENT, NULL, NULL);
+ ret = winbindd_request_response(NULL, WINBINDD_SETGRENT, NULL, NULL);
#ifdef DEBUG_NSS
fprintf(stderr, "[%5d]: setgrent returns %s (%d)\n", getpid(),
nss_err_str(ret), ret);
@@ -748,7 +748,7 @@ _nss_winbind_endgrent(void)
winbindd_free_response(&getgrent_response);
}
- ret = winbindd_request_response(WINBINDD_ENDGRENT, NULL, NULL);
+ ret = winbindd_request_response(NULL, WINBINDD_ENDGRENT, NULL, NULL);
#ifdef DEBUG_NSS
fprintf(stderr, "[%5d]: endgrent returns %s (%d)\n", getpid(),
nss_err_str(ret), ret);
@@ -799,7 +799,7 @@ winbind_getgrent(enum winbindd_cmd cmd,
request.data.num_entries = MAX_GETGRENT_USERS;
- ret = winbindd_request_response(cmd, &request,
+ ret = winbindd_request_response(NULL, cmd, &request,
&getgrent_response);
if (ret == NSS_STATUS_SUCCESS) {
@@ -918,7 +918,8 @@ _nss_winbind_getgrnam_r(const char *name,
request.data.groupname
[sizeof(request.data.groupname) - 1] = '\0';
- ret = winbindd_request_response(WINBINDD_GETGRNAM, &request, &response);
+ ret = winbindd_request_response(NULL, WINBINDD_GETGRNAM,
+ &request, &response);
if (ret == NSS_STATUS_SUCCESS) {
ret = fill_grent(result, &response.data.gr,
@@ -996,7 +997,8 @@ _nss_winbind_getgrgid_r(gid_t gid,
request.data.gid = gid;
- ret = winbindd_request_response(WINBINDD_GETGRGID, &request, &response);
+ ret = winbindd_request_response(NULL, WINBINDD_GETGRGID,
+ &request, &response);
if (ret == NSS_STATUS_SUCCESS) {
@@ -1069,7 +1071,8 @@ _nss_winbind_initgroups_dyn(char *user, gid_t group, long int *start,
strncpy(request.data.username, user,
sizeof(request.data.username) - 1);
- ret = winbindd_request_response(WINBINDD_GETGROUPS, &request, &response);
+ ret = winbindd_request_response(NULL, WINBINDD_GETGROUPS,
+ &request, &response);
if (ret == NSS_STATUS_SUCCESS) {
int num_gids = response.data.num_entries;
@@ -1181,7 +1184,8 @@ _nss_winbind_getusersids(const char *user_sid, char **group_sids,
strncpy(request.data.sid, user_sid,sizeof(request.data.sid) - 1);
request.data.sid[sizeof(request.data.sid) - 1] = '\0';
- ret = winbindd_request_response(WINBINDD_GETUSERSIDS, &request, &response);
+ ret = winbindd_request_response(NULL, WINBINDD_GETUSERSIDS,
+ &request, &response);
if (ret != NSS_STATUS_SUCCESS) {
goto done;
@@ -1233,7 +1237,8 @@ _nss_winbind_nametosid(const char *name, char **sid, char *buffer,
sizeof(request.data.name.name) - 1);
request.data.name.name[sizeof(request.data.name.name) - 1] = '\0';
- ret = winbindd_request_response(WINBINDD_LOOKUPNAME, &request, &response);
+ ret = winbindd_request_response(NULL, WINBINDD_LOOKUPNAME,
+ &request, &response);
if (ret != NSS_STATUS_SUCCESS) {
*errnop = errno = EINVAL;
goto failed;
@@ -1283,7 +1288,8 @@ _nss_winbind_sidtoname(const char *sid, char **name, char *buffer,
/* we need to fetch the separator first time through */
if (!sep_char) {
- ret = winbindd_request_response(WINBINDD_INFO, &request, &response);
+ ret = winbindd_request_response(NULL, WINBINDD_INFO,
+ &request, &response);
if (ret != NSS_STATUS_SUCCESS) {
*errnop = errno = EINVAL;
goto failed;
@@ -1298,7 +1304,8 @@ _nss_winbind_sidtoname(const char *sid, char **name, char *buffer,
sizeof(request.data.sid) - 1);
request.data.sid[sizeof(request.data.sid) - 1] = '\0';
- ret = winbindd_request_response(WINBINDD_LOOKUPSID, &request, &response);
+ ret = winbindd_request_response(NULL, WINBINDD_LOOKUPSID,
+ &request, &response);
if (ret != NSS_STATUS_SUCCESS) {
*errnop = errno = EINVAL;
goto failed;
@@ -1354,7 +1361,8 @@ _nss_winbind_sidtouid(const char *sid, uid_t *uid, int *errnop)
strncpy(request.data.sid, sid, sizeof(request.data.sid) - 1);
request.data.sid[sizeof(request.data.sid) - 1] = '\0';
- ret = winbindd_request_response(WINBINDD_SID_TO_UID, &request, &response);
+ ret = winbindd_request_response(NULL, WINBINDD_SID_TO_UID,
+ &request, &response);
if (ret != NSS_STATUS_SUCCESS) {
*errnop = errno = EINVAL;
goto failed;
@@ -1393,7 +1401,8 @@ _nss_winbind_sidtogid(const char *sid, gid_t *gid, int *errnop)
strncpy(request.data.sid, sid, sizeof(request.data.sid) - 1);
request.data.sid[sizeof(request.data.sid) - 1] = '\0';
- ret = winbindd_request_response(WINBINDD_SID_TO_GID, &request, &response);
+ ret = winbindd_request_response(NULL, WINBINDD_SID_TO_GID,
+ &request, &response);
if (ret != NSS_STATUS_SUCCESS) {
*errnop = errno = EINVAL;
goto failed;
@@ -1432,7 +1441,8 @@ _nss_winbind_uidtosid(uid_t uid, char **sid, char *buffer,
request.data.uid = uid;
- ret = winbindd_request_response(WINBINDD_UID_TO_SID, &request, &response);
+ ret = winbindd_request_response(NULL, WINBINDD_UID_TO_SID,
+ &request, &response);
if (ret != NSS_STATUS_SUCCESS) {
*errnop = errno = EINVAL;
goto failed;
@@ -1480,7 +1490,8 @@ _nss_winbind_gidtosid(gid_t gid, char **sid, char *buffer,
request.data.gid = gid;
- ret = winbindd_request_response(WINBINDD_GID_TO_SID, &request, &response);
+ ret = winbindd_request_response(NULL, WINBINDD_GID_TO_SID,
+ &request, &response);
if (ret != NSS_STATUS_SUCCESS) {
*errnop = errno = EINVAL;
goto failed;