Leaked source code of windows server 2003
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
|
|
<HTML> <HEAD> <META NAME="GENERATOR" Content="Microsoft Visual Studio 6.0"> <TITLE>Edit ACE</TITLE> <LINK REL="STYLESHEET" HREF="sdstyle.css"> <SCRIPT LANGUAGE=VBScript>
dim ace dim bModify
Sub window_onload ' Here we can determine whether we have been passed an existing ' ACE to modify, or whether we are creating anew if IsEmpty (window.dialogArguments) OR IsNull (window.dialogArguments) _ OR vbError = varType(window.dialogArguments) then bModify = false dsSpecific_onclick set ace = CreateObject("AccessControlEntry") else bModify = true set ace = window.dialogArguments ' 1. Access Mask accessMask = ace.AccessMask if accessMask AND CLng(adDelete.value) then adDelete.checked = true if accessMask AND CLng(adReadControl.value) then adReadControl.checked = true if accessMask AND CLng(adWriteDAC.value) then adWriteDAC.checked = true if accessMask AND CLng(adWriteOwner.value) then adWriteOwner.checked = true if accessMask AND CLng(adSynchronize.value) then adSynchronize.checked = true if accessMask AND CLng(adAccessSystemSecurity.value) then adAccessSystemSecurity.checked = true if accessMask AND CLng(adGenericRead.value) then adGenericRead.checked = true if accessMask AND CLng(adGenericWrite.value) then adGenericWrite.checked = true if accessMask AND CLng(adGenericExecute.value) then adGenericExecute.checked = true if accessMask AND CLng(adGenericAll.value) then adGenericAll.checked = true dsSpecificMaskBitsSet = false if accessMask AND CLng(adCreateChild.value) then adCreateChild.checked = true dsSpecificMaskBitsSet = true end if if accessMask AND CLng(adDeleteChild.value) then adDeleteChild.checked = true dsSpecificMaskBitsSet = true end if if accessMask AND CLng(adListChildren.value) then adListChildren.checked = true dsSpecificMaskBitsSet = true end if if accessMask AND CLng(adModifyGroupMembership.value) then adModifyGroupMembership.checked = true dsSpecificMaskBitsSet = true end if if accessMask AND CLng(adReadProperties.value) then adReadProperties.checked = true dsSpecificMaskBitsSet = true end if if accessMask AND CLng(adWriteProperties.value) then adWriteProperties.checked = true dsSpecificMaskBitsSet = true end if if accessMask AND CLng(adDeleteChildren.value) then adDeleteChildren.checked = true dsSpecificMaskBitsSet = true end if if accessMask AND CLng(adListObject.value) then adListObject.checked = true dsSpecificMaskBitsSet = true end if if accessMask AND CLng(adControlAccess.value) then adControlAccess.checked = true dsSpecificMaskBitsSet = true end if if dsSpecificMaskBitsSet then dsSpecific.checked = true end if dsSpecific_onclick ' 2. Type aceType.value = ace.AceType if ace.AceType >= 5 then aceType.value = ace.AceType - 5 applicableToObjects.checked = true applicableToObjects_onclick if Not(dsSpecific.checked) then dsSpecific.checked = true dsSpecific_onclick end if else aceType.value = ace.AceType end if ' 3. Flags flagValue = ace.AceFlags if flagValue AND CLng(adInheritACE.value) then adInheritACE.checked = true if flagValue AND CLng(adDontPropagateInheritedACE.value) then adDontPropagateInheritedACE.checked = true if flagValue AND CLng(adInheritOnlyACE.value) then adInheritOnlyACE.checked = true if flagValue AND CLng(adAuditSuccessfulAccess.value) then adAuditSuccessfulAccess.checked = true if flagValue AND CLng(adAuditFailedAccess.value) then adAuditFailedAccess.checked = true ' 4. Object Type if applicableToObjects.checked then if ace.Flags AND &H1 then objectTypeMarkAsPresent.checked = true objectType.value = ace.ObjectType end if if ace.Flags AND &H2 then inheritedObjectTypeMarkAsPresent.checked = true inheritedObjectType.value = ace.InheritedObjectType end if end if ' 5. Trustee trustee.value = ace.trustee end if End Sub
Sub applicableToObjects_onclick if applicableToObjects.checked then ' Show the object and inherited object sections objectsApplicable.style.display = "inline" else ' Hide them objectsApplicable.style.display = "none" end if End Sub
Sub OK_onmouseover window.status = "Save this ACE in the ACL" OK.style.color = "Green" OK.style.fontWeight = "bolder" OK.style.cursor = "hand" End Sub
Sub OK_onmouseout window.status = "" OK.style.color = "SaddleBrown" OK.style.fontWeight = "lighter" OK.style.cursor = "auto" End Sub
Sub Cancel_onmouseover window.status = "Discard new ACE without adding to ACL" Cancel.style.color = "Green" Cancel.style.fontWeight = "bolder" Cancel.style.cursor = "hand" End Sub
Sub Cancel_onmouseout window.status = "" Cancel.style.color = "SaddleBrown" Cancel.style.fontWeight = "lighter" Cancel.style.cursor = "auto" End Sub
Sub dsSpecific_onclick on error resume next for each e in document.all.item("ADSISpecific") if dsSpecific.checked then e.style.display = "inline" else e.style.display = "none" end if next End Sub
Sub OK_onclick
on error resume next ' 1. Set the access mask accessMask = 0 if adDelete.checked then accessMask = accessMask + CLng(adDelete.value) if adReadControl.checked then accessMask = accessMask + CLng(adReadControl.value) if adWriteDAC.checked then accessMask = accessMask + CLng(adWriteDAC.value) if adWriteOwner.checked then accessMask = accessMask + CLng(adWriteOwner.value) if adSynchronize.checked then accessMask = accessMask + CLng(adSynchronize.value) if adAccessSystemSecurity.checked then accessMask = accessMask + CLng(adAccessSystemSecurity.value) if adGenericRead.checked then accessMask = accessMask + CLng(adGenericRead.value) if adGenericWrite.checked then accessMask = accessMask + CLng(adGenericWrite.value) if adGenericExecute.checked then accessMask = accessMask + CLng(adGenericExecute.value) if adGenericAll.checked then accessMask = accessMask + CLng(adGenericAll.value) if dsSpecific.checked then if adCreateChild.checked then accessMask = accessMask + CLng(adCreateChild.value) if adDeleteChild.checked then accessMask = accessMask + CLng(adDeleteChild.value) if adListChildren.checked then accessMask = accessMask + CLng(adListChildren.value) if adModifyGroupMembership.checked then accessMask = accessMask + CLng(adModifyGroupMembership.value) if adReadProperties.checked then accessMask = accessMask + CLng(adReadProperties.value) if adWriteProperties.checked then accessMask = accessMask + CLng(adWriteProperties.value) if adDeleteChildren.checked then accessMask = accessMask + CLng(adDeleteChildren.value) if adListObject.checked then accessMask = accessMask + CLng(adListObject.value) if adControlAccess.checked then accessMask = accessMask + CLng(adControlAccess.value) end if ace.AccessMask = accessMask ' 2. Set the Type typeValue = aceType.value if dsSpecific.checked and applicableToObjects.checked then typeValue = typeValue + CLng(applicableToObjects.value) ace.AceType = typeValue ' 3. Set the flags flagValue = 0 if adInheritACE.checked then flagValue = flagValue + CLng(adInheritACE.value) if adDontPropagateInheritedACE.checked then flagValue = flagValue + CLng(adDontPropagateInheritedACE.value) if adInheritOnlyACE.checked then flagValue = flagValue + CLng(adInheritOnlyACE.value) if adAuditSuccessfulAccess.checked then flagValue = flagValue + CLng(adAuditSuccessfulAccess.value) if adAuditFailedAccess.checked then flagValue = flagValue + CLng(adAuditFailedAccess.value) ace.AceFlags = flagValue ' 4. Set the Object Type if dsSpecific.checked AND applicableToObjects.checked then if objectTypeMarkAsPresent.checked AND Len(objectType.value) > 0 then ace.Flags = ace.Flags OR &H1 ace.ObjectType = objectType.value end if if inheritedObjectTypeMarkAsPresent.checked AND Len(inheritedObjectType.value) > 0 then ace.Flags = ace.Flags OR &H2 ace.InheritedObjectType = inheritedObjectType.value end if end if ' 5. Set the Trustee ace.Trustee = trustee.value if err <> 0 then alert Err.Description & ": 0x" & Hex(Err.number) if bModify then window.returnValue = false else if bModify then window.returnValue = true else window.returnValue = ace end if window.close end if End Sub
Sub Cancel_onclick window.returnValue = null window.close End Sub
</SCRIPT> </HEAD> <BODY LANGUAGE=javascript> <TABLE cellSpacing=0 cellPadding=0 width="100%" border=0> <TR> <TD><H3>Access Mask</H3></TD> <TD><INPUT type=checkbox id=dsSpecific > <SPAN CLASS=BoxText>Display DS-specific options</SPAN></TD></TR> </TABLE> <TABLE cellSpacing=0 cellPadding=0 width="100%" border=0 CLASS="data" id=tableAccessMask> <TR> <TD><INPUT type=checkbox id=adDelete value="&H10000">Delete</TD> <TD id=ADSISpecific><INPUT type=checkbox id=adCreateChild value="&H1">Create Child</TD></TR> <TR> <TD><INPUT type=checkbox id=adReadControl value="&H20000">Read Control</TD> <TD id=ADSISpecific><INPUT type=checkbox id=adDeleteChild value="&H2">Delete Child</TD></TR> <TR> <TD><INPUT type=checkbox id=adWriteDAC value="&H40000">Write DAC</TD> <TD id=ADSISpecific><INPUT type=checkbox id=adListChildren value="&H4">List Children</TD></TR> <TR> <TD><INPUT type=checkbox id=adWriteOwner value="&H80000">Write Owner</TD> <TD id=ADSISpecific><INPUT type=checkbox id=adModifyGroupMembership value="&H8">Modify Group Membership</TD></TR> <TR> <TD><INPUT type=checkbox id=adSynchronize value="&H100000">Synchronize</TD> <TD id=ADSISpecific><INPUT type=checkbox id=adReadProperties value="&H10">Read Properties</TD></TR> <TR> <TD><INPUT type=checkbox id=adAccessSystemSecurity value="&H1000000">Access System Security</TD> <TD id=ADSISpecific><INPUT type=checkbox id=adWriteProperties value="&H20">Write Properties</TD></TR> <TR> <TD><INPUT type=checkbox id=adGenericRead value="&H80000000">Generic Read</TD> <TD id=ADSISpecific><INPUT type=checkbox id=adDeleteChildren value="&H40">Delete Children</TD></TR> <TR> <TD><INPUT type=checkbox id=adGenericWrite value="&H40000000">Generic Write</TD> <TD id=ADSISpecific><INPUT type=checkbox id=adListObject value="&H80">List Object</TD></TR> <TR> <TD><INPUT type=checkbox id=adGenericExecute value="&H20000000">Generic Execute</TD> <TD id=ADSISpecific><INPUT type=checkbox id=adControlAccess value="&H100">Control Access</TD></TR> <TR> <TD> <P><INPUT type=checkbox id=adGenericAll value="&H10000000">Generic All</P></TD> <TD></TD></TR></TABLE> <HR>
<TABLE cellSpacing=0 cellPadding=0 width="100%" border=0> <TR> <TD><H3>Type</H3></TD><TD><H3>Trustee</H3></TD> </TR> <TR> <TD> <SELECT style="WIDTH: 230px" id=aceType> <OPTION value="0" selected>Access Allowed <OPTION value="1">Access Denied <OPTION value="2">System Audit</OPTION> </SELECT> </TD> <TD> <INPUT style="WIDTH: 314px; HEIGHT: 22px" size=44 id=trustee name=text1></TD> </TR> <TR id=ADSISpecific><TD><INPUT type=checkbox id=applicableToObjects value="5"><SPAN CLASS=BoxText>Applicable to Objects</SPAN></TD> </TR> </TABLE> <HR> <H3>Flags</H3> <TABLE cellSpacing=0 cellPadding=0 width="100%" border=0 CLASS="data"> <TR> <TD><INPUT type=checkbox id=adInheritACE value="&H2">Inherit ACE</TD> <TD><INPUT type=checkbox id=adDontPropagateInheritedACE value="&H4">Don't Propagate Inherited ACE</TD></TR> <TR> <TD><INPUT type=checkbox id=adInheritOnlyACE value="&H8">Inherit Only ACE</TD> <TD><INPUT type=checkbox id=adAuditSuccessfulAccess value="&H40">Audit Successful Access</TD></TR> <TR> <TD><INPUT type=checkbox id=adAuditFailedAccess value="&H80">Audit Failed Access</TD> </TR> </TABLE> <HR> <SPAN ID=ADSISpecific> <SPAN ID=objectsApplicable STYLE="DISPLAY: none"> <H3>Object Type</H3> <INPUT style="WIDTH: 464px; HEIGHT: 22px" size=66 id=objectType> <INPUT id=objectTypeMarkAsPresent type=checkbox> <SPAN CLASS=BoxText>Mark as Present</SPAN> <HR> <H3>Inherited Object Type</H3> <INPUT style="WIDTH: 464px; HEIGHT: 22px" size=66 id=inheritedObjectType> <INPUT id=inheritedObjectTypeMarkAsPresent type=checkbox> <SPAN CLASS=BoxText>Mark as Present</SPAN> <HR> </SPAN></SPAN> <TABLE cellSpacing=0 cellPadding=0 width="100%" border=0> <COLGROUP width="50%"><COLGROUP width="50%"> <TR> <TD> <P align=center CLASS=HotText id=OK>OK</P></TD> <TD> <P align=center CLASS=HotText id=Cancel>Cancel</P></TD> </TR></TABLE> </BODY> </HTML>
|