Skip to content

Commit bcd8beb

Browse files
committed
Use the new function instead of the old
1 parent 975b8ae commit bcd8beb

File tree

1 file changed

+1
-6
lines changed

1 file changed

+1
-6
lines changed

modules/auxiliary/admin/ldap/ad_cs_cert_template.rb

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -110,16 +110,11 @@ def run
110110
fail_with(Failure::Unknown, "#{e.class}: #{e.message}")
111111
end
112112

113-
def ms_security_descriptor_control(flags)
114-
control_values = [flags].map(&:to_ber).to_ber_sequence.to_s.to_ber
115-
[LDAP_SERVER_SD_FLAGS_OID.to_ber, control_values].to_ber_sequence
116-
end
117-
118113
def get_certificate_template
119114
obj = @ldap.search(
120115
filter: "(&(cn=#{datastore['CERT_TEMPLATE']})(objectClass=pKICertificateTemplate))",
121116
base: "CN=Certificate Templates,CN=Public Key Services,CN=Services,CN=Configuration,#{@base_dn}",
122-
controls: [ms_security_descriptor_control(4)]
117+
controls: [adds_build_ldap_sd_control(owner: false, group: false, dacl: true, sacl: false)]
123118
)&.first
124119
fail_with(Failure::NotFound, 'The specified template was not found.') unless obj
125120

0 commit comments

Comments
 (0)