r12915: protect against changing the SCM security descriptor
authorGerald Carter <jerry@samba.org>
Fri, 13 Jan 2006 20:26:59 +0000 (20:26 +0000)
committerGerald Carter <jerry@samba.org>
Fri, 13 Jan 2006 20:26:59 +0000 (20:26 +0000)
source/rpc_server/srv_svcctl_nt.c

index 4db8f7ed3f722058548545952ab595aa07610163..049bdf6075674e4186f0d4156029484b0c641ba9 100644 (file)
@@ -828,6 +828,11 @@ WERROR _svcctl_set_service_sec( pipes_struct *p, SVCCTL_Q_SET_SERVICE_SEC *q_u,
        if ( !info || !(info->type & (SVC_HANDLE_IS_SERVICE|SVC_HANDLE_IS_SCM))  )
                return WERR_BADFID;
 
+       /* can't set the security de4scriptor on the ServiceControlManager */
+
+       if ( info->type == SVC_HANDLE_IS_SCM )
+               return WERR_ACCESS_DENIED;      
+
        /* check the access on the open handle */
        
        switch ( q_u->security_flags ) {