[SCM] Samba Shared Repository - branch v3-2-test updated -
release-3-2-0pre2-3185-ga0e36cd
Michael Adam
obnox at samba.org
Fri Nov 21 23:32:15 GMT 2008
The branch, v3-2-test has been updated
via a0e36cdd05cc9f5354dd9e834077919b8ce64262 (commit)
via 0943858d0297291a73c040a1412b1708b340dac7 (commit)
via e720a1533ba8063478a68ca94b39364a77529f41 (commit)
via 5eacc680d2615a1d8a2b4d51a6d08fa7e09e080e (commit)
via 3ad23ec3bd98aa55fa29c5c1cac60116b5fc00d2 (commit)
via d3e3c2c50ee404de25b46a06bd71f90a7214e69c (commit)
via 38020bdeb9115fe41038723a2ffaedb75df8e564 (commit)
from fc82807659cf4ab23df8ae7b98edfc715b54f591 (commit)
http://gitweb.samba.org/?p=samba.git;a=shortlog;h=v3-2-test
- Log -----------------------------------------------------------------
commit a0e36cdd05cc9f5354dd9e834077919b8ce64262
Author: Michael Adam <obnox at samba.org>
Date: Sun Sep 21 02:07:43 2008 +0200
winbindd_group: don't list the domain twice when expanding internal aliases
Before this, "getent group builtin\\administrators" expanded
domain group members in the form DOMAIN\domain\user.
Michael
commit 0943858d0297291a73c040a1412b1708b340dac7
Author: Michael Adam <obnox at samba.org>
Date: Sun Sep 21 02:06:44 2008 +0200
winbindd_group: sanely handle NULL domain in add_member().
Michael
commit e720a1533ba8063478a68ca94b39364a77529f41
Author: Michael Adam <obnox at samba.org>
Date: Mon Sep 22 10:39:37 2008 +0200
winbindd_ads: honour "winbind use default domain" in lookup_groupmem().
This fixes the output of "getent group" when "winbind use default domain = yes"
with security = ads.
Michael
commit 5eacc680d2615a1d8a2b4d51a6d08fa7e09e080e
Author: Michael Adam <obnox at samba.org>
Date: Sun Sep 21 01:20:32 2008 +0200
winbindd_rpc: add domain prefix to username in lookup_groupmem().
This makes the output of "getent group" of a domain group show the
domain prefix with "security = domain".
Michael
commit 3ad23ec3bd98aa55fa29c5c1cac60116b5fc00d2
Author: Michael Adam <obnox at samba.org>
Date: Mon Sep 22 10:37:11 2008 +0200
winbindd_util: add fill_domain_username_talloc().
A talloc version of fill_domain_username().
Michael
commit d3e3c2c50ee404de25b46a06bd71f90a7214e69c
Author: Michael Adam <obnox at samba.org>
Date: Mon Sep 22 14:51:51 2008 +0200
winbindd: fix a comment typo
Michael
commit 38020bdeb9115fe41038723a2ffaedb75df8e564
Author: Michael Adam <obnox at samba.org>
Date: Mon Sep 22 10:34:57 2008 +0200
winbind_util: fix an implicit cast compile warning.
Michael
-----------------------------------------------------------------------
Summary of changes:
source/winbindd/winbindd_ads.c | 20 +++++++++++---------
source/winbindd/winbindd_async.c | 2 +-
source/winbindd/winbindd_group.c | 8 ++++++--
source/winbindd/winbindd_rpc.c | 5 ++++-
source/winbindd/winbindd_util.c | 29 ++++++++++++++++++++++++++++-
5 files changed, 50 insertions(+), 14 deletions(-)
Changeset truncated at 500 lines:
diff --git a/source/winbindd/winbindd_ads.c b/source/winbindd/winbindd_ads.c
index 5b29f63..c130158 100644
--- a/source/winbindd/winbindd_ads.c
+++ b/source/winbindd/winbindd_ads.c
@@ -1097,10 +1097,11 @@ static NTSTATUS lookup_groupmem(struct winbindd_domain *domain,
DEBUG(10,("ads: lookup_groupmem: got sid %s from "
"cache\n", sid_string_dbg(&sid)));
sid_copy(&(*sid_mem)[*num_names], &sid);
- (*names)[*num_names] = talloc_asprintf(*names, "%s%c%s",
- domain_name,
- *lp_winbind_separator(),
- name );
+ (*names)[*num_names] = fill_domain_username_talloc(
+ *names,
+ domain_name,
+ name,
+ true);
(*name_types)[*num_names] = name_type;
(*num_names)++;
@@ -1168,11 +1169,12 @@ static NTSTATUS lookup_groupmem(struct winbindd_domain *domain,
{
sid_copy(&(*sid_mem)[*num_names],
&sid_mem_nocache[i]);
- (*names)[*num_names] = talloc_asprintf( *names,
- "%s%c%s",
- domains_nocache[i],
- *lp_winbind_separator(),
- names_nocache[i] );
+ (*names)[*num_names] =
+ fill_domain_username_talloc(
+ *names,
+ domains_nocache[i],
+ names_nocache[i],
+ true);
(*name_types)[*num_names] = name_types_nocache[i];
(*num_names)++;
}
diff --git a/source/winbindd/winbindd_async.c b/source/winbindd/winbindd_async.c
index f29953d..89a0924 100644
--- a/source/winbindd/winbindd_async.c
+++ b/source/winbindd/winbindd_async.c
@@ -366,7 +366,7 @@ static void lookupname_recv(TALLOC_CTX *mem_ctx, bool success,
/********************************************************************
The lookup name call first contacts a DC in its own domain
- and fallbacks to contact a DC in the forest in our domain doesn't
+ and fallbacks to contact a DC if the forest in our domain doesn't
know the name.
********************************************************************/
diff --git a/source/winbindd/winbindd_group.c b/source/winbindd/winbindd_group.c
index 897795a..c212294 100644
--- a/source/winbindd/winbindd_group.c
+++ b/source/winbindd/winbindd_group.c
@@ -35,7 +35,11 @@ static void add_member(const char *domain, const char *user,
{
fstring name;
- fill_domain_username(name, domain, user, True);
+ if (domain != NULL) {
+ fill_domain_username(name, domain, user, True);
+ } else {
+ fstrcpy(name, user);
+ }
safe_strcat(name, ",", sizeof(name)-1);
string_append(pp_members, name);
*p_num_members += 1;
@@ -134,7 +138,7 @@ static void add_expanded_sid(const DOM_SID *sid, char **pp_members, size_t *p_nu
continue;
}
- add_member(domain->name, names[i], pp_members, p_num_members);
+ add_member(NULL, names[i], pp_members, p_num_members);
}
done:
diff --git a/source/winbindd/winbindd_rpc.c b/source/winbindd/winbindd_rpc.c
index c231d14..b03e035 100644
--- a/source/winbindd/winbindd_rpc.c
+++ b/source/winbindd/winbindd_rpc.c
@@ -821,7 +821,10 @@ static NTSTATUS lookup_groupmem(struct winbindd_domain *domain,
}
for (r=0; r<tmp_names.count; r++) {
- (*names)[i+r] = CONST_DISCARD(char *, tmp_names.names[r].string);
+ (*names)[i+r] = fill_domain_username_talloc(mem_ctx,
+ domain->name,
+ tmp_names.names[r].string,
+ true);
(*name_types)[i+r] = tmp_types.ids[r];
}
diff --git a/source/winbindd/winbindd_util.c b/source/winbindd/winbindd_util.c
index abc3df8..a2a248b 100644
--- a/source/winbindd/winbindd_util.c
+++ b/source/winbindd/winbindd_util.c
@@ -1142,7 +1142,7 @@ void parse_add_domuser(void *buf, char *domuser, int *len)
}
}
- safe_strcpy(buf, user, *len);
+ safe_strcpy((char *)buf, user, *len);
}
/* Ensure an incoming username from NSS is fully qualified. Replace the
@@ -1195,6 +1195,33 @@ void fill_domain_username(fstring name, const char *domain, const char *user, bo
}
}
+/**
+ * talloc version of fill_domain_username()
+ * return NULL on talloc failure.
+ */
+char *fill_domain_username_talloc(TALLOC_CTX *mem_ctx,
+ const char *domain,
+ const char *user,
+ bool can_assume)
+{
+ char *tmp_user, *name;
+
+ tmp_user = talloc_strdup(mem_ctx, user);
+ strlower_m(tmp_user);
+
+ if (can_assume && assume_domain(domain)) {
+ name = tmp_user;
+ } else {
+ name = talloc_asprintf(mem_ctx, "%s%c%s",
+ domain,
+ *lp_winbind_separator(),
+ tmp_user);
+ TALLOC_FREE(tmp_user);
+ }
+
+ return name;
+}
+
/*
* Winbindd socket accessor functions
*/
--
Samba Shared Repository
More information about the samba-cvs
mailing list