summaryrefslogtreecommitdiff
path: root/source3/smbd/posix_acls.c
diff options
context:
space:
mode:
Diffstat (limited to 'source3/smbd/posix_acls.c')
-rw-r--r--source3/smbd/posix_acls.c28
1 files changed, 8 insertions, 20 deletions
diff --git a/source3/smbd/posix_acls.c b/source3/smbd/posix_acls.c
index 87173fca3b..31135f0907 100644
--- a/source3/smbd/posix_acls.c
+++ b/source3/smbd/posix_acls.c
@@ -21,6 +21,14 @@
#include "includes.h"
+extern struct current_user current_user;
+extern DOM_SID global_sid_Creator_Owner;
+extern DOM_SID global_sid_Creator_Group;
+extern DOM_SID global_sid_World;
+extern DOM_SID global_sid_Builtin_Administrators;
+extern DOM_SID global_sid_Builtin_Users;
+extern struct generic_mapping file_generic_mapping;
+
#undef DBGC_CLASS
#define DBGC_CLASS DBGC_ACLS
@@ -916,7 +924,6 @@ static BOOL unpack_nt_owners(int snum, SMB_STRUCT_STAT *psbuf, uid_t *puser, gid
if (lp_force_unknown_acl_user(snum)) {
/* this allows take ownership to work
* reasonably */
- extern struct current_user current_user;
*puser = current_user.uid;
} else {
DEBUG(3,("unpack_nt_owners: unable to validate"
@@ -938,7 +945,6 @@ static BOOL unpack_nt_owners(int snum, SMB_STRUCT_STAT *psbuf, uid_t *puser, gid
if (lp_force_unknown_acl_user(snum)) {
/* this allows take group ownership to work
* reasonably */
- extern struct current_user current_user;
*pgrp = current_user.gid;
} else {
DEBUG(3,("unpack_nt_owners: unable to validate"
@@ -1003,10 +1009,8 @@ static void apply_default_perms(files_struct *fsp, canon_ace *pace, mode_t type)
static BOOL uid_entry_in_group( canon_ace *uid_ace, canon_ace *group_ace )
{
- extern DOM_SID global_sid_World;
fstring u_name;
fstring g_name;
- extern struct current_user current_user;
/* "Everyone" always matches every uid. */
@@ -1046,7 +1050,6 @@ static BOOL ensure_canon_entry_valid(canon_ace **pp_ace,
SMB_STRUCT_STAT *pst,
BOOL setting_acl)
{
- extern DOM_SID global_sid_World;
canon_ace *pace;
BOOL got_user = False;
BOOL got_grp = False;
@@ -1220,10 +1223,6 @@ static BOOL create_canon_ace_lists(files_struct *fsp, SMB_STRUCT_STAT *pst,
canon_ace **ppfile_ace, canon_ace **ppdir_ace,
SEC_ACL *dacl)
{
- extern DOM_SID global_sid_Creator_Owner;
- extern DOM_SID global_sid_Creator_Group;
- extern DOM_SID global_sid_World;
- extern struct generic_mapping file_generic_mapping;
BOOL all_aces_are_inherit_only = (fsp->is_directory ? True : False);
canon_ace *file_ace = NULL;
canon_ace *dir_ace = NULL;
@@ -1647,7 +1646,6 @@ Deny entry after Allow entry. Failing to set on file %s.\n", fsp->fsp_name ));
static void process_deny_list( canon_ace **pp_ace_list )
{
- extern DOM_SID global_sid_World;
canon_ace *ace_list = *pp_ace_list;
canon_ace *curr_ace = NULL;
canon_ace *curr_ace_next = NULL;
@@ -2067,7 +2065,6 @@ static void arrange_posix_perms( char *filename, canon_ace **pp_list_head)
static canon_ace *canonicalise_acl( files_struct *fsp, SMB_ACL_T posix_acl, SMB_STRUCT_STAT *psbuf,
DOM_SID *powner, DOM_SID *pgroup, struct pai_val *pal, SMB_ACL_TYPE_T the_acl_type)
{
- extern DOM_SID global_sid_World;
connection_struct *conn = fsp->conn;
mode_t acl_mask = (S_IRUSR|S_IWUSR|S_IXUSR);
canon_ace *list_head = NULL;
@@ -2629,10 +2626,6 @@ static size_t merge_default_aces( SEC_ACE *nt_ace_list, size_t num_aces)
size_t get_nt_acl(files_struct *fsp, uint32 security_info, SEC_DESC **ppdesc)
{
- extern DOM_SID global_sid_Builtin_Administrators;
- extern DOM_SID global_sid_Builtin_Users;
- extern DOM_SID global_sid_Creator_Owner;
- extern DOM_SID global_sid_Creator_Group;
connection_struct *conn = fsp->conn;
SMB_STRUCT_STAT sbuf;
SEC_ACE *nt_ace_list = NULL;
@@ -2920,7 +2913,6 @@ size_t get_nt_acl(files_struct *fsp, uint32 security_info, SEC_DESC **ppdesc)
static int try_chown(connection_struct *conn, const char *fname, uid_t uid, gid_t gid)
{
int ret;
- extern struct current_user current_user;
files_struct *fsp;
SMB_STRUCT_STAT st;
@@ -2976,7 +2968,6 @@ BOOL set_nt_acl(files_struct *fsp, uint32 security_info_sent, SEC_DESC *psd)
uid_t orig_uid;
gid_t orig_gid;
BOOL need_chown = False;
- extern struct current_user current_user;
DEBUG(10,("set_nt_acl: called for file %s\n", fsp->fsp_name ));
@@ -3760,7 +3751,6 @@ BOOL set_unix_posix_acl(connection_struct *conn, files_struct *fsp, const char *
static int check_posix_acl_group_write(connection_struct *conn, const char *fname, SMB_STRUCT_STAT *psbuf)
{
- extern struct current_user current_user;
SMB_ACL_T posix_acl = NULL;
int entry_id = SMB_ACL_FIRST_ENTRY;
SMB_ACL_ENTRY_T entry;
@@ -3922,7 +3912,6 @@ failed to match on user or group in token.\n", fname ));
BOOL can_delete_file_in_directory(connection_struct *conn, const char *fname)
{
- extern struct current_user current_user;
SMB_STRUCT_STAT sbuf;
pstring dname;
int ret;
@@ -3980,7 +3969,6 @@ BOOL can_delete_file_in_directory(connection_struct *conn, const char *fname)
BOOL can_write_to_file(connection_struct *conn, const char *fname)
{
- extern struct current_user current_user;
SMB_STRUCT_STAT sbuf;
int ret;