summaryrefslogtreecommitdiff
path: root/source3/lib
diff options
context:
space:
mode:
authorStefan Metzmacher <metze@samba.org>2012-10-09 08:35:04 -0400
committerMichael Adam <obnox@samba.org>2012-10-19 12:14:58 +0200
commit8a1c7a0a660d78786adac483ecafa157c3a3dc2e (patch)
tree6dc679aea61ef42c3ff54e3d5d126f95de80e3d5 /source3/lib
parent8eab264470ee7adea1e448fc29bc8111902a83b0 (diff)
downloadsamba-8a1c7a0a660d78786adac483ecafa157c3a3dc2e.tar.gz
samba-8a1c7a0a660d78786adac483ecafa157c3a3dc2e.tar.bz2
samba-8a1c7a0a660d78786adac483ecafa157c3a3dc2e.zip
s3:smbd: add exit_server to the smbd_shim hooks
This is in preparation of moving sessionid_tdb and conn_tdb to smbd exclusively. metze Signed-off-by: Michael Adam <obnox@samba.org>
Diffstat (limited to 'source3/lib')
-rw-r--r--source3/lib/smbd_shim.c16
-rw-r--r--source3/lib/smbd_shim.h4
2 files changed, 20 insertions, 0 deletions
diff --git a/source3/lib/smbd_shim.c b/source3/lib/smbd_shim.c
index 78a101c2a7..d5ad577975 100644
--- a/source3/lib/smbd_shim.c
+++ b/source3/lib/smbd_shim.c
@@ -98,3 +98,19 @@ void unbecome_root(void)
}
return;
}
+
+void exit_server(const char *reason)
+{
+ if (shim.exit_server) {
+ shim.exit_server(reason);
+ }
+ exit(1);
+}
+
+void exit_server_cleanly(const char *const reason)
+{
+ if (shim.exit_server_cleanly) {
+ shim.exit_server_cleanly(reason);
+ }
+ exit(0);
+}
diff --git a/source3/lib/smbd_shim.h b/source3/lib/smbd_shim.h
index a51decc28c..1645837f36 100644
--- a/source3/lib/smbd_shim.h
+++ b/source3/lib/smbd_shim.h
@@ -46,6 +46,10 @@ struct smbd_shim
void (*become_root)(void);
void (*unbecome_root)(void);
+
+ void (*exit_server)(const char *const explanation) _NORETURN_;
+
+ void (*exit_server_cleanly)(const char *const explanation) _NORETURN_;
};
void set_smbd_shim(const struct smbd_shim *shim_functions);