summaryrefslogtreecommitdiff
path: root/source3
diff options
context:
space:
mode:
authorJeremy Allison <jra@samba.org>2002-05-10 01:15:36 +0000
committerJeremy Allison <jra@samba.org>2002-05-10 01:15:36 +0000
commit2586abb599c7266f1c2a729ddd1b75b55ec51bc7 (patch)
tree3221ef280b4122a546268030c07011b40d2bbe8f /source3
parent6b623b68d4ff5178b592e9d59c2f495b8c4c2953 (diff)
downloadsamba-2586abb599c7266f1c2a729ddd1b75b55ec51bc7.tar.gz
samba-2586abb599c7266f1c2a729ddd1b75b55ec51bc7.tar.bz2
samba-2586abb599c7266f1c2a729ddd1b75b55ec51bc7.zip
Fix the bug that refused to allow IPC$ connection to be idled if a pipe
was open - we now only refuse to allow IPC$ connection to be idled if a handle is open on a pipe. Jeremy. (This used to be commit fc043110bc42d56c8686b9b64c46af7be2fd236e)
Diffstat (limited to 'source3')
-rw-r--r--source3/rpc_server/srv_lsa_hnd.c17
1 files changed, 17 insertions, 0 deletions
diff --git a/source3/rpc_server/srv_lsa_hnd.c b/source3/rpc_server/srv_lsa_hnd.c
index 84c3c5a959..62af0ecac8 100644
--- a/source3/rpc_server/srv_lsa_hnd.c
+++ b/source3/rpc_server/srv_lsa_hnd.c
@@ -134,6 +134,14 @@ BOOL create_policy_hnd(pipes_struct *p, POLICY_HND *hnd, void (*free_fn)(void *)
DLIST_ADD(p->pipe_handles->Policy, pol);
p->pipe_handles->count++;
+ /*
+ * Ensure we don't idle this connection if a handle is open.
+ * Increment the number of files open on the first handle create.
+ */
+
+ if (p->pipe_handles->count == 1)
+ p->conn->num_files_open++;
+
*hnd = pol->pol_hnd;
DEBUG(4,("Opened policy hnd[%d] ", (int)p->pipe_handles->count));
@@ -201,6 +209,15 @@ BOOL close_policy_hnd(pipes_struct *p, POLICY_HND *hnd)
p->pipe_handles->count--;
+ /*
+ * Ensure we can idle this connection if this is the last handle.
+ * Decrement the number of files open on the last handle delete.
+ */
+
+ if (p->pipe_handles->count == 0)
+ p->conn->num_files_open--;
+
+
DLIST_REMOVE(p->pipe_handles->Policy, pol);
ZERO_STRUCTP(pol);