nsswitch/winbind_nss_linux.c use WBFLAG_FROM_NSS
authorBjoern Jacke <bj@sernet.de>
Fri, 21 Dec 2018 11:54:31 +0000 (05:54 -0600)
committerBjoern Jacke <bj@sernet.de>
Sat, 22 Dec 2018 02:11:14 +0000 (03:11 +0100)
Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Bjoern Jacke <bj@sernet.de>
nsswitch/winbind_nss_linux.c

index 4ab10b90f4f70579ece694c581c9040e0d459d85..635813ccd6053451c683228c0fd6c22cfd1ec1a1 100644 (file)
@@ -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;