Branch '389-ds-base-1.3.0' - ldap/admin
by Richard Allen Megginson
ldap/admin/src/logconv.pl | 20 ++++++++++----------
1 file changed, 10 insertions(+), 10 deletions(-)
New commits:
commit 65ec4741831214ddc480ac6077234f9eb129fb60
Author: Rich Megginson <rmeggins(a)redhat.com>
Date: Tue Oct 8 11:04:31 2013 -0600
Ticket #47551 logconv: -V does not produce unindexed search report
https://fedorahosted.org/389/ticket/47551
Reviewed by: mreynolds (Thanks!)
Branch: master
Fix Description: Execute the $usage /u/ code also when verb == yes.
Platforms tested: RHEL6 x86_64
Flag Day: no
Doc impact: no
(cherry picked from commit 87ad36b865f85297feb40c4b61db82101b9a9447)
cherry pick from master did not apply cleanly and was fixed up
(cherry picked from commit 1197d9dd48f32fb2d5e41de06c6cea3b181acbc9)
diff --git a/ldap/admin/src/logconv.pl b/ldap/admin/src/logconv.pl
index 275ce34..7381a66 100755
--- a/ldap/admin/src/logconv.pl
+++ b/ldap/admin/src/logconv.pl
@@ -674,10 +674,10 @@ if ($verb eq "yes" || $usage =~ /u/ || $usage =~ /U/){
my $unindexedIp;
my %uniqFilt = (); # hash of unique filters
while (my ($srcnt_conn_op, $count) = each %{$notesa_conn_op}) {
- my ($srvRstCnt, $conn, $op) = split(",", $srcnt_conn_op);
- $unindexedIp = getIPfromConn($conn, $srvRstCnt);
- if ($usage =~ /u/) {
- print "\n Unindexed Search #".$notesCount."\n";
+ if ($verb eq "yes" || $usage =~ /u/) {
+ my ($srvRstCnt, $conn, $op) = split(",", $srcnt_conn_op);
+ my $unindexedIp = getIPfromConn($conn, $srvRstCnt);
+ print "\n Unindexed Search #".$notesCount." (notes=A)\n";
print " - Date/Time: $time_conn_op->{$srcnt_conn_op}\n";
print " - Connection Number: $conn\n";
print " - Operation Number: $op\n";
@@ -692,7 +692,7 @@ if ($verb eq "yes" || $usage =~ /u/ || $usage =~ /U/){
}
}
if (exists($filter_conn_op->{$srcnt_conn_op}) && defined($filter_conn_op->{$srcnt_conn_op})) {
- if ($usage =~ /u/) {
+ if ($verb eq "yes" || $usage =~ /u/) {
print " - Search Filter: $filter_conn_op->{$srcnt_conn_op}\n";
}
$uniqFilt{$filter_conn_op->{$srcnt_conn_op}}++;
@@ -722,10 +722,10 @@ if ($verb eq "yes" || $usage =~ /u/ || $usage =~ /U/){
my $unindexedIp;
my %uniqFilt = (); # hash of unique filters
while (my ($srcnt_conn_op, $count) = each %{$notesu_conn_op}) {
- my ($srvRstCnt, $conn, $op) = split(",", $srcnt_conn_op);
- $unindexedIp = getIPfromConn($conn, $srvRstCnt);
- if ($usage =~ /u/) {
- print "\n Unindexed Component #".$notesCount."\n";
+ if ($verb eq "yes" || $usage =~ /u/) {
+ my ($srvRstCnt, $conn, $op) = split(",", $srcnt_conn_op);
+ $unindexedIp = getIPfromConn($conn, $srvRstCnt);
+ print "\n Unindexed Component #".$notesCount." (notes=U)\n";
print " - Date/Time: $time_conn_op->{$srcnt_conn_op}\n";
print " - Connection Number: $conn\n";
print " - Operation Number: $op\n";
@@ -740,7 +740,7 @@ if ($verb eq "yes" || $usage =~ /u/ || $usage =~ /U/){
}
}
if (exists($filter_conn_op->{$srcnt_conn_op}) && defined($filter_conn_op->{$srcnt_conn_op})) {
- if ($usage =~ /u/) {
+ if ($verb eq "yes" || $usage =~ /u/) {
print " - Search Filter: $filter_conn_op->{$srcnt_conn_op}\n";
}
$uniqFilt{$filter_conn_op->{$srcnt_conn_op}}++;
10 years, 6 months
Branch '389-ds-base-1.3.1' - ldap/admin
by Richard Allen Megginson
ldap/admin/src/logconv.pl | 20 ++++++++++----------
1 file changed, 10 insertions(+), 10 deletions(-)
New commits:
commit 1197d9dd48f32fb2d5e41de06c6cea3b181acbc9
Author: Rich Megginson <rmeggins(a)redhat.com>
Date: Tue Oct 8 11:04:31 2013 -0600
Ticket #47551 logconv: -V does not produce unindexed search report
https://fedorahosted.org/389/ticket/47551
Reviewed by: mreynolds (Thanks!)
Branch: master
Fix Description: Execute the $usage /u/ code also when verb == yes.
Platforms tested: RHEL6 x86_64
Flag Day: no
Doc impact: no
(cherry picked from commit 87ad36b865f85297feb40c4b61db82101b9a9447)
cherry pick from master did not apply cleanly and was fixed up
diff --git a/ldap/admin/src/logconv.pl b/ldap/admin/src/logconv.pl
index 275ce34..7381a66 100755
--- a/ldap/admin/src/logconv.pl
+++ b/ldap/admin/src/logconv.pl
@@ -674,10 +674,10 @@ if ($verb eq "yes" || $usage =~ /u/ || $usage =~ /U/){
my $unindexedIp;
my %uniqFilt = (); # hash of unique filters
while (my ($srcnt_conn_op, $count) = each %{$notesa_conn_op}) {
- my ($srvRstCnt, $conn, $op) = split(",", $srcnt_conn_op);
- $unindexedIp = getIPfromConn($conn, $srvRstCnt);
- if ($usage =~ /u/) {
- print "\n Unindexed Search #".$notesCount."\n";
+ if ($verb eq "yes" || $usage =~ /u/) {
+ my ($srvRstCnt, $conn, $op) = split(",", $srcnt_conn_op);
+ my $unindexedIp = getIPfromConn($conn, $srvRstCnt);
+ print "\n Unindexed Search #".$notesCount." (notes=A)\n";
print " - Date/Time: $time_conn_op->{$srcnt_conn_op}\n";
print " - Connection Number: $conn\n";
print " - Operation Number: $op\n";
@@ -692,7 +692,7 @@ if ($verb eq "yes" || $usage =~ /u/ || $usage =~ /U/){
}
}
if (exists($filter_conn_op->{$srcnt_conn_op}) && defined($filter_conn_op->{$srcnt_conn_op})) {
- if ($usage =~ /u/) {
+ if ($verb eq "yes" || $usage =~ /u/) {
print " - Search Filter: $filter_conn_op->{$srcnt_conn_op}\n";
}
$uniqFilt{$filter_conn_op->{$srcnt_conn_op}}++;
@@ -722,10 +722,10 @@ if ($verb eq "yes" || $usage =~ /u/ || $usage =~ /U/){
my $unindexedIp;
my %uniqFilt = (); # hash of unique filters
while (my ($srcnt_conn_op, $count) = each %{$notesu_conn_op}) {
- my ($srvRstCnt, $conn, $op) = split(",", $srcnt_conn_op);
- $unindexedIp = getIPfromConn($conn, $srvRstCnt);
- if ($usage =~ /u/) {
- print "\n Unindexed Component #".$notesCount."\n";
+ if ($verb eq "yes" || $usage =~ /u/) {
+ my ($srvRstCnt, $conn, $op) = split(",", $srcnt_conn_op);
+ $unindexedIp = getIPfromConn($conn, $srvRstCnt);
+ print "\n Unindexed Component #".$notesCount." (notes=U)\n";
print " - Date/Time: $time_conn_op->{$srcnt_conn_op}\n";
print " - Connection Number: $conn\n";
print " - Operation Number: $op\n";
@@ -740,7 +740,7 @@ if ($verb eq "yes" || $usage =~ /u/ || $usage =~ /U/){
}
}
if (exists($filter_conn_op->{$srcnt_conn_op}) && defined($filter_conn_op->{$srcnt_conn_op})) {
- if ($usage =~ /u/) {
+ if ($verb eq "yes" || $usage =~ /u/) {
print " - Search Filter: $filter_conn_op->{$srcnt_conn_op}\n";
}
$uniqFilt{$filter_conn_op->{$srcnt_conn_op}}++;
10 years, 6 months
ldap/admin
by Richard Allen Megginson
ldap/admin/src/logconv.pl | 16 ++++++++--------
1 file changed, 8 insertions(+), 8 deletions(-)
New commits:
commit 87ad36b865f85297feb40c4b61db82101b9a9447
Author: Rich Megginson <rmeggins(a)redhat.com>
Date: Tue Oct 8 11:04:31 2013 -0600
Ticket #47551 logconv: -V does not produce unindexed search report
https://fedorahosted.org/389/ticket/47551
Reviewed by: mreynolds (Thanks!)
Branch: master
Fix Description: Execute the $usage /u/ code also when verb == yes.
Platforms tested: RHEL6 x86_64
Flag Day: no
Doc impact: no
diff --git a/ldap/admin/src/logconv.pl b/ldap/admin/src/logconv.pl
index 8de1e8e..865e113 100755
--- a/ldap/admin/src/logconv.pl
+++ b/ldap/admin/src/logconv.pl
@@ -676,9 +676,9 @@ if ($verb eq "yes" || $usage =~ /u/ || $usage =~ /U/){
my $unindexedIp;
my %uniqFilt = (); # hash of unique filters
while (my ($srcnt_conn_op, $count) = each %{$notesa_conn_op}) {
- my ($srvRstCnt, $conn, $op) = split(",", $srcnt_conn_op);
- $unindexedIp = getIPfromConn($conn, $srvRstCnt);
- if ($usage =~ /u/) {
+ if ($verb eq "yes" || $usage =~ /u/) {
+ my ($srvRstCnt, $conn, $op) = split(",", $srcnt_conn_op);
+ my $unindexedIp = getIPfromConn($conn, $srvRstCnt);
print "\n Unindexed Search #".$notesCount." (notes=A)\n";
print " - Date/Time: $time_conn_op->{$srcnt_conn_op}\n";
print " - Connection Number: $conn\n";
@@ -694,7 +694,7 @@ if ($verb eq "yes" || $usage =~ /u/ || $usage =~ /U/){
}
}
if (exists($filter_conn_op->{$srcnt_conn_op}) && defined($filter_conn_op->{$srcnt_conn_op})) {
- if ($usage =~ /u/) {
+ if ($verb eq "yes" || $usage =~ /u/) {
print " - Search Filter: $filter_conn_op->{$srcnt_conn_op}\n";
}
$uniqFilt{$filter_conn_op->{$srcnt_conn_op}}++;
@@ -724,9 +724,9 @@ if ($verb eq "yes" || $usage =~ /u/ || $usage =~ /U/){
my $unindexedIp;
my %uniqFilt = (); # hash of unique filters
while (my ($srcnt_conn_op, $count) = each %{$notesu_conn_op}) {
- my ($srvRstCnt, $conn, $op) = split(",", $srcnt_conn_op);
- $unindexedIp = getIPfromConn($conn, $srvRstCnt);
- if ($usage =~ /u/) {
+ if ($verb eq "yes" || $usage =~ /u/) {
+ my ($srvRstCnt, $conn, $op) = split(",", $srcnt_conn_op);
+ $unindexedIp = getIPfromConn($conn, $srvRstCnt);
print "\n Unindexed Component #".$notesCount." (notes=U)\n";
print " - Date/Time: $time_conn_op->{$srcnt_conn_op}\n";
print " - Connection Number: $conn\n";
@@ -742,7 +742,7 @@ if ($verb eq "yes" || $usage =~ /u/ || $usage =~ /U/){
}
}
if (exists($filter_conn_op->{$srcnt_conn_op}) && defined($filter_conn_op->{$srcnt_conn_op})) {
- if ($usage =~ /u/) {
+ if ($verb eq "yes" || $usage =~ /u/) {
print " - Search Filter: $filter_conn_op->{$srcnt_conn_op}\n";
}
$uniqFilt{$filter_conn_op->{$srcnt_conn_op}}++;
10 years, 6 months
Branch '389-ds-base-1.2.11' - ldap/admin
by Richard Allen Megginson
ldap/admin/src/logconv.pl | 20 ++++++++++----------
1 file changed, 10 insertions(+), 10 deletions(-)
New commits:
commit a4ec05dee172e6daf73607ee61a8cca9bbef74bf
Author: Rich Megginson <rmeggins(a)redhat.com>
Date: Tue Oct 8 11:04:31 2013 -0600
Ticket #47551 logconv: -V does not produce unindexed search report
https://fedorahosted.org/389/ticket/47551
Reviewed by: mreynolds (Thanks!)
Branch: master
Fix Description: Execute the $usage /u/ code also when verb == yes.
Platforms tested: RHEL6 x86_64
Flag Day: no
Doc impact: no
(cherry picked from commit 87ad36b865f85297feb40c4b61db82101b9a9447)
cherry pick from master did not apply cleanly and was fixed up
(cherry picked from commit 1197d9dd48f32fb2d5e41de06c6cea3b181acbc9)
(cherry picked from commit 65ec4741831214ddc480ac6077234f9eb129fb60)
diff --git a/ldap/admin/src/logconv.pl b/ldap/admin/src/logconv.pl
index 275ce34..7381a66 100755
--- a/ldap/admin/src/logconv.pl
+++ b/ldap/admin/src/logconv.pl
@@ -674,10 +674,10 @@ if ($verb eq "yes" || $usage =~ /u/ || $usage =~ /U/){
my $unindexedIp;
my %uniqFilt = (); # hash of unique filters
while (my ($srcnt_conn_op, $count) = each %{$notesa_conn_op}) {
- my ($srvRstCnt, $conn, $op) = split(",", $srcnt_conn_op);
- $unindexedIp = getIPfromConn($conn, $srvRstCnt);
- if ($usage =~ /u/) {
- print "\n Unindexed Search #".$notesCount."\n";
+ if ($verb eq "yes" || $usage =~ /u/) {
+ my ($srvRstCnt, $conn, $op) = split(",", $srcnt_conn_op);
+ my $unindexedIp = getIPfromConn($conn, $srvRstCnt);
+ print "\n Unindexed Search #".$notesCount." (notes=A)\n";
print " - Date/Time: $time_conn_op->{$srcnt_conn_op}\n";
print " - Connection Number: $conn\n";
print " - Operation Number: $op\n";
@@ -692,7 +692,7 @@ if ($verb eq "yes" || $usage =~ /u/ || $usage =~ /U/){
}
}
if (exists($filter_conn_op->{$srcnt_conn_op}) && defined($filter_conn_op->{$srcnt_conn_op})) {
- if ($usage =~ /u/) {
+ if ($verb eq "yes" || $usage =~ /u/) {
print " - Search Filter: $filter_conn_op->{$srcnt_conn_op}\n";
}
$uniqFilt{$filter_conn_op->{$srcnt_conn_op}}++;
@@ -722,10 +722,10 @@ if ($verb eq "yes" || $usage =~ /u/ || $usage =~ /U/){
my $unindexedIp;
my %uniqFilt = (); # hash of unique filters
while (my ($srcnt_conn_op, $count) = each %{$notesu_conn_op}) {
- my ($srvRstCnt, $conn, $op) = split(",", $srcnt_conn_op);
- $unindexedIp = getIPfromConn($conn, $srvRstCnt);
- if ($usage =~ /u/) {
- print "\n Unindexed Component #".$notesCount."\n";
+ if ($verb eq "yes" || $usage =~ /u/) {
+ my ($srvRstCnt, $conn, $op) = split(",", $srcnt_conn_op);
+ $unindexedIp = getIPfromConn($conn, $srvRstCnt);
+ print "\n Unindexed Component #".$notesCount." (notes=U)\n";
print " - Date/Time: $time_conn_op->{$srcnt_conn_op}\n";
print " - Connection Number: $conn\n";
print " - Operation Number: $op\n";
@@ -740,7 +740,7 @@ if ($verb eq "yes" || $usage =~ /u/ || $usage =~ /U/){
}
}
if (exists($filter_conn_op->{$srcnt_conn_op}) && defined($filter_conn_op->{$srcnt_conn_op})) {
- if ($usage =~ /u/) {
+ if ($verb eq "yes" || $usage =~ /u/) {
print " - Search Filter: $filter_conn_op->{$srcnt_conn_op}\n";
}
$uniqFilt{$filter_conn_op->{$srcnt_conn_op}}++;
10 years, 6 months
Branch '389-ds-base-1.3.1' - ldap/admin
by Noriko Hosoi
ldap/admin/src/scripts/60upgradeconfigfiles.pl | 69 +++++++++++++++++++++++++
1 file changed, 69 insertions(+)
New commits:
commit 5950daa74ef929d6543b04baf2255c65e606a97d
Author: Noriko Hosoi <nhosoi(a)redhat.com>
Date: Fri Oct 4 11:38:33 2013 -0700
Ticket #53 - Need to update supported locales
commit e0c78d5b87d4d798a936eba9c90f5db5347bcb3c did not include
the upgreade script: 60upgradeconfigfiles.pl.
Note: This is a part of 389-ds-base-1.3.2.0.
(cherry picked from commit 64e0b3799971fa17aae7260ae238e9f68f66c3bd)
diff --git a/ldap/admin/src/scripts/60upgradeconfigfiles.pl b/ldap/admin/src/scripts/60upgradeconfigfiles.pl
new file mode 100644
index 0000000..4b37353
--- /dev/null
+++ b/ldap/admin/src/scripts/60upgradeconfigfiles.pl
@@ -0,0 +1,69 @@
+use File::Copy;
+use Mozilla::LDAP::LDIF;
+use DSCreate qw(installSchema);
+
+sub runinst {
+ my ($inf, $inst, $dseldif, $conn) = @_;
+
+ if (!$inf->{slapd}->{config_dir} or (! -d $inf->{slapd}->{config_dir})) {
+ return ('error_reading_config_dir', $inf->{slapd}->{config_dir});
+ }
+
+ # these files are obsolete, or we want to replace
+ # them with newer versions
+ my @toremove = qw(slapd-collations.conf);
+
+ # make a backup directory to store the deleted config file, then
+ # don't really delete it, just move it to that directory
+ my $mode = (stat($inf->{slapd}->{config_dir}))[2];
+ my $bakdir = $inf->{slapd}->{bak_dir} . ".bak";
+ if (! -d $bakdir) {
+ $! = 0; # clear
+ mkdir $bakdir, $mode;
+ if ($!) {
+ return ('error_creating_directory', $bakdir, $!);
+ }
+ }
+
+ my @errs;
+ for my $file (@toremove) {
+ my $oldname = $inf->{slapd}->{config_dir} . "/" . $file;
+ next if (! -f $oldname); # does not exist - skip - already (re)moved
+ my $newname = "$bakdir/$file";
+ $! = 0; # clear
+ rename $oldname, $newname;
+ if ($!) {
+ push @errs, ["error_renaming_config", $oldname, $newname, $!];
+ }
+ }
+
+ my $configsrcdir = $inf->{slapd}->{config_dir} . "/../config";
+ for my $file (@toremove) {
+ my $srcname = "$configsrcdir/$file";
+ my $newname = $inf->{slapd}->{config_dir} . "/" . $file;
+
+ copy $srcname, $newname;
+ if ($!) {
+ push @errs, ["error_renaming_config", $srcname, $newname, $!];
+ }
+ }
+
+ # If we've encountered any errors up to this point, restore
+ # the original file.
+ if (@errs) {
+ # restore the original files
+ for my $file (@toremove) {
+ my $oldname = "$bakdir/$file";
+ next if (! -f $oldname); # does not exist - not backed up
+ my $newname = $inf->{slapd}->{config_dir} . "/" . $file;
+ next if (-f $newname); # not removed
+ rename $oldname, $newname;
+ }
+ return @errs;
+ }
+
+ if (-d $bakdir) {
+ system("rm -rf $bakdir");
+ }
+ return ();
+}
10 years, 6 months
man/man1
by Mark Reynolds
man/man1/logconv.pl.1 | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
New commits:
commit a5f9e7d4de3c0261bd63458a191a8e0a697112c0
Author: Mark Reynolds <mreynolds(a)redhat.com>
Date: Tue Oct 8 10:45:54 2013 -0400
Ticket 47535 - update man page
Forgot to add the new flag to the top of the man page that gives the basic usage.
https://fedorahosted.org/389/ticket/47535
diff --git a/man/man1/logconv.pl.1 b/man/man1/logconv.pl.1
index 0300baa..e9c6245 100644
--- a/man/man1/logconv.pl.1
+++ b/man/man1/logconv.pl.1
@@ -20,7 +20,7 @@ logconv.pl \- analyzes Directory Server access log files
.SH SYNOPSIS
.B logconv.pl
[\fI\-h\fR] [\fI\-d <rootDN>\fR] [\fI\-s <size limit>\fR] [\fI\-v\fR] [\fI\-V\fR]
-[\fI\-S <start time>\fR] [\fI\-E <end time>\fR]
+[\fI\-S <start time>\fR] [\fI\-E <end time>\fR] [\fI\-T <min etime>\fR]
[\fI\-efcibaltnxgjuU\fR] [\fI access log ... ... \fR]
.PP
.SH DESCRIPTION
10 years, 6 months
Branch '389-ds-base-1.2.11' - ldap/servers
by Mark Reynolds
ldap/servers/slapd/back-ldbm/ldbm_delete.c | 1 +
1 file changed, 1 insertion(+)
New commits:
commit 200b4e44230840a5dd970e0f6b404053545cb381
Author: Mark Reynolds <mreynolds(a)redhat.com>
Date: Tue Oct 8 10:28:47 2013 -0400
Ticket 47517 - fix memory leak in ldbm_delete.c
https://fedorahosted.org/389/ticket/47517
reviewed by: nhosoi & richm(Thanks!)
diff --git a/ldap/servers/slapd/back-ldbm/ldbm_delete.c b/ldap/servers/slapd/back-ldbm/ldbm_delete.c
index a3dc17b..d1ad3ef 100644
--- a/ldap/servers/slapd/back-ldbm/ldbm_delete.c
+++ b/ldap/servers/slapd/back-ldbm/ldbm_delete.c
@@ -336,6 +336,7 @@ ldbm_back_delete( Slapi_PBlock *pb )
* and numsubordinate count could get confused.
*/
ID pid = (ID)strtol(pid_str, (char **)NULL, 10);
+ slapi_ch_free_string(&pid_str);
parent = id2entry(be, pid ,NULL, &retval);
if (parent && cache_lock_entry(&inst->inst_cache, parent)) {
/* Failed to obtain parent entry's entry lock */
10 years, 6 months
Branch '389-ds-base-1.3.0' - ldap/servers
by Mark Reynolds
ldap/servers/slapd/back-ldbm/ldbm_delete.c | 1 +
ldap/servers/slapd/ldaputil.c | 3 ++-
2 files changed, 3 insertions(+), 1 deletion(-)
New commits:
commit a0d2d529ad83b90367fba52e7a13e03803a9b3d1
Author: Mark Reynolds <mreynolds(a)redhat.com>
Date: Tue Oct 8 10:21:34 2013 -0400
Ticket 47517 - fix memory leaks in ldaputil.c nad ldbm_delete.c
Fixed leak when getting the hostname control in ldaputil.c, and a leak in ldbm_delete.c
and the hte parent id string.
https://fedorahosted.org/389/ticket/47517
Reviewed by: nhosoi & richm(Thanks!)
diff --git a/ldap/servers/slapd/back-ldbm/ldbm_delete.c b/ldap/servers/slapd/back-ldbm/ldbm_delete.c
index 9d84cb1..c5ecd7f 100644
--- a/ldap/servers/slapd/back-ldbm/ldbm_delete.c
+++ b/ldap/servers/slapd/back-ldbm/ldbm_delete.c
@@ -456,6 +456,7 @@ ldbm_back_delete( Slapi_PBlock *pb )
* and numsubordinate count could get confused.
*/
ID pid = (ID)strtol(pid_str, (char **)NULL, 10);
+ slapi_ch_free_string(&pid_str);
parent = id2entry(be, pid ,NULL, &retval);
if (parent && cache_lock_entry(&inst->inst_cache, parent)) {
/* Failed to obtain parent entry's entry lock */
diff --git a/ldap/servers/slapd/ldaputil.c b/ldap/servers/slapd/ldaputil.c
index edef006..8e6ec8b 100644
--- a/ldap/servers/slapd/ldaputil.c
+++ b/ldap/servers/slapd/ldaputil.c
@@ -1096,6 +1096,7 @@ slapi_ldap_bind(
if (ptr) {
copy = slapi_ch_strdup(myhostname);
*(copy + (ptr - myhostname)) = '\0';
+ slapi_ch_free_string(&myhostname);
myhostname = copy;
}
}
@@ -1118,7 +1119,7 @@ slapi_ldap_bind(
myerrno ? myerrno : gaierr,
myerrno ? slapd_system_strerror(myerrno) : gai_strerror(gaierr),
myhostname ? myhostname : "unknown host");
- slapi_ch_free_string(©);
+ slapi_ch_free_string(&myhostname);
goto done;
}
10 years, 6 months
Branch '389-ds-base-1.3.1' - ldap/servers
by Mark Reynolds
ldap/servers/slapd/back-ldbm/idl_new.c | 16 +++++++++++++++-
ldap/servers/slapd/back-ldbm/index.c | 2 --
ldap/servers/slapd/back-ldbm/ldbm_delete.c | 1 +
ldap/servers/slapd/ldaputil.c | 3 ++-
4 files changed, 18 insertions(+), 4 deletions(-)
New commits:
commit 98dd62e4a9ed6696a3becfda3ccb456de587601f
Author: Mark Reynolds <mreynolds(a)redhat.com>
Date: Mon Oct 7 09:57:47 2013 -0400
Ticket 47517 - memory leak in range searches and other various leaks
Bug Description: Range searches leak memory
Fix Description: Free the db key, if the key changed between calls to c_get.
Also fixed a leak when doing a delete operation(retrieving the
parent id), and fixed a leak in replication incremental protocol
when getting the hostname control.
https://fedorahosted.org/389/ticket/47517
Reviewed by: nhosoi & richm(Thanks!)
(cherry picked from commit b737882146e709aa75771168ffd9db63af23e005)
diff --git a/ldap/servers/slapd/back-ldbm/idl_new.c b/ldap/servers/slapd/back-ldbm/idl_new.c
index 50ad5cb..f0410f9 100644
--- a/ldap/servers/slapd/back-ldbm/idl_new.c
+++ b/ldap/servers/slapd/back-ldbm/idl_new.c
@@ -576,6 +576,11 @@ idl_new_range_fetch(
}
#endif
ret = cursor->c_get(cursor, &cur_key, &data, DB_NEXT_DUP|DB_MULTIPLE);
+ if (saved_key != cur_key.data) {
+ /* key was allocated in c_get */
+ slapi_ch_free(&saved_key);
+ saved_key = cur_key.data;
+ }
if (ret) {
if (upperkey && upperkey->data && DBT_EQ(&cur_key, upperkey)) {
/* this is the last key */
@@ -583,6 +588,11 @@ idl_new_range_fetch(
}
/* First set the cursor (DB_NEXT_NODUP does not take DB_MULTIPLE) */
ret = cursor->c_get(cursor, &cur_key, &data, DB_NEXT_NODUP);
+ if (saved_key != cur_key.data) {
+ /* key was allocated in c_get */
+ slapi_ch_free(&saved_key);
+ saved_key = cur_key.data;
+ }
if (ret) {
break;
}
@@ -633,13 +643,17 @@ idl_new_range_fetch(
}
}
ret = cursor->c_get(cursor,&cur_key,&data,DB_NEXT_DUP);
+ if (saved_key != cur_key.data) {
+ /* key was allocated in c_get */
+ slapi_ch_free(&saved_key);
+ saved_key = cur_key.data;
+ }
count++;
if (ret) {
if (upperkey && upperkey->data && DBT_EQ(&cur_key, upperkey)) {
/* this is the last key */
break;
}
- DBT_FREE_PAYLOAD(cur_key);
ret = cursor->c_get(cursor, &cur_key, &data, DB_NEXT_NODUP);
if (saved_key != cur_key.data) {
/* key was allocated in c_get */
diff --git a/ldap/servers/slapd/back-ldbm/index.c b/ldap/servers/slapd/back-ldbm/index.c
index f4de2fa..1504fa8 100644
--- a/ldap/servers/slapd/back-ldbm/index.c
+++ b/ldap/servers/slapd/back-ldbm/index.c
@@ -1401,8 +1401,6 @@ index_range_read_ext(
type, prefix, *err );
}
} else if (DBTcmp (&upperkey, &cur_key, ai->ai_key_cmp_fn) > 0) {
- tmpbuf = slapi_ch_realloc (tmpbuf, cur_key.dsize);
- memcpy (tmpbuf, cur_key.dptr, cur_key.dsize);
DBT_FREE_PAYLOAD(upperkey);
upperkey.dptr = NULL; /* x >= a :no need to check upper bound */
upperkey.dsize = 0;
diff --git a/ldap/servers/slapd/back-ldbm/ldbm_delete.c b/ldap/servers/slapd/back-ldbm/ldbm_delete.c
index c174c18..6725123 100644
--- a/ldap/servers/slapd/back-ldbm/ldbm_delete.c
+++ b/ldap/servers/slapd/back-ldbm/ldbm_delete.c
@@ -457,6 +457,7 @@ ldbm_back_delete( Slapi_PBlock *pb )
* and numsubordinate count could get confused.
*/
ID pid = (ID)strtol(pid_str, (char **)NULL, 10);
+ slapi_ch_free_string(&pid_str);
parent = id2entry(be, pid ,NULL, &retval);
if (parent && cache_lock_entry(&inst->inst_cache, parent)) {
/* Failed to obtain parent entry's entry lock */
diff --git a/ldap/servers/slapd/ldaputil.c b/ldap/servers/slapd/ldaputil.c
index e56c392..edc8267 100644
--- a/ldap/servers/slapd/ldaputil.c
+++ b/ldap/servers/slapd/ldaputil.c
@@ -1096,6 +1096,7 @@ slapi_ldap_bind(
if (ptr) {
copy = slapi_ch_strdup(myhostname);
*(copy + (ptr - myhostname)) = '\0';
+ slapi_ch_free_string(&myhostname);
myhostname = copy;
}
}
@@ -1119,7 +1120,7 @@ slapi_ldap_bind(
myerrno ? myerrno : gaierr,
myerrno ? slapd_system_strerror(myerrno) : gai_strerror(gaierr),
myhostname ? myhostname : "unknown host");
- slapi_ch_free_string(©);
+ slapi_ch_free_string(&myhostname);
goto done;
}
10 years, 6 months
2 commits - admserv/newinst
by Richard Allen Megginson
admserv/newinst/src/AdminServer.pm.in | 71 ++++++++++++++-------------
admserv/newinst/src/AdminUtil.pm.in | 2
admserv/newinst/src/register-ds-admin.pl.in | 10 ++-
admserv/newinst/src/register-ds-admin.res.in | 4 +
4 files changed, 51 insertions(+), 36 deletions(-)
New commits:
commit 6a3de6820d086770083b681c56e6b0a2c2ea831c
Author: Rich Megginson <rmeggins(a)redhat.com>
Date: Mon Oct 7 16:46:41 2013 -0600
Ticket #418 Error with register-ds-admin.pl
https://fedorahosted.org/389/ticket/418
Reviewed by: nhosoi (Thanks!)
Branch: master
Fix Description: Make sure the inf given to the registration procedure has
the keys ConfigDirectoryAdminID and ServerAdminID. In addition, do not
display .removed slapd instances for registration, and clean up the
messages.
Platforms tested: RHEL6 x86_64
Flag Day: no
Doc impact: no
diff --git a/admserv/newinst/src/AdminUtil.pm.in b/admserv/newinst/src/AdminUtil.pm.in
index 27130e0..d370f9e 100644
--- a/admserv/newinst/src/AdminUtil.pm.in
+++ b/admserv/newinst/src/AdminUtil.pm.in
@@ -760,6 +760,8 @@ sub registerScatteredDSWithConfigDS {
$instinf->{General}->{ConfigDirectoryLdapURL} =
$inf->{General}->{ConfigDirectoryLdapURL};
$instinf->{General}->{AdminDomain} = $inf->{General}->{AdminDomain};
+ $instinf->{General}->{ConfigDirectoryAdminID} = $inf->{General}->{ConfigDirectoryAdminID};
+ $instinf->{General}->{ServerAdminID} = $inf->{General}->{ServerAdminID};
if (!registerDSWithConfigDS($dsinst, $errs, $instinf,
$conn, $admConf, $configdir)) {
return 0;
diff --git a/admserv/newinst/src/register-ds-admin.pl.in b/admserv/newinst/src/register-ds-admin.pl.in
index 0cc251b..45ca806 100644
--- a/admserv/newinst/src/register-ds-admin.pl.in
+++ b/admserv/newinst/src/register-ds-admin.pl.in
@@ -110,7 +110,7 @@ my $instconfigdir = $setup->{configdir};
my %instances = ();
for my $dir (glob("$setup->{configdir}/slapd-*"))
{
- if (-d $dir)
+ if (-d $dir and ($dir !~ /.removed$/))
{
my $dname = dirname($dir);
my $bname = basename($dir);
@@ -131,7 +131,7 @@ while ( !$done && ($ans = reg_get_response($setup, 'subds_conf_prompt', "@instc
{
;
}
- elsif ( basename($ans) =~ /^slapd-/ )
+ elsif ( (basename($ans) =~ /^slapd-/) and ($ans !~ /.removed$/) )
{
my $dname = dirname($ans);
my $bname = basename($ans);
@@ -167,7 +167,7 @@ out0:
my $file = "";
while ( defined($file = readdir(DIR)) )
{
- next if ( !("$file" =~ /^slapd-/) );
+ next if ( !("$file" =~ /^slapd-/) or ($file =~ /.removed$/) );
if ( exists $instances{$ans} )
{
my $addit = 1;
@@ -486,6 +486,10 @@ foreach my $subconfdir (keys %instances)
}
}
+ if (!$done and !@errs) {
+ $setup->msg('post_create_subds', $subinst, $subinst);
+ }
+
# add the aci that allows the admin user to administer the server
@errs = ();
if (!addConfigACIsToSubDS($setup->{inf}, \@errs)) {
diff --git a/admserv/newinst/src/register-ds-admin.res.in b/admserv/newinst/src/register-ds-admin.res.in
index 56bb0f2..df022bf 100644
--- a/admserv/newinst/src/register-ds-admin.res.in
+++ b/admserv/newinst/src/register-ds-admin.res.in
@@ -14,7 +14,7 @@ register_subds = Registering Sub DSes:
end_ds_registration = Finished registration of the Directory Server
-input_rootdn_passwd = Input the Directory Server password on the server %s:
+input_rootdn_passwd = Input the Directory Manager password on the server %s:
input_rootdn_passwd_sub = If you want to register the server %s, input the Directory Manager password on the server.\n\nIf you don't, type return.\n[Directory Manager password on %s or return]:
@@ -39,3 +39,5 @@ error_register_configds = Error: failed to register the configuration server inf
error_register_subds = Error: failed to register the additional server info to the Configuration Directory Server %s.\n
error_unregister_ds = Error: failed to clean up the configuration info from the old Configuration\nDirectory Server %s.\n
+
+post_create_subds = Instance '%s' was registered.\n\nYou must restart '%s' in order to complete console registration.\n
commit 6b672320ac31bd111f09f5d1122eae3d14bbd0ca
Author: Wes Hardin <wes.hardin(a)maxim-ic.com>
Date: Mon May 21 10:50:22 2012 -0500
fix for bug 377 - Unchecked use of SELinux command
Reviewed by: rmeggins
diff --git a/admserv/newinst/src/AdminServer.pm.in b/admserv/newinst/src/AdminServer.pm.in
index 937df8a..1d7d06f 100644
--- a/admserv/newinst/src/AdminServer.pm.in
+++ b/admserv/newinst/src/AdminServer.pm.in
@@ -696,26 +696,30 @@ sub removeAdminServer {
# turn off the switch to allow admin server to connect to the ldap port
$? = 0; # clear error
- my $cmd = "getsebool httpd_can_connect_ldap";
- my $output = `$cmd 2>&1`;
- chomp($output);
- if ($output =~ /Error getting active value for httpd_can_connect_ldap/) {
- # this version of selinux does not support the boolean value
- debug(1, "This version of selinux does not support httpd_can_connect_ldap\n");
- } elsif ($?) {
- $setup->msg($SetupLog::WARN, 'error_running_command', $cmd, $output, $!);
- } elsif ($output =~ /on$/) {
- $cmd = "setsebool -P httpd_can_connect_ldap off";
- $? = 0; # clear error
- $output = `$cmd 2>&1`;
+
+ $rc = system("/usr/sbin/selinuxenabled");
+ if ($rc == 0) {
+ my $cmd = "getsebool httpd_can_connect_ldap";
+ my $output = `$cmd 2>&1`;
chomp($output);
- if ($?) {
+ if ($output =~ /Error getting active value for httpd_can_connect_ldap/) {
+ # this version of selinux does not support the boolean value
+ debug(1, "This version of selinux does not support httpd_can_connect_ldap\n");
+ } elsif ($?) {
$setup->msg($SetupLog::WARN, 'error_running_command', $cmd, $output, $!);
+ } elsif ($output =~ /on$/) {
+ $cmd = "setsebool -P httpd_can_connect_ldap off";
+ $? = 0; # clear error
+ $output = `$cmd 2>&1`;
+ chomp($output);
+ if ($?) {
+ $setup->msg($SetupLog::WARN, 'error_running_command', $cmd, $output, $!);
+ } else {
+ debug(1, "$cmd was successful\n");
+ }
} else {
- debug(1, "$cmd was successful\n");
+ debug(1, "selinux boolean httpd_can_connect_ldap is already off - $output\n");
}
- } else {
- debug(1, "selinux boolean httpd_can_connect_ldap is already off - $output\n");
}
}
@@ -809,26 +813,29 @@ sub updateSelinuxPolicy {
# turn on the switch to allow admin server to connect to the ldap port
$? = 0; # clear error
- my $cmd = "getsebool httpd_can_connect_ldap";
- my $output = `$cmd 2>&1`;
- chomp($output);
- if ($output =~ /Error getting active value for httpd_can_connect_ldap/) {
- # this version of selinux does not support the boolean value
- debug(1, "This version of selinux does not support httpd_can_connect_ldap\n");
- } elsif ($?) {
- $setup->msg($SetupLog::WARN, 'error_running_command', $cmd, $output, $!);
- } elsif ($output =~ /off$/) {
- $cmd = "setsebool -P httpd_can_connect_ldap on";
- $? = 0; # clear error
- $output = `$cmd 2>&1`;
+ $rc = system("/usr/sbin/selinuxenabled");
+ if ($rc == 0) {
+ my $cmd = "getsebool httpd_can_connect_ldap";
+ my $output = `$cmd 2>&1`;
chomp($output);
- if ($?) {
+ if ($output =~ /Error getting active value for httpd_can_connect_ldap/) {
+ # this version of selinux does not support the boolean value
+ debug(1, "This version of selinux does not support httpd_can_connect_ldap\n");
+ } elsif ($?) {
$setup->msg($SetupLog::WARN, 'error_running_command', $cmd, $output, $!);
+ } elsif ($output =~ /off$/) {
+ $cmd = "setsebool -P httpd_can_connect_ldap on";
+ $? = 0; # clear error
+ $output = `$cmd 2>&1`;
+ chomp($output);
+ if ($?) {
+ $setup->msg($SetupLog::WARN, 'error_running_command', $cmd, $output, $!);
+ } else {
+ debug(1, "$cmd was successful\n");
+ }
} else {
- debug(1, "$cmd was successful\n");
+ debug(1, "selinux boolean httpd_can_connect_ldap is already on - $output\n");
}
- } else {
- debug(1, "selinux boolean httpd_can_connect_ldap is already on - $output\n");
}
}
}
10 years, 6 months