summaryrefslogtreecommitdiff
path: root/source3/smbd/server.c
diff options
context:
space:
mode:
authorAlexander Bokovoy <ab@samba.org>2008-04-08 15:19:01 +0400
committerAlexander Bokovoy <ab@samba.org>2008-04-08 15:19:01 +0400
commitc2bb4b51c1e660a675197063781323fe65c97135 (patch)
treebd6610fea398a832d021271e833f207c6d7a0187 /source3/smbd/server.c
parent0eba3b5b8f9b0f8f8941bbef8cedf07477b9f3d8 (diff)
downloadsamba-c2bb4b51c1e660a675197063781323fe65c97135.tar.gz
samba-c2bb4b51c1e660a675197063781323fe65c97135.tar.bz2
samba-c2bb4b51c1e660a675197063781323fe65c97135.zip
Destroy DMAPI session when main smbd daemon exits.
DMAPI session is precious resource maintained at kernel level. We open one of them and use across multiple smbd daemons but once last of them exits, DMAPI session needs to be destroyed. There are some HSM implementations which fail to shutdown when opened DMAPI sessions left. Ensure we shutdown our session when it is really not needed anymore. This is what recommended by DMAPI specification anyway. (This used to be commit a0cefd44009d414fa00ec6e08c70d21b74acdbcb)
Diffstat (limited to 'source3/smbd/server.c')
-rw-r--r--source3/smbd/server.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/source3/smbd/server.c b/source3/smbd/server.c
index 179d480f43..7a6e17135f 100644
--- a/source3/smbd/server.c
+++ b/source3/smbd/server.c
@@ -918,6 +918,15 @@ static void exit_server_common(enum server_exit_reason how,
}
#endif
+#ifdef USE_DMAPI
+ /* Destroy Samba DMAPI session only if we are master smbd process */
+ if (am_parent) {
+ if (!dmapi_destroy_session()) {
+ DEBUG(0,("Unable to close Samba DMAPI session\n"));
+ }
+ }
+#endif
+
locking_end();
printing_end();