[SCM] Samba Shared Repository - branch v3-5-test updated
Volker Lendecke
vlendec at samba.org
Sat Dec 26 04:28:31 MST 2009
The branch, v3-5-test has been updated
via 2b0ffa2... s3: Fix a bogus uninitialized variable warning
via 826aaec... s3: Replace IS_DOMAIN_OFFLINE by a function
via b4dd801... s3: Fix some nonempty blank lines
via 6b6b47c... s3: winbindd_cli_state->getgrent_state is no longer used
via 48945cd... s3: getgrent_state has been replaced by grent_state
from 413f458... s3: Remove unused delete_negative_conn_cache()
http://gitweb.samba.org/?p=samba.git;a=shortlog;h=v3-5-test
- Log -----------------------------------------------------------------
commit 2b0ffa2b9a5b95608102437d9be7ba2c4a18515d
Author: Volker Lendecke <vl at samba.org>
Date: Thu Dec 24 12:56:09 2009 +0100
s3: Fix a bogus uninitialized variable warning
commit 826aaecc6bca06a8d978530859e2e985197811a5
Author: Volker Lendecke <vl at samba.org>
Date: Thu Dec 24 12:52:24 2009 +0100
s3: Replace IS_DOMAIN_OFFLINE by a function
commit b4dd801f457e142f5a412bf8af9edcfb3c0f86d4
Author: Volker Lendecke <vl at samba.org>
Date: Wed Dec 23 15:22:09 2009 +0100
s3: Fix some nonempty blank lines
commit 6b6b47c0baf014e8e97e49fd81668297682e3ac7
Author: Volker Lendecke <vl at samba.org>
Date: Thu Dec 24 12:52:00 2009 +0100
s3: winbindd_cli_state->getgrent_state is no longer used
commit 48945cd1ebfa657ae96217200dd5a06dbe90729b
Author: Volker Lendecke <vl at samba.org>
Date: Thu Dec 24 12:51:09 2009 +0100
s3: getgrent_state has been replaced by grent_state
-----------------------------------------------------------------------
Summary of changes:
source3/libsmb/conncache.c | 6 +++---
source3/winbindd/wb_sid2gid.c | 2 +-
source3/winbindd/wb_sid2uid.c | 2 +-
source3/winbindd/winbindd.c | 6 +-----
source3/winbindd/winbindd.h | 16 ----------------
source3/winbindd/winbindd_cache.c | 4 ++--
source3/winbindd/winbindd_dual.c | 4 ++--
source3/winbindd/winbindd_proto.h | 2 +-
source3/winbindd/winbindd_rpc.c | 2 +-
source3/winbindd/winbindd_util.c | 34 +++++++++++-----------------------
10 files changed, 23 insertions(+), 55 deletions(-)
Changeset truncated at 500 lines:
diff --git a/source3/libsmb/conncache.c b/source3/libsmb/conncache.c
index 46dc6d6..85a09cc 100644
--- a/source3/libsmb/conncache.c
+++ b/source3/libsmb/conncache.c
@@ -13,12 +13,12 @@
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 3 of the License, or
(at your option) any later version.
-
+
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
-
+
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
@@ -191,7 +191,7 @@ void add_failed_connection_entry(const char *domain, const char *server,
DEBUG(1,("add_failed_connection_entry: failed to add "
"domain %s (%s) to failed conn cache\n",
domain, server));
-
+
done:
TALLOC_FREE(key);
TALLOC_FREE(value);
diff --git a/source3/winbindd/wb_sid2gid.c b/source3/winbindd/wb_sid2gid.c
index a578746..e15d563 100644
--- a/source3/winbindd/wb_sid2gid.c
+++ b/source3/winbindd/wb_sid2gid.c
@@ -54,7 +54,7 @@ struct tevent_req *wb_sid2gid_send(TALLOC_CTX *mem_ctx,
DEBUG(10, ("idmap_cache_find_sid2gid found %d%s\n",
(int)state->gid, expired ? " (expired)": ""));
- if (!expired || IS_DOMAIN_OFFLINE(find_our_domain())) {
+ if (!expired || is_domain_offline(find_our_domain())) {
if (state->gid == -1) {
tevent_req_nterror(req, NT_STATUS_NONE_MAPPED);
} else {
diff --git a/source3/winbindd/wb_sid2uid.c b/source3/winbindd/wb_sid2uid.c
index abfe257..9c22b8d 100644
--- a/source3/winbindd/wb_sid2uid.c
+++ b/source3/winbindd/wb_sid2uid.c
@@ -53,7 +53,7 @@ struct tevent_req *wb_sid2uid_send(TALLOC_CTX *mem_ctx,
DEBUG(10, ("idmap_cache_find_sid2uid found %d%s\n",
(int)state->uid, expired ? " (expired)": ""));
- if (!expired || IS_DOMAIN_OFFLINE(find_our_domain())) {
+ if (!expired || is_domain_offline(find_our_domain())) {
if (state->uid == -1) {
tevent_req_nterror(req, NT_STATUS_NONE_MAPPED);
} else {
diff --git a/source3/winbindd/winbindd.c b/source3/winbindd/winbindd.c
index 597957d..e31103a 100644
--- a/source3/winbindd/winbindd.c
+++ b/source3/winbindd/winbindd.c
@@ -835,10 +835,6 @@ static void remove_client(struct winbindd_cli_state *state)
state->sock = -1;
}
- /* Free any getent state */
-
- free_getent_state(state->getgrent_state);
-
TALLOC_FREE(state->mem_ctx);
/* Remove from list and free */
@@ -857,7 +853,7 @@ static bool remove_idle_client(void)
for (state = winbindd_client_list(); state; state = state->next) {
if (state->response == NULL &&
- !state->pwent_state && !state->getgrent_state) {
+ !state->pwent_state && !state->grent_state) {
nidle++;
if (!last_access || state->last_access < last_access) {
last_access = state->last_access;
diff --git a/source3/winbindd/winbindd.h b/source3/winbindd/winbindd.h
index e582302..a589ecc 100644
--- a/source3/winbindd/winbindd.h
+++ b/source3/winbindd/winbindd.h
@@ -65,22 +65,11 @@ struct winbindd_cli_state {
* initialized? */
bool getgrent_initialized; /* Has getgrent_state been
* initialized? */
- struct getent_state *getgrent_state; /* State for getgrent() */
struct getpwent_state *pwent_state; /* State for getpwent() */
struct getgrent_state *grent_state; /* State for getgrent() */
};
-/* State between get{pw,gr}ent() calls */
-
-struct getent_state {
- struct getent_state *prev, *next;
- void *sam_entries;
- uint32 sam_entry_index, num_sam_entries;
- bool got_sam_entries;
- fstring domain_name;
-};
-
struct getpwent_state {
struct winbindd_domain *domain;
int next_user;
@@ -398,9 +387,4 @@ struct WINBINDD_CCACHE_ENTRY {
#define WINBINDD_PAM_AUTH_KRB5_RENEW_TIME 2592000 /* one month */
#define DOM_SEQUENCE_NONE ((uint32)-1)
-#define IS_DOMAIN_OFFLINE(x) ( lp_winbind_offline_logon() && \
- ( get_global_winbindd_state_offline() \
- || !(x)->online ) )
-#define IS_DOMAIN_ONLINE(x) (!IS_DOMAIN_OFFLINE(x))
-
#endif /* _WINBINDD_H */
diff --git a/source3/winbindd/winbindd_cache.c b/source3/winbindd/winbindd_cache.c
index 6e70a18..ac85588 100644
--- a/source3/winbindd/winbindd_cache.c
+++ b/source3/winbindd/winbindd_cache.c
@@ -514,7 +514,7 @@ static void refresh_sequence_number(struct winbindd_domain *domain, bool force)
time_t t = time(NULL);
unsigned cache_time = lp_winbind_cache_time();
- if ( IS_DOMAIN_OFFLINE(domain) ) {
+ if (is_domain_offline(domain)) {
return;
}
@@ -4394,7 +4394,7 @@ bool wcache_fetch_ndr(TALLOC_CTX *mem_ctx, struct winbindd_domain *domain,
goto fail;
}
- if (IS_DOMAIN_ONLINE(domain)) {
+ if (is_domain_offline(domain)) {
uint32_t entry_seqnum, dom_seqnum, last_check;
if (!wcache_fetch_seqnum(domain->name, &dom_seqnum,
diff --git a/source3/winbindd/winbindd_dual.c b/source3/winbindd/winbindd_dual.c
index a852727..9a80d48 100644
--- a/source3/winbindd/winbindd_dual.c
+++ b/source3/winbindd/winbindd_dual.c
@@ -744,7 +744,7 @@ void winbind_msg_onlinestatus(struct messaging_context *msg_ctx,
TALLOC_CTX *mem_ctx;
const char *message;
struct server_id *sender;
-
+
DEBUG(5,("winbind_msg_onlinestatus received.\n"));
if (!data->data) {
@@ -757,7 +757,7 @@ void winbind_msg_onlinestatus(struct messaging_context *msg_ctx,
if (mem_ctx == NULL) {
return;
}
-
+
message = collect_onlinestatus(mem_ctx);
if (message == NULL) {
talloc_destroy(mem_ctx);
diff --git a/source3/winbindd/winbindd_proto.h b/source3/winbindd/winbindd_proto.h
index cb3e841..263e326 100644
--- a/source3/winbindd/winbindd_proto.h
+++ b/source3/winbindd/winbindd_proto.h
@@ -428,7 +428,6 @@ struct winbindd_domain *find_root_domain(void);
struct winbindd_domain *find_builtin_domain(void);
struct winbindd_domain *find_lookup_domain_from_sid(const DOM_SID *sid);
struct winbindd_domain *find_lookup_domain_from_name(const char *domain_name);
-void free_getent_state(struct getent_state *state);
bool parse_domain_user(const char *domuser, fstring domain, fstring user);
bool parse_domain_user_talloc(TALLOC_CTX *mem_ctx, const char *domuser,
char **domain, char **user);
@@ -475,6 +474,7 @@ void winbindd_unset_locator_kdc_env(const struct winbindd_domain *domain);
void winbindd_set_locator_kdc_envs(const struct winbindd_domain *domain);
void winbindd_unset_locator_kdc_env(const struct winbindd_domain *domain);
void set_auth_errors(struct winbindd_response *resp, NTSTATUS result);
+bool is_domain_offline(const struct winbindd_domain *domain);
/* The following definitions come from winbindd/winbindd_wins.c */
diff --git a/source3/winbindd/winbindd_rpc.c b/source3/winbindd/winbindd_rpc.c
index b6cb56e..f504b90 100644
--- a/source3/winbindd/winbindd_rpc.c
+++ b/source3/winbindd/winbindd_rpc.c
@@ -1253,7 +1253,7 @@ NTSTATUS winbindd_lookup_names(TALLOC_CTX *mem_ctx,
NTSTATUS status;
struct rpc_pipe_client *cli = NULL;
struct policy_handle lsa_policy;
- unsigned int orig_timeout;
+ unsigned int orig_timeout = 0;
lookup_names_fn_t lookup_names_fn = rpccli_lsa_lookup_names;
if (domain->can_do_ncacn_ip_tcp) {
diff --git a/source3/winbindd/winbindd_util.c b/source3/winbindd/winbindd_util.c
index c92e11a..1760382 100644
--- a/source3/winbindd/winbindd_util.c
+++ b/source3/winbindd/winbindd_util.c
@@ -868,29 +868,6 @@ struct winbindd_domain *find_lookup_domain_from_name(const char *domain_name)
return find_our_domain();
}
-/* Free state information held for {set,get,end}{pw,gr}ent() functions */
-
-void free_getent_state(struct getent_state *state)
-{
- struct getent_state *temp;
-
- /* Iterate over state list */
-
- temp = state;
-
- while(temp != NULL) {
- struct getent_state *next = temp->next;
-
- /* Free sam entries then list entry */
-
- SAFE_FREE(state->sam_entries);
- DLIST_REMOVE(state, state);
-
- SAFE_FREE(temp);
- temp = next;
- }
-}
-
/* Is this a domain which we may assume no DOMAIN\ prefix? */
static bool assume_domain(const char *domain)
@@ -1484,3 +1461,14 @@ void set_auth_errors(struct winbindd_response *resp, NTSTATUS result)
get_friendly_nt_error_msg(result));
resp->data.auth.pam_error = nt_status_to_pam(result);
}
+
+bool is_domain_offline(const struct winbindd_domain *domain)
+{
+ if (!lp_winbind_offline_logon()) {
+ return false;
+ }
+ if (get_global_winbindd_state_offline()) {
+ return true;
+ }
+ return !domain->online;
+}
--
Samba Shared Repository
More information about the samba-cvs
mailing list