Revert "smbd: add [un]become_guest() helper functions"
authorRalph Boehme <slow@samba.org>
Thu, 27 Dec 2018 10:42:45 +0000 (11:42 +0100)
committerStefan Metzmacher <metze@samba.org>
Fri, 11 Jan 2019 22:11:15 +0000 (23:11 +0100)
This reverts commit 7b5a47b84696e8e5c26207bd398742b883e598c2.

See the discussion in

https://lists.samba.org/archive/samba-technical/2018-December/131731.html

for the reasoning behind this revert.

Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
source3/smbd/proto.h
source3/smbd/uid.c

index ba9ab50..3662a92 100644 (file)
@@ -1225,8 +1225,6 @@ void become_root(void);
 void unbecome_root(void);
 void smbd_become_root(void);
 void smbd_unbecome_root(void);
-bool become_guest(void);
-void unbecome_guest(void);
 bool become_user(connection_struct *conn, uint64_t vuid);
 bool become_user_by_fsp(struct files_struct *fsp);
 bool become_user_by_session(connection_struct *conn,
index adf9e8c..f902f2a 100644 (file)
@@ -599,34 +599,6 @@ void smbd_unbecome_root(void)
        pop_conn_ctx();
 }
 
-bool become_guest(void)
-{
-       bool ok;
-
-       ok = push_sec_ctx();
-       if (!ok) {
-               return false;
-       }
-
-       push_conn_ctx();
-
-       ok = change_to_guest();
-       if (!ok) {
-               pop_sec_ctx();
-               pop_conn_ctx();
-               return false;
-       }
-
-       return true;
-}
-
-void unbecome_guest(void)
-{
-       pop_sec_ctx();
-       pop_conn_ctx();
-       return;
-}
-
 /****************************************************************************
  Push the current security context then force a change via change_to_user().
  Saves and restores the connection context.