[SCM] SAMBA-CTDB repository - branch v3-2-ctdb updated -
build_3.2.7_ctdb.54-105-g9b5bb1d
Michael Adam
obnox at samba.org
Mon Feb 9 22:42:34 GMT 2009
The branch, v3-2-ctdb has been updated
via 9b5bb1d51f0c6c9a5c0a32468ad878ab6ec2a4c2 (commit)
via 0696a89d50dde29cb5fc4daf4d70f5eab68f73a6 (commit)
via 13745d1d2189d11821ab8bbe5bd3ee179fb9084d (commit)
via 4cd1268d27d97ccc018257ccccd2775e0bc1403a (commit)
via 3fd54adb6c6e60081fe723e99dd5d54542634594 (commit)
from b392a2441b393cc19235e3f287e438f8b8c62579 (commit)
http://gitweb.samba.org/?p=obnox/samba-ctdb.git;a=shortlog;h=v3-2-ctdb
- Log -----------------------------------------------------------------
commit 9b5bb1d51f0c6c9a5c0a32468ad878ab6ec2a4c2
Author: Tim Prouty <tprouty at samba.org>
Date: Sun Feb 1 23:59:53 2009 -0800
s3 build: Fix "assignment discards qualifiers from pointer target type" warnings
Signed-off-by: Michael Adam <obnox at samba.org>
commit 0696a89d50dde29cb5fc4daf4d70f5eab68f73a6
Author: Michael Adam <obnox at samba.org>
Date: Mon Feb 9 16:08:19 2009 +0100
s3:winbind_user: fix "getent passwd" to allocate new uids.
"getent passwd" used to fill the idmap cache with negative
cache entries for unmapped user sids.
Don't pass domain name unconditionally to idmap_sid_to_[ug]id().
idmap_sid_to_[ug]id() only creates new mappings (allocating
idmap backends tdb, tdb2, ldap...) when the domain name passed
in is "".
Note that it is _wrong_ to directly call the idmap_sid_to_[ug]id()
functions here, in the main winbindd. The correct fix would be
to send a sid_to_[ug]id request to winbindd itself, but this needs
more work to prepare the async mechanisms, and we nee a quick
fix for getent passwd now.
Michael
commit 13745d1d2189d11821ab8bbe5bd3ee179fb9084d
Author: Michael Adam <obnox at samba.org>
Date: Mon Feb 2 00:46:57 2009 +0100
s3:winbind_group: fix "getent group" to allocate new gids.
"getent group" used to fill the idmap cache with negative
cache entries for unmapped group sids.
Don't pass domain name unconditionally to idmap_sid_to_gid().
idmap_sid_to_gid() only creates new mappings (allocating
idmap backends tdb, tdb2, ldap...) when the domain name passed
in is "".
Note that it is _wrong_ to directly call the idmap_sid_to_gid()
functions here, in the main winbindd. The correct fix would be
to send a sid_to_gid request to winbindd itself, but this needs
more work to prepare the async mechanisms, and we nee a quick
fix for getent passwd now.
Michael
(cherry picked from commit 8c64302915bde8a5400b575389b12e0eaf2cf140)
Signed-off-by: Michael Adam <obnox at samba.org>
commit 4cd1268d27d97ccc018257ccccd2775e0bc1403a
Author: todd stecher <todd.stecher at gmail.com>
Date: Thu Jan 22 10:17:37 2009 -0800
Memory leaks and other fixes found by Coverity
(This is the winbindd_group.c portion of the patch - obnox)
Signed-off-by: Michael Adam <obnox at samba.org>
commit 3fd54adb6c6e60081fe723e99dd5d54542634594
Author: todd stecher <todd.stecher at gmail.com>
Date: Thu Jan 22 10:17:37 2009 -0800
Memory leaks and other fixes found by Coverity
(This is the winbindd_user.c portion of the patch - obnox)
Signed-off-by: Michael Adam <obnox at samba.org>
-----------------------------------------------------------------------
Summary of changes:
source/winbindd/winbindd_group.c | 14 +++++++++++---
source/winbindd/winbindd_user.c | 26 +++++++++++++++++++++-----
2 files changed, 32 insertions(+), 8 deletions(-)
Changeset truncated at 500 lines:
diff --git a/source/winbindd/winbindd_group.c b/source/winbindd/winbindd_group.c
index 75ec28c..b2d2965 100644
--- a/source/winbindd/winbindd_group.c
+++ b/source/winbindd/winbindd_group.c
@@ -880,7 +880,13 @@ static void getgrgid_recv(void *private_data, bool success, const char *sid)
DEBUG(10,("getgrgid_recv: gid %lu has sid %s\n",
(unsigned long)(state->request.data.gid), sid));
- string_to_sid(&group_sid, sid);
+ if (!string_to_sid(&group_sid, sid)) {
+ DEBUG(1,("getgrgid_recv: Could not convert sid %s "
+ "from string\n", sid));
+ request_error(state);
+ return;
+ }
+
winbindd_getgrsid(state, group_sid);
return;
}
@@ -1236,8 +1242,10 @@ void winbindd_getgrent(struct winbindd_cli_state *state)
sid_copy(&group_sid, &domain->sid);
sid_append_rid(&group_sid, name_list[ent->sam_entry_index].rid);
- if (!NT_STATUS_IS_OK(idmap_sid_to_gid(domain->name, &group_sid,
- &group_gid))) {
+ if (!NT_STATUS_IS_OK(idmap_sid_to_gid(domain->have_idmap_config
+ ? domain->name : "",
+ &group_sid, &group_gid)))
+ {
union unid_t id;
enum lsa_SidType type;
diff --git a/source/winbindd/winbindd_user.c b/source/winbindd/winbindd_user.c
index a60a573..cf6d1d9 100644
--- a/source/winbindd/winbindd_user.c
+++ b/source/winbindd/winbindd_user.c
@@ -73,13 +73,22 @@ static bool winbindd_fill_pwent(char *dom_name, char *user_name,
struct winbindd_pw *pw)
{
fstring output_username;
-
+ struct winbindd_domain * domain = NULL;
+
if (!pw || !dom_name || !user_name)
return False;
-
+
+ domain = find_domain_from_name_noinit(dom_name);
+ if (domain == NULL) {
+ DEBUG(5,("winbindd_fill_pwent: Failed to find domain for %s.\n",
+ dom_name));
+ return false;
+ }
+
/* Resolve the uid number */
- if (!NT_STATUS_IS_OK(idmap_sid_to_uid(dom_name, user_sid,
+ if (!NT_STATUS_IS_OK(idmap_sid_to_uid(domain->have_idmap_config ?
+ dom_name : "", user_sid,
&pw->pw_uid))) {
DEBUG(1, ("error getting user id for sid %s\n",
sid_string_dbg(user_sid)));
@@ -88,7 +97,8 @@ static bool winbindd_fill_pwent(char *dom_name, char *user_name,
/* Resolve the gid number */
- if (!NT_STATUS_IS_OK(idmap_sid_to_gid(dom_name, group_sid,
+ if (!NT_STATUS_IS_OK(idmap_sid_to_gid(domain->have_idmap_config ?
+ dom_name : "", group_sid,
&pw->pw_gid))) {
DEBUG(1, ("error getting group id for sid %s\n",
sid_string_dbg(group_sid)));
@@ -457,7 +467,13 @@ static void getpwuid_recv(void *private_data, bool success, const char *sid)
DEBUG(10,("uid2sid_recv: uid %lu has sid %s\n",
(unsigned long)(state->request.data.uid), sid));
- string_to_sid(&user_sid, sid);
+ if (!string_to_sid(&user_sid, sid)) {
+ DEBUG(1,("uid2sid_recv: Could not convert sid %s "
+ "from string\n,", sid));
+ request_error(state);
+ return;
+ }
+
winbindd_getpwsid(state, &user_sid);
}
--
SAMBA-CTDB repository
More information about the samba-cvs
mailing list