diff options
author | Stefan Metzmacher <metze@samba.org> | 2019-07-19 11:14:13 +0200 |
---|---|---|
committer | Jeremy Allison <jra@samba.org> | 2019-09-11 19:59:34 +0000 |
commit | 5da24aa18e9c0ff6f2852b5421945111ef5c6b2b (patch) | |
tree | f5777d28bbb00a75986797f175585ebda5a8e2dc /source3/smbd | |
parent | 15699475d6031dd0ed5cd24e9915c574b35a233b (diff) | |
download | samba-5da24aa18e9c0ff6f2852b5421945111ef5c6b2b.tar.gz |
smbd: rename [un]become_user*() to [un]become_user_without_service*()
We should make the behavior change (that gives up some protection)
more obvious, by changing the function names.
At least some OEMs have patches relying on the 4.9/4.10 behaviour
and we want them to detect that they have to do more work when they
need to change directories.
Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
Diffstat (limited to 'source3/smbd')
-rw-r--r-- | source3/smbd/close.c | 8 | ||||
-rw-r--r-- | source3/smbd/proto.h | 8 | ||||
-rw-r--r-- | source3/smbd/uid.c | 10 |
3 files changed, 13 insertions, 13 deletions
diff --git a/source3/smbd/close.c b/source3/smbd/close.c index 9786c826439..baae5b736ff 100644 --- a/source3/smbd/close.c +++ b/source3/smbd/close.c @@ -338,7 +338,7 @@ static NTSTATUS close_remove_share_mode(files_struct *fsp, * wrote a real delete on close. */ if (get_current_vuid(conn) != fsp->vuid) { - become_user(conn, fsp->vuid); + become_user_without_service(conn, fsp->vuid); became_user = True; } fsp->delete_on_close = true; @@ -346,7 +346,7 @@ static NTSTATUS close_remove_share_mode(files_struct *fsp, get_current_nttok(conn), get_current_utok(conn)); if (became_user) { - unbecome_user(); + unbecome_user_without_service(); } } @@ -1141,7 +1141,7 @@ static NTSTATUS close_directory(struct smb_request *req, files_struct *fsp, * wrote a real delete on close. */ if (get_current_vuid(fsp->conn) != fsp->vuid) { - become_user(fsp->conn, fsp->vuid); + become_user_without_service(fsp->conn, fsp->vuid); became_user = True; } send_stat_cache_delete_message(fsp->conn->sconn->msg_ctx, @@ -1151,7 +1151,7 @@ static NTSTATUS close_directory(struct smb_request *req, files_struct *fsp, get_current_utok(fsp->conn)); fsp->delete_on_close = true; if (became_user) { - unbecome_user(); + unbecome_user_without_service(); } } diff --git a/source3/smbd/proto.h b/source3/smbd/proto.h index d471e2ed2cb..5ebee0486e7 100644 --- a/source3/smbd/proto.h +++ b/source3/smbd/proto.h @@ -1198,11 +1198,11 @@ void become_root(void); void unbecome_root(void); void smbd_become_root(void); void smbd_unbecome_root(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, +bool become_user_without_service(connection_struct *conn, uint64_t vuid); +bool become_user_without_service_by_fsp(struct files_struct *fsp); +bool become_user_without_service_by_session(connection_struct *conn, const struct auth_session_info *session_info); -bool unbecome_user(void); +bool unbecome_user_without_service(void); uid_t get_current_uid(connection_struct *conn); gid_t get_current_gid(connection_struct *conn); const struct security_unix_token *get_current_utok(connection_struct *conn); diff --git a/source3/smbd/uid.c b/source3/smbd/uid.c index 106f1430011..0e8d5bca4de 100644 --- a/source3/smbd/uid.c +++ b/source3/smbd/uid.c @@ -659,7 +659,7 @@ void smbd_unbecome_root(void) Saves and restores the connection context. ****************************************************************************/ -bool become_user(connection_struct *conn, uint64_t vuid) +bool become_user_without_service(connection_struct *conn, uint64_t vuid) { struct user_struct *vuser; int snum = SNUM(conn); @@ -696,12 +696,12 @@ bool become_user(connection_struct *conn, uint64_t vuid) return true; } -bool become_user_by_fsp(struct files_struct *fsp) +bool become_user_without_service_by_fsp(struct files_struct *fsp) { - return become_user(fsp->conn, fsp->vuid); + return become_user_without_service(fsp->conn, fsp->vuid); } -bool become_user_by_session(connection_struct *conn, +bool become_user_without_service_by_session(connection_struct *conn, const struct auth_session_info *session_info) { bool ok; @@ -726,7 +726,7 @@ bool become_user_by_session(connection_struct *conn, return true; } -bool unbecome_user(void) +bool unbecome_user_without_service(void) { pop_sec_ctx(); pop_conn_ctx(); |