[SCM] Samba Shared Repository - branch master updated
Andreas Schneider
asn at samba.org
Tue Nov 15 08:53:03 MST 2011
The branch, master has been updated
via 10b285c s3-winbind: Don't fail on users without a uid.
via 2fe5cd2 s3-winbind: Make sure the map is clean.
via 6cf0900 s3-winbind: Increase the negative cache entry timout.
from c1fd56f s4:dsdb/schema_data: reject schema update unless they're allowed
http://gitweb.samba.org/?p=samba.git;a=shortlog;h=master
- Log -----------------------------------------------------------------
commit 10b285ccc29b106f164a6c18116e237634867717
Author: Andreas Schneider <asn at samba.org>
Date: Mon Nov 14 10:01:31 2011 +0100
s3-winbind: Don't fail on users without a uid.
This fixes bug #8608.
If you join samba with idmap_ad backend to an AD. When you try to
enumerate users with 'getent passwd' and the user doesn't have a uid
set, then getent is aborted cause of NT_STATUS_NONE_MAPPED. If we can't
map a user we should not stop but continue enumerating users.
This normally happens with the default user 'krbtgt' with idmap_ad but
could also happen with other backends.
Autobuild-User: Andreas Schneider <asn at cryptomilk.org>
Autobuild-Date: Tue Nov 15 16:52:04 CET 2011 on sn-devel-104
commit 2fe5cd20b463cce5cef4c2376de817bffd78e457
Author: Andreas Schneider <asn at samba.org>
Date: Wed Nov 9 20:48:23 2011 +0100
s3-winbind: Make sure the map is clean.
commit 6cf090070ee9fccf23514f73ed22950764c9f1ca
Author: Andreas Schneider <asn at samba.org>
Date: Mon Nov 14 10:01:03 2011 +0100
s3-winbind: Increase the negative cache entry timout.
The timout for the cache entry of a negative connection should be the
double of a connect timeout (which is 30 seconds).
-----------------------------------------------------------------------
Summary of changes:
source3/include/local.h | 2 +-
source3/winbindd/idmap_util.c | 6 +++++-
source3/winbindd/wb_next_pwent.c | 20 +++++++++++++++++++-
3 files changed, 25 insertions(+), 3 deletions(-)
Changeset truncated at 500 lines:
diff --git a/source3/include/local.h b/source3/include/local.h
index 203f257..281248c 100644
--- a/source3/include/local.h
+++ b/source3/include/local.h
@@ -218,7 +218,7 @@
#define INVALID_SHARENAME_CHARS "%<>*?|/\\+=;:\","
/* Seconds between connection attempts to a remote server. */
-#define FAILED_CONNECTION_CACHE_TIMEOUT 30
+#define FAILED_CONNECTION_CACHE_TIMEOUT (LONG_CONNECT_TIMEOUT * 2 / 1000)
/* Default hash size for the winbindd cache. */
#define WINBINDD_CACHE_TDB_DEFAULT_HASH_SIZE 5000
diff --git a/source3/winbindd/idmap_util.c b/source3/winbindd/idmap_util.c
index a44aaf5..2ddf576 100644
--- a/source3/winbindd/idmap_util.c
+++ b/source3/winbindd/idmap_util.c
@@ -60,6 +60,7 @@ NTSTATUS idmap_uid_to_sid(const char *domname, struct dom_sid *sid, uid_t uid)
}
backend:
+ ZERO_STRUCT(map);
map.sid = sid;
map.xid.type = ID_TYPE_UID;
map.xid.id = uid;
@@ -119,6 +120,7 @@ NTSTATUS idmap_gid_to_sid(const char *domname, struct dom_sid *sid, gid_t gid)
}
backend:
+ ZERO_STRUCT(map);
map.sid = sid;
map.xid.type = ID_TYPE_GID;
map.xid.id = gid;
@@ -177,8 +179,9 @@ NTSTATUS idmap_sid_to_uid(const char *dom_name, struct dom_sid *sid, uid_t *uid)
}
backend:
+ ZERO_STRUCT(map);
map.sid = sid;
- map.xid.type = ID_TYPE_UID;
+ map.xid.type = ID_TYPE_UID;
ret = idmap_backends_sid_to_unixid(dom_name, &map);
@@ -250,6 +253,7 @@ NTSTATUS idmap_sid_to_gid(const char *domname, struct dom_sid *sid, gid_t *gid)
}
backend:
+ ZERO_STRUCT(map);
map.sid = sid;
map.xid.type = ID_TYPE_GID;
diff --git a/source3/winbindd/wb_next_pwent.c b/source3/winbindd/wb_next_pwent.c
index da4754c..a52a566 100644
--- a/source3/winbindd/wb_next_pwent.c
+++ b/source3/winbindd/wb_next_pwent.c
@@ -148,7 +148,25 @@ static void wb_next_pwent_fill_done(struct tevent_req *subreq)
status = wb_fill_pwent_recv(subreq);
TALLOC_FREE(subreq);
- if (tevent_req_nterror(req, status)) {
+ /*
+ * When you try to enumerate users with 'getent passwd' and the user
+ * doesn't have a uid set we should just move on.
+ */
+ if (NT_STATUS_EQUAL(status, NT_STATUS_NONE_MAPPED)) {
+ state->gstate->next_user += 1;
+
+ subreq = wb_fill_pwent_send(state,
+ state->ev,
+ &state->gstate->users[state->gstate->next_user],
+ state->pw);
+ if (tevent_req_nomem(subreq, req)) {
+ tevent_req_post(req, state->ev);
+ return;
+ }
+ tevent_req_set_callback(subreq, wb_next_pwent_fill_done, req);
+
+ return;
+ } else if (tevent_req_nterror(req, status)) {
return;
}
state->gstate->next_user += 1;
--
Samba Shared Repository
More information about the samba-cvs
mailing list