diff options
author | Gerald Carter <jerry@samba.org> | 2005-09-14 12:49:24 +0000 |
---|---|---|
committer | Gerald (Jerry) Carter <jerry@samba.org> | 2007-10-10 11:03:38 -0500 |
commit | 24901187962e24bfa5ba7722aba0aeb9397ac7b6 (patch) | |
tree | 534271e090760d1b11fd13cfd76c1a2effe01431 /source | |
parent | 142c84eb31a4f2577d5f4bb0f541440d84eb607f (diff) | |
download | samba-24901187962e24bfa5ba7722aba0aeb9397ac7b6.tar.gz samba-24901187962e24bfa5ba7722aba0aeb9397ac7b6.tar.xz samba-24901187962e24bfa5ba7722aba0aeb9397ac7b6.zip |
r10221: add "free pass for root" in svcctl and default winreg access checks
Diffstat (limited to 'source')
-rw-r--r-- | source/rpc_server/srv_reg_nt.c | 8 | ||||
-rw-r--r-- | source/rpc_server/srv_svcctl_nt.c | 10 |
2 files changed, 17 insertions, 1 deletions
diff --git a/source/rpc_server/srv_reg_nt.c b/source/rpc_server/srv_reg_nt.c index 07ebe4e20cc..7a48b8dd220 100644 --- a/source/rpc_server/srv_reg_nt.c +++ b/source/rpc_server/srv_reg_nt.c @@ -46,6 +46,14 @@ NTSTATUS registry_access_check( SEC_DESC *sec_desc, NT_USER_TOKEN *token, se_map_generic( &access_desired, ®_generic_map ); se_access_check( sec_desc, token, access_desired, access_granted, &result ); + + if ( !NT_STATUS_IS_OK(result) ) { + if ( geteuid() == sec_initial_uid() ) { + DEBUG(5,("registry_access_check: access check bypassed for 'root'\n")); + *access_granted = access_desired; + return NT_STATUS_OK; + } + } return result; } diff --git a/source/rpc_server/srv_svcctl_nt.c b/source/rpc_server/srv_svcctl_nt.c index 2e44dc36922..16c3259840e 100644 --- a/source/rpc_server/srv_svcctl_nt.c +++ b/source/rpc_server/srv_svcctl_nt.c @@ -59,10 +59,18 @@ static NTSTATUS svcctl_access_check( SEC_DESC *sec_desc, NT_USER_TOKEN *token, uint32 access_desired, uint32 *access_granted ) { NTSTATUS result; - + /* maybe add privilege checks in here later */ se_access_check( sec_desc, token, access_desired, access_granted, &result ); + + if ( !NT_STATUS_IS_OK(result) ) { + if ( geteuid() == sec_initial_uid() ) { + DEBUG(5,("svcctl_access_check: access check bypassed for 'root'\n")); + *access_granted = access_desired; + return NT_STATUS_OK; + } + } return result; } |