diff options
author | Jeremy Allison <jra@samba.org> | 2012-06-29 12:56:57 -0700 |
---|---|---|
committer | Jeremy Allison <jra@samba.org> | 2012-06-30 02:23:39 +0200 |
commit | 0362dcbd09f27b33ed8c5264c7f22ee00ddc5d64 (patch) | |
tree | 138e058f4050dc267850237b5ccbd1e018077b88 /source3/smbd | |
parent | 34bb743ce3e24dde8b8fccdccb8f9c443fb2cd6f (diff) | |
download | samba-0362dcbd09f27b33ed8c5264c7f22ee00ddc5d64.tar.gz samba-0362dcbd09f27b33ed8c5264c7f22ee00ddc5d64.tar.bz2 samba-0362dcbd09f27b33ed8c5264c7f22ee00ddc5d64.zip |
Fix defer_open() fuction in the open code path to cope with a NULL lck parameter.
Diffstat (limited to 'source3/smbd')
-rw-r--r-- | source3/smbd/open.c | 27 |
1 files changed, 16 insertions, 11 deletions
diff --git a/source3/smbd/open.c b/source3/smbd/open.c index f259cc99ec..c6d2f63b14 100644 --- a/source3/smbd/open.c +++ b/source3/smbd/open.c @@ -1355,20 +1355,23 @@ static void defer_open(struct share_mode_lock *lck, struct deferred_open_record *state) { struct server_id self = messaging_server_id(req->sconn->msg_ctx); - int i; /* Paranoia check */ - for (i=0; i<lck->data->num_share_modes; i++) { - struct share_mode_entry *e = &lck->data->share_modes[i]; + if (lck) { + int i; + + for (i=0; i<lck->data->num_share_modes; i++) { + struct share_mode_entry *e = &lck->data->share_modes[i]; - if (is_deferred_open_entry(e) && - serverid_equal(&self, &e->pid) && - (e->op_mid == req->mid)) { - DEBUG(0, ("Trying to defer an already deferred " - "request: mid=%llu, exiting\n", - (unsigned long long)req->mid)); - exit_server("attempt to defer a deferred request"); + if (is_deferred_open_entry(e) && + serverid_equal(&self, &e->pid) && + (e->op_mid == req->mid)) { + DEBUG(0, ("Trying to defer an already deferred " + "request: mid=%llu, exiting\n", + (unsigned long long)req->mid)); + exit_server("attempt to defer a deferred request"); + } } } @@ -1384,7 +1387,9 @@ static void defer_open(struct share_mode_lock *lck, state->id, (char *)state, sizeof(*state))) { exit_server("push_deferred_open_message_smb failed"); } - add_deferred_open(lck, req->mid, request_time, self, state->id); + if (lck) { + add_deferred_open(lck, req->mid, request_time, self, state->id); + } } |