Fixed a bug that prevented browsing of the LDAP database in SSL mode, thanks to Paul R. Ganci.
---- Changes since 1.470 ----
Updated the module to support the new OpenLDAP LDIF-format configuration files, as seen on Ubuntu 8.10.
+---- Changes since 1.510 ----
+Fixed numerous bugs in editing the new LDIF-format access control rules.
$p->{'what'} =~ /^dn(\.([^=]+))?=(.*)$/i) {
$dn = $3;
$style = $2;
+ if ($dn eq "") {
+ $what = 2;
+ }
}
print &ui_table_row($text{'eacl_what'},
&ui_radio_table("what", $what,
[ [ 1, $text{'eacl_what1'} ],
+ [ 2, $text{'eacl_what2'} ],
[ 0, $text{'eacl_what0'},
&ui_textbox("what_dn", $dn, 30)." ".
$text{'eacl_mtype'}." ".
&ui_textbox("control_$i", join(" ", @{$b->{'control'}}), 30,
0, undef, "style='width:90%'"),
], \@tds);
- # XXX http://www.openldap.org/faq/data/cache/452.html
$i++;
}
$wtable .= &ui_columns_end();
# Get the current rule
&lock_slapd_files();
-$conf = &get_config();
-@access = &find("access", $conf);
+if (&get_config_type() == 1) {
+ $conf = &get_config();
+ @access = &find("access", $conf);
+ }
+else {
+ $defdb = &get_default_db();
+ $conf = &get_ldif_config();
+ @access = &find_ldif("olcAccess", $conf, $defdb);
+ }
+
+# Get the ACL object
if (!$in{'new'}) {
$acl = $access[$in{'idx'}];
$p = &parse_ldap_access($acl);
}
+else {
+ $p = { };
+ }
if ($in{'delete'}) {
# Just take out of access list
if ($in{'what'} == 1) {
$p->{'what'} = '*';
}
+ elsif ($in{'what'} == 2) {
+ $p->{'what'} =
+ 'dn'.($in{'what_style'} ? '.'.$in{'what_style'} : '').
+ '=""';
+ }
else {
$in{'what_dn'} =~ /^\S+=\S.*$/ || &error($text{'eacl_edn'});
$p->{'what'} =
}
# Write out access directives
-&save_directive($conf, "access", @access);
-&flush_file_lines($config{'config_file'});
+if (&get_config_type() == 1) {
+ &save_directive($conf, "access", @access);
+ }
+else {
+ &save_ldif_directive($conf, "olcAccess", $defdb, @access);
+ }
+&flush_file_lines();
&unlock_slapd_files();
# Log and return
eacl_header=LDAP database access control rule details
eacl_what=Objects being granted
eacl_what1=All objects
+eacl_what2=Objects with no DN
eacl_what0=Object with DN
eacl_mtype=match type
eacl_regex=regular expression
$dir->{'value'} = $value;
push(@rv, $dir);
}
- elsif (/^(\s+\S.*)$/ && @rv) {
+ elsif (/^(\s+\S.*)$/ && @rv && $rv[$#rv]->{'file'} eq $file) {
# Continuation line
local $dir = $rv[$#rv];
$dir->{'value'} .= $1;
foreach my $c (@$conf) {
if ($c->{'line'} > $old[$i]->{'line'}) {
$c->{'line'} -= $oldlen - 1;
+ $c->{'eline'} -= $oldlen - 1;
}
}
}
foreach my $c (@$conf) {
if ($c->{'line'} > $old[$i]->{'line'}) {
$c->{'line'} -= $oldlen;
+ $c->{'eline'} -= $oldlen;
}
}
}