summaryrefslogtreecommitdiff
path: root/nsswitch
diff options
context:
space:
mode:
authorBjoern Jacke <bj@sernet.de>2018-12-21 05:54:31 -0600
committerBjoern Jacke <bj@sernet.de>2018-12-22 03:11:14 +0100
commit4a7368501a9df8f0b8f29a94faa0c1099c0a477a (patch)
treebe6fabc3d34a18ca0fd1e4ea38d688db2c9060ce /nsswitch
parentf95495e1f7d31dd32a979514d150ecb755a8c1a1 (diff)
downloadsamba-4a7368501a9df8f0b8f29a94faa0c1099c0a477a.tar.gz
nsswitch/winbind_nss_linux.c use WBFLAG_FROM_NSS
Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Bjoern Jacke <bj@sernet.de>
Diffstat (limited to 'nsswitch')
-rw-r--r--nsswitch/winbind_nss_linux.c38
1 files changed, 28 insertions, 10 deletions
diff --git a/nsswitch/winbind_nss_linux.c b/nsswitch/winbind_nss_linux.c
index 4ab10b90f4f..635813ccd60 100644
--- a/nsswitch/winbind_nss_linux.c
+++ b/nsswitch/winbind_nss_linux.c
@@ -544,10 +544,15 @@ _nss_winbind_getpwuid_r(uid_t uid, struct passwd *result, char *buffer,
/* Call for the first time */
- ZERO_STRUCT(response);
- ZERO_STRUCT(request);
-
- request.data.uid = uid;
+ response = (struct winbindd_response) {
+ .length = 0,
+ };
+ request = (struct winbindd_request) {
+ .wb_flags = WBFLAG_FROM_NSS,
+ .data = {
+ .uid = uid,
+ },
+ };
winbind_set_client_name("nss_winbind");
ret = winbindd_request_response(NULL, WINBINDD_GETPWUID, &request, &response);
@@ -618,8 +623,12 @@ _nss_winbind_getpwnam_r(const char *name, struct passwd *result, char *buffer,
/* Call for the first time */
- ZERO_STRUCT(response);
- ZERO_STRUCT(request);
+ response = (struct winbindd_response) {
+ .length = 0,
+ };
+ request = (struct winbindd_request) {
+ .wb_flags = WBFLAG_FROM_NSS,
+ };
strncpy(request.data.username, name,
sizeof(request.data.username) - 1);
@@ -895,8 +904,12 @@ _nss_winbind_getgrnam_r(const char *name,
/* Call for the first time */
- ZERO_STRUCT(request);
- ZERO_STRUCT(response);
+ response = (struct winbindd_response) {
+ .length = 0,
+ };
+ request = (struct winbindd_request) {
+ .wb_flags = WBFLAG_FROM_NSS,
+ };
strncpy(request.data.groupname, name,
sizeof(request.data.groupname));
@@ -978,8 +991,13 @@ _nss_winbind_getgrgid_r(gid_t gid,
/* Call for the first time */
- ZERO_STRUCT(request);
- ZERO_STRUCT(response);
+ response = (struct winbindd_response) {
+ .length = 0,
+ };
+ request = (struct winbindd_request) {
+ .wb_flags = WBFLAG_FROM_NSS,
+ };
+
request.data.gid = gid;