summaryrefslogtreecommitdiff
path: root/source3/passdb
diff options
context:
space:
mode:
authorVolker Lendecke <vl@samba.org>2011-02-19 17:44:48 +0100
committerVolker Lendecke <vl@samba.org>2011-02-20 10:23:29 +0100
commit351b672426dfba61b7994e59350f4ee3c6d49bc0 (patch)
treeaf2707ef9359444adc1fc75e5f6e8870120ce03f /source3/passdb
parent3e4da946699f77abd40c9eb03c2cf67263149e16 (diff)
downloadsamba-351b672426dfba61b7994e59350f4ee3c6d49bc0.tar.gz
samba-351b672426dfba61b7994e59350f4ee3c6d49bc0.tar.bz2
samba-351b672426dfba61b7994e59350f4ee3c6d49bc0.zip
s3: Make QueryDispInfo and QueryInfo match for guest
Diffstat (limited to 'source3/passdb')
-rw-r--r--source3/passdb/pdb_ads.c25
1 files changed, 19 insertions, 6 deletions
diff --git a/source3/passdb/pdb_ads.c b/source3/passdb/pdb_ads.c
index bcb803b396..0dc39fd308 100644
--- a/source3/passdb/pdb_ads.c
+++ b/source3/passdb/pdb_ads.c
@@ -1956,6 +1956,7 @@ static bool pdb_ads_search_filter(struct pdb_methods *m,
for (i=0; i<num_users; i++) {
struct samr_displayentry *e;
struct dom_sid sid;
+ uint32_t ctrl;
e = &sstate->entries[sstate->num_entries];
@@ -1966,18 +1967,30 @@ static bool pdb_ads_search_filter(struct pdb_methods *m,
}
sid_peek_rid(&sid, &e->rid);
e->acct_flags = ACB_NORMAL;
- e->account_name = tldap_talloc_single_attribute(
- users[i], "samAccountName", sstate->entries);
+
+ if (e->rid == DOMAIN_RID_GUEST) {
+ /*
+ * Guest is specially crafted in s3. Make
+ * QueryDisplayInfo match QueryUserInfo
+ */
+ e->account_name = lp_guestaccount();
+ e->fullname = lp_guestaccount();
+ e->description = "";
+ e->acct_flags = ACB_NORMAL;
+ } else {
+ e->account_name = tldap_talloc_single_attribute(
+ users[i], "samAccountName", sstate->entries);
+ e->fullname = tldap_talloc_single_attribute(
+ users[i], "displayName", sstate->entries);
+ e->description = tldap_talloc_single_attribute(
+ users[i], "description", sstate->entries);
+ }
if (e->account_name == NULL) {
return false;
}
- e->fullname = tldap_talloc_single_attribute(
- users[i], "displayName", sstate->entries);
if (e->fullname == NULL) {
e->fullname = "";
}
- e->description = tldap_talloc_single_attribute(
- users[i], "description", sstate->entries);
if (e->description == NULL) {
e->description = "";
}