s3-smbd_shim: Add become_authenticated_pipe_user().
[metze/samba/wip.git] / source3 / lib / smbd_shim.c
index 72ae366ec36e74e3eb30b52fbc710344affe1387..1b5b4e6ca529fd43ceb6c3f00c75f888411e5fae 100644 (file)
@@ -1,6 +1,6 @@
 /*
    Unix SMB/CIFS implementation.
-   RPC pipe client
+   Runtime plugin adapter for various "smbd"-functions.
 
    Copyright (C) Gerald (Jerry) Carter          2004.
    Copyright (C) Andrew Bartlett                2011.
@@ -24,7 +24,6 @@
 
 #include "includes.h"
 #include "smbd_shim.h"
-#include "smbd/proto.h"
 
 static struct smbd_shim shim;
 
@@ -51,20 +50,29 @@ void send_stat_cache_delete_message(struct messaging_context *msg_ctx,
        }
 }
 
-NTSTATUS can_delete_directory(struct connection_struct *conn,
-                               const char *dirname)
+bool change_to_root_user(void)
 {
-       if (shim.can_delete_directory) {
-               return shim.can_delete_directory(conn, dirname);
+       if (shim.change_to_root_user) {
+               return shim.change_to_root_user();
        }
-       return NT_STATUS_OK;
+       return false;
 }
 
-bool change_to_root_user(void)
+bool become_authenticated_pipe_user(struct auth_session_info *session_info)
 {
-       if (shim.change_to_root_user) {
-               return shim.change_to_root_user();
+       if (shim.become_authenticated_pipe_user) {
+               return shim.become_authenticated_pipe_user(session_info);
+       }
+
+       return false;
+}
+
+bool unbecome_authenticated_pipe_user(void)
+{
+       if (shim.unbecome_authenticated_pipe_user) {
+               return shim.unbecome_authenticated_pipe_user();
        }
+
        return false;
 }
 
@@ -108,3 +116,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);
+}