}
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);
+}
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);
bool reload_services(struct smbd_server_connection *sconn,
bool (*snumused) (struct smbd_server_connection *, int),
bool test);
-void exit_server(const char *const explanation);
-void exit_server_cleanly(const char *const explanation);
NTSTATUS messaging_send_to_children(struct messaging_context *msg_ctx,
uint32_t msg_type, DATA_BLOB* data);
+/* The following definitions come from smbd/server_exit.c */
+
+void smbd_exit_server(const char *reason) _NORETURN_;
+void smbd_exit_server_cleanly(const char *const reason) _NORETURN_;
+
/* The following definitions come from smbd/service.c */
bool set_conn_connectpath(connection_struct *conn, const char *connectpath);
.become_root = smbd_become_root,
.unbecome_root = smbd_unbecome_root,
+
+ .exit_server = smbd_exit_server,
+ .exit_server_cleanly = smbd_exit_server_cleanly,
};
/*
exit(0);
}
-void exit_server(const char *const explanation)
+void smbd_exit_server(const char *const explanation)
{
exit_server_common(SERVER_EXIT_ABNORMAL, explanation);
}
-void exit_server_cleanly(const char *const explanation)
+void smbd_exit_server_cleanly(const char *const explanation)
{
exit_server_common(SERVER_EXIT_NORMAL, explanation);
}
#include "serverid.h"
#include "messages.h"
#include "libcli/security/security.h"
+#include "lib/smbd_shim.h"
/* List to hold groups of commands */
static struct cmd_list {
}
}
-void exit_server(const char *reason)
+static void vfstest_exit_server(const char * const reason)
{
DEBUG(3,("Server exit (%s)\n", (reason ? reason : "")));
exit(0);
}
-void exit_server_cleanly(const char *const reason)
+static void vfstest_exit_server_cleanly(const char * const reason)
{
- exit_server("normal exit");
+ vfstest_exit_server("normal exit");
}
struct smb_request *vfstest_get_smbreq(TALLOC_CTX *mem_ctx,
POPT_COMMON_SAMBA
POPT_TABLEEND
};
+ static const struct smbd_shim vfstest_shim_fns =
+ {
+ .exit_server = vfstest_exit_server,
+ .exit_server_cleanly = vfstest_exit_server_cleanly,
+ };
load_case_tables();
facilities. See lib/debug.c */
setup_logging("vfstest", DEBUG_STDOUT);
+ set_smbd_shim(&vfstest_shim_fns);
+
/* Load command lists */
cmd_set = vfstest_command_list;