components/samba/samba/patches/16298670_id-a.patch
author Jiri Sasek <Jiri.Sasek@Oracle.COM>
Tue, 18 Mar 2014 09:20:39 -0700
changeset 1767 16e87eb4d478
permissions -rw-r--r--
16298670 id -a does not show all the groups a user belongs to 18191913 "smb.conf" "valid users=" fails with secondary groups after patching.
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
1767
16e87eb4d478 16298670 id -a does not show all the groups a user belongs to
Jiri Sasek <Jiri.Sasek@Oracle.COM>
parents:
diff changeset
     1
https://bugzilla.samba.org/show_bug.cgi?id=10487
16e87eb4d478 16298670 id -a does not show all the groups a user belongs to
Jiri Sasek <Jiri.Sasek@Oracle.COM>
parents:
diff changeset
     2
Common synopsis:  Samba Winbind GETGRENT interface fails when any trusted domain is not available
16e87eb4d478 16298670 id -a does not show all the groups a user belongs to
Jiri Sasek <Jiri.Sasek@Oracle.COM>
parents:
diff changeset
     3
Bugs 16298670, 18191913
16e87eb4d478 16298670 id -a does not show all the groups a user belongs to
Jiri Sasek <Jiri.Sasek@Oracle.COM>
parents:
diff changeset
     4
16e87eb4d478 16298670 id -a does not show all the groups a user belongs to
Jiri Sasek <Jiri.Sasek@Oracle.COM>
parents:
diff changeset
     5
--- a/nsswitch/wb_common.c	2014-02-07 17:26:50.046234000 +0100
16e87eb4d478 16298670 id -a does not show all the groups a user belongs to
Jiri Sasek <Jiri.Sasek@Oracle.COM>
parents:
diff changeset
     6
+++ b/nsswitch/wb_common.c	2014-02-07 17:33:40.280002000 +0100
16e87eb4d478 16298670 id -a does not show all the groups a user belongs to
Jiri Sasek <Jiri.Sasek@Oracle.COM>
parents:
diff changeset
     7
@@ -462,7 +462,7 @@
16e87eb4d478 16298670 id -a does not show all the groups a user belongs to
Jiri Sasek <Jiri.Sasek@Oracle.COM>
parents:
diff changeset
     8
 
