diff options
author | Volker Lendecke <vlendec@samba.org> | 2007-05-28 12:39:39 +0000 |
---|---|---|
committer | Gerald (Jerry) Carter <jerry@samba.org> | 2007-10-10 12:22:52 -0500 |
commit | fff51a9af20b7221844ffb11d7491372bbbcda0e (patch) | |
tree | 8f18dd41cde0675c43797545a664e44d54cc5707 | |
parent | 054bf2fc8bd8ac62e16ec04001c0a4a8409d0e1d (diff) | |
download | samba-fff51a9af20b7221844ffb11d7491372bbbcda0e.tar.gz samba-fff51a9af20b7221844ffb11d7491372bbbcda0e.tar.bz2 samba-fff51a9af20b7221844ffb11d7491372bbbcda0e.zip |
r23172: Change shutdown_other_smbds to use connections_traverse instead of
session_traverse.
(This used to be commit ccb5eb245e962b0264b337c2d0275c22e2a36830)
-rw-r--r-- | source3/smbd/session.c | 5 | ||||
-rw-r--r-- | source3/smbd/sesssetup.c | 19 |
2 files changed, 13 insertions, 11 deletions
diff --git a/source3/smbd/session.c b/source3/smbd/session.c index cd7511430e..f55576a7be 100644 --- a/source3/smbd/session.c +++ b/source3/smbd/session.c @@ -202,8 +202,9 @@ void session_yield(user_struct *vuser) /******************************************************************** ********************************************************************/ -BOOL session_traverse(int (*fn)(TDB_CONTEXT *, TDB_DATA, TDB_DATA, void *), - void *state) +static BOOL session_traverse(int (*fn)(TDB_CONTEXT *, TDB_DATA, TDB_DATA, + void *), + void *state) { if (!session_init()) { DEBUG(3, ("No tdb opened\n")); diff --git a/source3/smbd/sesssetup.c b/source3/smbd/sesssetup.c index ccfc22598d..42a71f8ad7 100644 --- a/source3/smbd/sesssetup.c +++ b/source3/smbd/sesssetup.c @@ -1174,25 +1174,26 @@ static int reply_sesssetup_and_X_spnego(connection_struct *conn, char *inbuf, a new session setup with VC==0 is ignored. ****************************************************************************/ -static int shutdown_other_smbds(TDB_CONTEXT *tdb, TDB_DATA kbuf, TDB_DATA dbuf, - void *p) +static int shutdown_other_smbds(struct db_record *rec, + const struct connections_key *key, + const struct connections_data *crec, + void *private_data) { - struct sessionid *sessionid = (struct sessionid *)dbuf.dptr; - const char *ip = (const char *)p; + const char *ip = (const char *)private_data; - if (!process_exists(sessionid->pid)) { + if (!process_exists(crec->pid)) { return 0; } - if (procid_is_me(&sessionid->pid)) { + if (procid_is_me(&crec->pid)) { return 0; } - if (strcmp(ip, sessionid->ip_addr) != 0) { + if (strcmp(ip, crec->addr) != 0) { return 0; } - messaging_send(smbd_messaging_context(), sessionid->pid, MSG_SHUTDOWN, + messaging_send(smbd_messaging_context(), crec->pid, MSG_SHUTDOWN, &data_blob_null); return 0; } @@ -1205,7 +1206,7 @@ static void setup_new_vc_session(void) invalidate_all_vuids(); #endif if (lp_reset_on_zero_vc()) { - session_traverse(shutdown_other_smbds, client_addr()); + connections_forall(shutdown_other_smbds, client_addr()); } } |