From e80ceb1d7355c8c46a2ed90d5721cf367640f4e8 Mon Sep 17 00:00:00 2001 From: Jeremy Allison Date: Fri, 12 Mar 2010 13:56:51 -0800 Subject: Remove more uses of "extern struct current_user current_user;". Use accessor functions to get to this value. Tidies up much of the user context code. Volker, please look at the changes in smbd/uid.c to familiarize yourself with these changes as I think they make the logic in there cleaner. Cause smbd/posix_acls.c code to look at current user context, not stored context on the conn struct - allows correct use of these function calls under a become_root()/unbecome_root() pair. Jeremy. --- source3/include/proto.h | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'source3/include') diff --git a/source3/include/proto.h b/source3/include/proto.h index f6a43852f0..5b4304d27d 100644 --- a/source3/include/proto.h +++ b/source3/include/proto.h @@ -6752,7 +6752,7 @@ uint32_t map_canon_ace_perms(int snum, enum security_ace_type *pacl_type, mode_t perms, bool directory_ace); -NTSTATUS unpack_nt_owners(int snum, uid_t *puser, gid_t *pgrp, uint32 security_info_sent, const SEC_DESC *psd); +NTSTATUS unpack_nt_owners(connection_struct *conn, uid_t *puser, gid_t *pgrp, uint32 security_info_sent, const SEC_DESC *psd); SMB_ACL_T free_empty_sys_acl(connection_struct *conn, SMB_ACL_T the_acl); NTSTATUS posix_fget_nt_acl(struct files_struct *fsp, uint32_t security_info, SEC_DESC **ppdesc); @@ -7116,6 +7116,11 @@ void become_root(void); void unbecome_root(void); bool become_user(connection_struct *conn, uint16 vuid); bool unbecome_user(void); +uid_t get_current_uid(connection_struct *conn); +gid_t get_current_gid(connection_struct *conn); +const UNIX_USER_TOKEN *get_current_utok(connection_struct *conn); +const NT_USER_TOKEN *get_current_nttok(connection_struct *conn); +uint16_t get_current_vuid(connection_struct *conn); /* The following definitions come from smbd/utmp.c */ -- cgit