16e87eb4d478 16298670 id -a does not show all the groups a user belongs to
Jiri Sasek <Jiri.Sasek@Oracle.COM>
parents:
diff changeset
     9
 		if (ret == 0) {
16e87eb4d478 16298670 id -a does not show all the groups a user belongs to
Jiri Sasek <Jiri.Sasek@Oracle.COM>
parents:
diff changeset
    10
 			/* Not ready for read yet... */
16e87eb4d478 16298670 id -a does not show all the groups a user belongs to
Jiri Sasek <Jiri.Sasek@Oracle.COM>
parents:
diff changeset
    11
-			if (total_time >= 30) {
16e87eb4d478 16298670 id -a does not show all the groups a user belongs to
Jiri Sasek <Jiri.Sasek@Oracle.COM>
parents:
diff changeset
    12
+			if (total_time >= 1000) {
16e87eb4d478 16298670 id -a does not show all the groups a user belongs to
Jiri Sasek <Jiri.Sasek@Oracle.COM>
parents:
diff changeset
    13
 				/* Timeout */
16e87eb4d478 16298670 id -a does not show all the groups a user belongs to
Jiri Sasek <Jiri.Sasek@Oracle.COM>
parents:
diff changeset
    14
 				winbind_close_sock();
16e87eb4d478 16298670 id -a does not show all the groups a user belongs to
Jiri Sasek <Jiri.Sasek@Oracle.COM>
parents:
diff changeset
    15
 				return -1;
16e87eb4d478 16298670 id -a does not show all the groups a user belongs to
Jiri Sasek <Jiri.Sasek@Oracle.COM>
parents:
diff changeset
    16
--- a/source3/winbindd/wb_next_grent.c	2014-02-07 17:27:14.079647000 +0100
16e87eb4d478 16298670 id -a does not show all the groups a user belongs to
Jiri Sasek <Jiri.Sasek@Oracle.COM>
parents:
diff changeset
    17
+++ b/source3/winbindd/wb_next_grent.c	2014-02-07 17:58:36.599520000 +0100
16e87eb4d478 16298670 id -a does not show all the groups a user belongs to
Jiri Sasek <Jiri.Sasek@Oracle.COM>
parents:
diff changeset
    18
@@ -103,18 +103,16 @@
16e87eb4d478 16298670 id -a does not show all the groups a user belongs to
Jiri Sasek <Jiri.Sasek@Oracle.COM>
parents:
diff changeset
    19
 	TALLOC_FREE(subreq);
16e87eb4d478 16298670 id -a does not show all the groups a user belongs to
Jiri Sasek <Jiri.Sasek@Oracle.COM>
parents:
diff changeset
    20
 	if (tevent_req_nterror(req, status)) {
16e87eb4d478 16298670 id -a does not show all the groups a user belongs to
Jiri Sasek <Jiri.Sasek@Oracle.COM>
parents:
diff changeset
    21
 		/* Ignore errors here, just log it */
16e87eb4d478 16298670 id -a does not show all the groups a user belongs to
Jiri Sasek <Jiri.Sasek@Oracle.COM>
parents:
diff changeset
    22
-		DEBUG(10, ("query_user_list for domain %s returned %s\n",
16e87eb4d478 16298670 id -a does not show all the groups a user belongs to
Jiri Sasek <Jiri.Sasek@Oracle.COM>
parents:
diff changeset
    23
+		DEBUG(3, ("query_user_list for domain %s returned: %s\n",
16e87eb4d478 16298670 id -a does not show all the groups a user belongs to
Jiri Sasek <Jiri.Sasek@Oracle.COM>
parents:
diff changeset
    24
 			   state->gstate->domain->name,
16e87eb4d478 16298670 id -a does not show all the groups a user belongs to
Jiri Sasek <Jiri.Sasek@Oracle.COM>
parents:
diff changeset
    25
 			   nt_errstr(status)));
16e87eb4d478 16298670 id -a does not show all the groups a user belongs to
Jiri Sasek <Jiri.Sasek@Oracle.COM>
parents:
diff changeset
    26
-		return;
16e87eb4d478 16298670 id -a does not show all the groups a user belongs to
Jiri Sasek <Jiri.Sasek@Oracle.COM>
parents:
diff changeset
    27
 	}
16e87eb4d478 16298670 id -a does not show all the groups a user belongs to
Jiri Sasek <Jiri.Sasek@Oracle.COM>
parents:
diff changeset
    28
 	if (!NT_STATUS_IS_OK(result)) {
16e87eb4d478 16298670 id -a does not show all the groups a user belongs to
Jiri Sasek <Jiri.Sasek@Oracle.COM>
parents:
diff changeset
    29
 		/* Ignore errors here, just log it */
16e87eb4d478 16298670 id -a does not show all the groups a user belongs to
Jiri Sasek <Jiri.Sasek@Oracle.COM>
parents:
diff changeset
    30
-		DEBUG(10, ("query_user_list for domain %s returned %s/%s\n",
16e87eb4d478 16298670 id -a does not show all the groups a user belongs to
Jiri Sasek <Jiri.Sasek@Oracle.COM>
parents:
diff changeset
    31
+		DEBUG(1, ("query_user_list for domain %s failed with: %s/%s\n",
16e87eb4d478 16298670 id -a does not show all the groups a user belongs to
Jiri Sasek <Jiri.Sasek@Oracle.COM>
parents:
diff changeset
    32
 			   state->gstate->domain->name,
16e87eb4d478 16298670 id -a does not show all the groups a user belongs to
Jiri Sasek <Jiri.Sasek@Oracle.COM>
parents:
diff changeset
    33
 			   nt_errstr(status), nt_errstr(result)));
16e87eb4d478 16298670 id -a does not show all the groups a user belongs to
Jiri Sasek <Jiri.Sasek@Oracle.COM>
parents:
diff changeset
    34
-		tevent_req_nterror(req, result);
16e87eb4d478 16298670 id -a does not show all the groups a user belongs to
Jiri Sasek <Jiri.Sasek@Oracle.COM>
parents:
diff changeset
    35
-		return;
16e87eb4d478 16298670 id -a does not show all the groups a user belongs to
Jiri Sasek <Jiri.Sasek@Oracle.COM>
parents:
diff changeset
    36
+		state->gstate->num_groups = 0;
16e87eb4d478 16298670 id -a does not show all the groups a user belongs to
Jiri Sasek <Jiri.Sasek@Oracle.COM>
parents:
diff changeset
    37
 	}
16e87eb4d478 16298670 id -a does not show all the groups a user belongs to
Jiri Sasek <Jiri.Sasek@Oracle.COM>
parents:
diff changeset
    38
 
16e87eb4d478 16298670 id -a does not show all the groups a user belongs to
Jiri Sasek <Jiri.Sasek@Oracle.COM>
parents:
diff changeset
    39
 	state->gstate->num_groups = state->next_groups.num_principals;