|
|
@@ -117,11 +117,12 @@ sub usage {
|
|
|
if ($opt_S) {
|
|
|
my $esc_opt_S = $opt_S;
|
|
|
$esc_opt_S =~ s/,/\\,/g;
|
|
|
+ $esc_opt_S =~ s/=/\\=/g;
|
|
|
print (STDERR "host = $opt_h, port = $opt_p, suffixDN = \"$opt_S\"\n\n") if $opt_v;
|
|
|
@base=(
|
|
|
"cn=nsPwPolicyContainer,$opt_S",
|
|
|
- "cn=cn=nsPwPolicyEntry\\,$esc_opt_S,cn=nsPwPolicyContainer,$opt_S",
|
|
|
- "cn=cn=nsPwTemplateEntry\\,$esc_opt_S,cn=nsPwPolicyContainer,$opt_S",
|
|
|
+ "cn=cn\\=nsPwPolicyEntry\\,$esc_opt_S,cn=nsPwPolicyContainer,$opt_S",
|
|
|
+ "cn=cn\\=nsPwTemplateEntry\\,$esc_opt_S,cn=nsPwPolicyContainer,$opt_S",
|
|
|
"cn=nsPwPolicy_cos,$opt_S"
|
|
|
);
|
|
|
|
|
|
@@ -133,25 +134,25 @@ sub usage {
|
|
|
"objectclass: top\n",
|
|
|
"objectclass: nsContainer\n\n" );
|
|
|
@pwpolicy=(
|
|
|
- "dn: cn=cn=nsPwPolicyEntry\\,$esc_opt_S,cn=nsPwPolicyContainer,$opt_S\n",
|
|
|
+ "dn: cn=cn\\=nsPwPolicyEntry\\,$esc_opt_S,cn=nsPwPolicyContainer,$opt_S\n",
|
|
|
"objectclass: top\n",
|
|
|
"objectclass: ldapsubentry\n",
|
|
|
"objectclass: passwordpolicy\n\n" );
|
|
|
@template=(
|
|
|
- "dn: cn=cn=nsPwTemplateEntry\\,$esc_opt_S,cn=nsPwPolicyContainer,$opt_S\n",
|
|
|
+ "dn: cn=cn\\=nsPwTemplateEntry\\,$esc_opt_S,cn=nsPwPolicyContainer,$opt_S\n",
|
|
|
"objectclass: top\n",
|
|
|
"objectclass: extensibleObject\n",
|
|
|
"objectclass: costemplate\n",
|
|
|
"objectclass: ldapsubentry\n",
|
|
|
"cosPriority: 1\n",
|
|
|
- "pwdpolicysubentry: cn=cn=nsPwPolicyEntry\\,$esc_opt_S,cn=nsPwPolicyContainer,$opt_S\n\n" );
|
|
|
+ "pwdpolicysubentry: cn=cn\\=nsPwPolicyEntry\\,$esc_opt_S,cn=nsPwPolicyContainer,$opt_S\n\n" );
|
|
|
@cos=(
|
|
|
"dn: cn=nsPwPolicy_cos,$opt_S\n",
|
|
|
"objectclass: top\n",
|
|
|
"objectclass: LDAPsubentry\n",
|
|
|
"objectclass: cosSuperDefinition\n",
|
|
|
"objectclass: cosPointerDefinition\n",
|
|
|
- "cosTemplateDn: cn=cn=nsPwTemplateEntry\\,$esc_opt_S,cn=nsPwPolicyContainer,$opt_S\n",
|
|
|
+ "cosTemplateDn: cn=cn\\=nsPwTemplateEntry\\,$esc_opt_S,cn=nsPwPolicyContainer,$opt_S\n",
|
|
|
"cosAttribute: pwdpolicysubentry default operational-default\n\n" );
|
|
|
|
|
|
@all=(\@container, \@pwpolicy, \@template, \@cos);
|
|
|
@@ -199,6 +200,7 @@ sub usage {
|
|
|
my $norm_opt_U = normalizeDN($opt_U);
|
|
|
my $esc_opt_U = $norm_opt_U;
|
|
|
$esc_opt_U =~ s/,/\\,/g;
|
|
|
+ $esc_opt_U =~ s/=/\\=/g;
|
|
|
print (STDERR "host = $opt_h, port = $opt_p, userDN = \"$norm_opt_U\"\n\n") if $opt_v;
|
|
|
$retcode = `$ldapsearch -h $opt_h -p $opt_p -b \"$norm_opt_U\" -s base \"\"`;
|
|
|
if ($retcode != 0 ) {
|
|
|
@@ -217,7 +219,7 @@ sub usage {
|
|
|
|
|
|
@base=(
|
|
|
"cn=nsPwPolicyContainer,$parentDN",
|
|
|
- "cn=cn=nsPwPolicyEntry\\,$esc_opt_U,cn=nsPwPolicyContainer,$parentDN"
|
|
|
+ "cn=cn\\=nsPwPolicyEntry\\,$esc_opt_U,cn=nsPwPolicyContainer,$parentDN"
|
|
|
);
|
|
|
|
|
|
$ldapadd="$ldapmodify -p $opt_p -h $opt_h -D \"$opt_D\" -w \"$opt_w\" -c -a 2>&1";
|
|
|
@@ -228,7 +230,7 @@ sub usage {
|
|
|
"objectclass: top\n",
|
|
|
"objectclass: nsContainer\n\n" );
|
|
|
@pwpolicy=(
|
|
|
- "dn: cn=cn=nsPwPolicyEntry\\,$esc_opt_U,cn=nsPwPolicyContainer,$parentDN\n",
|
|
|
+ "dn: cn=cn\\=nsPwPolicyEntry\\,$esc_opt_U,cn=nsPwPolicyContainer,$parentDN\n",
|
|
|
"objectclass: top\n",
|
|
|
"objectclass: ldapsubentry\n",
|
|
|
"objectclass: passwordpolicy\n\n" );
|
|
|
@@ -260,7 +262,7 @@ sub usage {
|
|
|
$i=$i+1;
|
|
|
}
|
|
|
|
|
|
- $target = "cn=cn=nsPwPolicyEntry\\,$esc_opt_U,cn=nsPwPolicyContainer,$parentDN";
|
|
|
+ $target = "cn=cn\\=nsPwPolicyEntry\\,$esc_opt_U,cn=nsPwPolicyContainer,$parentDN";
|
|
|
$modConfig = "dn: $norm_opt_U\nchangetype: modify\nreplace:pwdpolicysubentry\npwdpolicysubentry: $target\n\n";
|
|
|
open(FD,"| $modifyCfg ");
|
|
|
print(FD $modConfig);
|