s3-smbd_shim: Add become_authenticated_pipe_user().
authorAndreas Schneider <asn@samba.org>
Wed, 23 Oct 2013 09:02:39 +0000 (11:02 +0200)
committerStefan Metzmacher <metze@samba.org>
Tue, 29 Oct 2013 14:52:58 +0000 (15:52 +0100)
Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
source3/include/proto.h
source3/lib/smbd_shim.c
source3/lib/smbd_shim.h
source3/smbd/proto.h
source3/smbd/server.c
source3/smbd/uid.c

index 497828e52940f328ea21c43b8252340c67ac99cf..277547bef7dab876f6e1a037e0b229b97a7e6075 100644 (file)
@@ -1253,7 +1253,7 @@ bool ea_list_has_invalid_name(struct ea_list *ea_list);
 void become_root(void);
 void unbecome_root(void);
 
-/* The following definitions come from lib/dummysmbd.c */
+/* The following definitions come from lib/smbd_shim.c */
 
 int find_service(TALLOC_CTX *ctx, const char *service_in, char **p_service_out);
 void cancel_pending_lock_requests_by_fid(files_struct *fsp,
@@ -1263,6 +1263,9 @@ void send_stat_cache_delete_message(struct messaging_context *msg_ctx,
                                    const char *name);
 NTSTATUS can_delete_directory_fsp(files_struct *fsp);
 bool change_to_root_user(void);
+bool become_authenticated_pipe_user(struct auth_session_info *session_info);
+bool unbecome_authenticated_pipe_user(void);
+
 void contend_level2_oplocks_begin(files_struct *fsp,
                                  enum level2_contention_type type);
 void contend_level2_oplocks_end(files_struct *fsp,
index d5ad5779753d0be4f6f565b8c56c3310723e3394..1b5b4e6ca529fd43ceb6c3f00c75f888411e5fae 100644 (file)
@@ -58,6 +58,24 @@ bool change_to_root_user(void)
        return false;
 }
 
+bool become_authenticated_pipe_user(struct auth_session_info *session_info)
+{
+       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;
+}
+
 /**
  * The following two functions need to be called from inside the low-level BRL
  * code for oplocks correctness in smbd.  Since other utility binaries also
index 1645837f36ed62311a067e1bdbb28ea503ad309a..f3da5859027b719666a9f7af3306a43c2f119d58 100644 (file)
@@ -36,6 +36,8 @@ struct smbd_shim
                                               const char *name);
 
        bool (*change_to_root_user)(void);
+       bool (*become_authenticated_pipe_user)(struct auth_session_info *session_info);
+       bool (*unbecome_authenticated_pipe_user)(void);
 
        void (*contend_level2_oplocks_begin)(files_struct *fsp,
                                             enum level2_contention_type type);
index d365545fe92b07820971543b794d4fd5a7a4501b..ea424f1e55bbcb5ea1fcc9a487e2eea4fc5e9d92 100644 (file)
@@ -1103,8 +1103,8 @@ NTSTATUS check_user_share_access(connection_struct *conn,
 bool change_to_user(connection_struct *conn, uint64_t vuid);
 bool change_to_root_user(void);
 bool smbd_change_to_root_user(void);
-bool become_authenticated_pipe_user(struct auth_session_info *session_info);
-bool unbecome_authenticated_pipe_user(void);
+bool smbd_become_authenticated_pipe_user(struct auth_session_info *session_info);
+bool smbd_unbecome_authenticated_pipe_user(void);
 void become_root(void);
 void unbecome_root(void);
 void smbd_become_root(void);
index 8173a6294d905d431f5e7893477009f27f6fdee5..36be01948ea8b2c0d860e5707c7523d0cd3eccbc 100644 (file)
@@ -1058,6 +1058,8 @@ extern void build_options(bool screen);
                .cancel_pending_lock_requests_by_fid = smbd_cancel_pending_lock_requests_by_fid,
                .send_stat_cache_delete_message = smbd_send_stat_cache_delete_message,
                .change_to_root_user = smbd_change_to_root_user,
+               .become_authenticated_pipe_user = smbd_become_authenticated_pipe_user,
+               .unbecome_authenticated_pipe_user = smbd_unbecome_authenticated_pipe_user,
 
                .contend_level2_oplocks_begin = smbd_contend_level2_oplocks_begin,
                .contend_level2_oplocks_end = smbd_contend_level2_oplocks_end,
index a795eef8af8b980a0b30dd82e005b341a1ddd8ee..5e09e6b43fa14b234d51207ee3b7eec263bd7e9d 100644 (file)
@@ -436,7 +436,7 @@ bool smbd_change_to_root_user(void)
  user. Doesn't modify current_user.
 ****************************************************************************/
 
-bool become_authenticated_pipe_user(struct auth_session_info *session_info)
+bool smbd_become_authenticated_pipe_user(struct auth_session_info *session_info)
 {
        if (!push_sec_ctx())
                return False;
@@ -455,7 +455,7 @@ bool become_authenticated_pipe_user(struct auth_session_info *session_info)
  current_user.
 ****************************************************************************/
 
-bool unbecome_authenticated_pipe_user(void)
+bool smbd_unbecome_authenticated_pipe_user(void)
 {
        return pop_sec_ctx();
 }