ldap/admin
by Richard Allen Megginson
ldap/admin/src/scripts/DSMigration.pm.in | 6 ++-
ldap/admin/src/scripts/DSUtil.pm.in | 33 +++++--------------
ldap/admin/src/scripts/Inf.pm | 53 +++++++++++++++++++++++--------
ldap/admin/src/scripts/Migration.pm.in | 17 +--------
ldap/admin/src/scripts/Setup.pm.in | 17 +--------
ldap/admin/src/scripts/migrate-ds.pl.in | 13 +++++--
ldap/admin/src/scripts/setup-ds.pl.in | 7 +---
7 files changed, 68 insertions(+), 78 deletions(-)
New commits:
commit 8e6e74009c80a7032308657e71450cb5aed9483c
Author: Rich Megginson <rmeggins(a)redhat.com>
Date: Tue May 25 12:15:18 2010 -0600
Bug 593392 - setup-ds-admin.pl -k creates world readable file
https://bugzilla.redhat.com/show_bug.cgi?id=593392
Resolves: bug 593392
Bug Description: setup-ds-admin.pl -k creates world readable file
Reviewed by: thoger (Thanks!)
Branch: HEAD
Fix Description: Use umask to make sure we create a .inf file that is
only viewable by the user. In addition, only create the temp file and
filename when necessary. In some places, the code was creating a .inf
file on disk when it could just create one in memory. The code should
check to see if the Inf object has a file associated with it before
attemtping to unlink it. Make sure we do not unlink a .inf file given
with -f on the command line. If the user specified -k, always write to
a temp file using __temp__ as the keyword to tell Inf->write to generate
a temp file.
Platforms tested: RHEL5 x86_64
Flag Day: no
Doc impact: no
diff --git a/ldap/admin/src/scripts/DSMigration.pm.in b/ldap/admin/src/scripts/DSMigration.pm.in
index 2f5641c..38407ba 100644
--- a/ldap/admin/src/scripts/DSMigration.pm.in
+++ b/ldap/admin/src/scripts/DSMigration.pm.in
@@ -1105,7 +1105,7 @@ sub migrateDS {
$mig->msg($FATAL, 'error_opening_dseldif', "$oldconfigdir/dse.ldif", $!);
return 0;
}
- debug(2, "Using inffile $inf->{filename} created from $oldconfigdir\n");
+ debug(2, "Using inf created from $oldconfigdir\n");
# create servers but do not start them until after databases
# have been migrated
@@ -1113,7 +1113,9 @@ sub migrateDS {
# create the new instance
@errs = createDSInstance($inf);
- unlink($inf->{filename});
+ if ($inf->{filename}) {
+ unlink($inf->{filename});
+ }
if (@errs) {
$mig->msg(@errs);
$mig->msg($FATAL, 'error_creating_dsinstance', $inst);
diff --git a/ldap/admin/src/scripts/DSUtil.pm.in b/ldap/admin/src/scripts/DSUtil.pm.in
index c292d4e..04d6f7b 100644
--- a/ldap/admin/src/scripts/DSUtil.pm.in
+++ b/ldap/admin/src/scripts/DSUtil.pm.in
@@ -769,30 +769,19 @@ sub createInfFromConfig {
return 0;
}
- my ($outfh, $inffile) = tempfile(SUFFIX => '.inf');
- if (!$outfh || !$inffile) {
- push @{$errs}, "error_opening_tempinf", $fname, $!;
- if ($outfh) {
- close $outfh;
- }
- $conn->close();
- return 0;
- }
- print $outfh "[General]\n";
- print $outfh "FullMachineName = ", $ent->getValues('nsslapd-localhost'), "\n";
- print $outfh "SuiteSpotUserID = ", $ent->getValues('nsslapd-localuser'), "\n";
- print $outfh "[slapd]\n";
- print $outfh "RootDN = ", $ent->getValues('nsslapd-rootdn'), "\n";
- print $outfh "RootDNPwd = ", $ent->getValues('nsslapd-rootpw'), "\n";
- print $outfh "ServerPort = ", $ent->getValues('nsslapd-port'), "\n";
- print $outfh "ServerIdentifier = $id\n";
+ my $inf = new Inf();
+ $inf->{General}->{FullMachineName} = $ent->getValues('nsslapd-localhost');
+ $inf->{General}->{SuiteSpotUserID} = $ent->getValues('nsslapd-localuser');
+ $inf->{slapd}->{RootDN} = $ent->getValues('nsslapd-rootdn');
+ $inf->{slapd}->{RootDNPwd} = $ent->getValues('nsslapd-rootpw');
+ $inf->{slapd}->{ServerPort} = $ent->getValues('nsslapd-port');
+ $inf->{slapd}->{ServerIdentifier} = $id;
my $suffix;
$ent = $conn->search("cn=ldbm database,cn=plugins,cn=config",
"one", "(objectclass=*)");
if (!$ent) {
push @{$errs}, "error_opening_dseldif", $fname, $!;
- close $outfh;
$conn->close();
return 0;
}
@@ -807,7 +796,6 @@ sub createInfFromConfig {
$ent = $conn->search("cn=config", "base", "(objectclass=*)");
if (!$ent) {
push @{$errs}, "error_opening_dseldif", $fname, $!;
- close $outfh;
$conn->close();
return 0;
}
@@ -816,12 +804,9 @@ sub createInfFromConfig {
$conn->close();
if ($inst_dir) {
- print $outfh "inst_dir = $inst_dir\n";
+ $inf->{slapd}->{inst_dir} = $inst_dir;
}
- print $outfh "Suffix = $suffix\n";
- close $outfh;
-
- my $inf = new Inf($inffile);
+ $inf->{slapd}->{Suffix} = $suffix;
return $inf;
}
diff --git a/ldap/admin/src/scripts/Inf.pm b/ldap/admin/src/scripts/Inf.pm
index bb22913..a102eb6 100644
--- a/ldap/admin/src/scripts/Inf.pm
+++ b/ldap/admin/src/scripts/Inf.pm
@@ -41,6 +41,8 @@
package Inf;
+use File::Temp qw(tempfile tempdir);
+
#require Exporter;
#@ISA = qw(Exporter);
#@EXPORT = qw();
@@ -50,6 +52,9 @@ sub new {
my $self = {};
$self->{filename} = shift;
+ $self->{writable} = shift; # do not overwrite user supplied file
+ # if you want to init an Inf with a writable file, use
+ # $inf = new Inf($filename, 1)
$self = bless $self, $type;
@@ -162,7 +167,7 @@ sub writeSection {
my $section = $self->{$name};
if (ref($section) eq 'HASH') {
print $fh "[$name]\n";
- for my $key (keys %{$section}) {
+ for my $key (sort keys %{$section}) {
if (defined($section->{$key})) {
my $val = $section->{$key};
$val =~ s/\n/\\\n/g; # make continuation lines
@@ -175,28 +180,50 @@ sub writeSection {
sub write {
my $self = shift;
my $filename = shift;
+ my $fh;
- if ($filename) {
+ return if ($filename and $filename eq "-");
+
+ # see if user wants to force use of a temp file
+ if ($filename and $filename eq '__temp__') {
+ $self->{writable} = 1;
+ $filename = '';
+ delete $self->{filename};
+ }
+
+ if (!$self->{writable}) {
+ return; # do not overwrite read only file
+ }
+
+ if ($filename) { # use user supplied filename
$self->{filename} = $filename;
- } else {
+ } elsif ($self->{filename}) { # use existing filename
$filename = $self->{filename};
+ } else { # create temp filename
+ ($fh, $self->{filename}) = tempfile("setupXXXXXX", UNLINK => 0,
+ SUFFIX => ".inf", OPEN => 1,
+ DIR => File::Spec->tmpdir);
}
- return if ($filename eq "-");
-
- if (!open(INF, ">$filename")) {
- print STDERR "Error: could not write inf file $filename: $!\n";
- return;
+ my $savemask = umask(0077);
+ if (!$fh) {
+ if (!open(INF, ">$filename")) {
+ print STDERR "Error: could not write inf file $filename: $!\n";
+ umask($savemask);
+ return;
+ }
+ $fh = *INF;
}
# write General section first
- $self->writeSection('General', \*INF);
- print INF "\n";
+ $self->writeSection('General', $fh);
+ print $fh "\n";
for my $key (keys %{$self}) {
next if ($key eq 'General');
- $self->writeSection($key, \*INF);
- print INF "\n";
+ $self->writeSection($key, $fh);
+ print $fh "\n";
}
- close INF;
+ close $fh;
+ umask($savemask);
}
sub updateFromArgs {
diff --git a/ldap/admin/src/scripts/Migration.pm.in b/ldap/admin/src/scripts/Migration.pm.in
index 1942c8b..66618c8 100644
--- a/ldap/admin/src/scripts/Migration.pm.in
+++ b/ldap/admin/src/scripts/Migration.pm.in
@@ -54,9 +54,6 @@ use Exporter ();
@EXPORT = qw();
@EXPORT_OK = qw();
-# tempfiles
-use File::Temp qw(tempfile tempdir);
-
# hostname
use Net::Domain qw(hostfqdn);
@@ -68,8 +65,6 @@ use Mozilla::LDAP::LDIF;
use Getopt::Long;
-use File::Temp qw(tempfile tempdir);
-
use SetupLog;
use DSUtil;
@@ -210,7 +205,6 @@ sub init {
$actualsroot =~ s/\/+$//; # trim trailing '/'s, if any
$self->{actualsroot} = $actualsroot || $self->{oldsroot};
$self->{silent} = $silent;
- $self->{inffile} = $inffile;
$self->{keep} = $keep;
$self->{preonly} = $preonly;
$self->{logfile} = $logfile;
@@ -218,18 +212,11 @@ sub init {
$self->{log} = new SetupLog($self->{logfile}, "migrate");
$self->{start_servers} = 1; # start servers as soon as they are migrated
# if user supplied inf file, use that to initialize
- if (defined($self->{inffile})) {
- $self->{inf} = new Inf($self->{inffile});
+ if (defined($inffile)) {
+ $self->{inf} = new Inf($inffile);
} else {
$self->{inf} = new Inf;
}
- my $fh;
- # create a temp inf file for writing for other processes
- # never overwrite the user supplied inf file
- ($fh, $self->{inffile}) = tempfile("migrateXXXXXX", UNLINK => !$keep,
- SUFFIX => ".inf", OPEN => 0,
- DIR => File::Spec->tmpdir);
- $self->{inf}->{filename} = $self->{inffile};
# see if user passed in default inf values - also, command line
# arguments override those passed in via an inf file - this
diff --git a/ldap/admin/src/scripts/Setup.pm.in b/ldap/admin/src/scripts/Setup.pm.in
index 52300db..753062d 100644
--- a/ldap/admin/src/scripts/Setup.pm.in
+++ b/ldap/admin/src/scripts/Setup.pm.in
@@ -52,9 +52,6 @@ use Exporter ();
@EXPORT = qw($SILENT $EXPRESS $TYPICAL $CUSTOM);
@EXPORT_OK = qw($SILENT $EXPRESS $TYPICAL $CUSTOM);
-# tempfiles
-use File::Temp qw(tempfile tempdir);
-
# hostname
use Net::Domain qw(hostfqdn);
@@ -66,8 +63,6 @@ use Mozilla::LDAP::LDIF;
use Getopt::Long;
-use File::Temp qw(tempfile tempdir);
-
use SetupLog;
use DSUtil;
use Inf;
@@ -141,7 +136,6 @@ sub init {
);
$self->{silent} = $silent;
- $self->{inffile} = $inffile;
$self->{keep} = $keep;
$self->{preonly} = $preonly;
$self->{update} = $update;
@@ -149,18 +143,11 @@ sub init {
$self->{logfile} = $logfile;
$self->{log} = new SetupLog($self->{logfile});
# if user supplied inf file, use that to initialize
- if (defined($self->{inffile})) {
- $self->{inf} = new Inf($self->{inffile});
+ if (defined($inffile)) {
+ $self->{inf} = new Inf($inffile);
} else {
$self->{inf} = new Inf;
}
- my $fh;
- # create a temp inf file for writing for other processes
- # never overwrite the user supplied inf file
- ($fh, $self->{inffile}) = tempfile("setupXXXXXX", UNLINK => !$keep,
- SUFFIX => ".inf", OPEN => 0,
- DIR => File::Spec->tmpdir);
- $self->{inf}->{filename} = $self->{inffile};
# see if user passed in default inf values - also, command line
# arguments override those passed in via an inf file - this
diff --git a/ldap/admin/src/scripts/migrate-ds.pl.in b/ldap/admin/src/scripts/migrate-ds.pl.in
index df14ea0..cd42800 100644
--- a/ldap/admin/src/scripts/migrate-ds.pl.in
+++ b/ldap/admin/src/scripts/migrate-ds.pl.in
@@ -68,9 +68,14 @@ $mig->msg('end_ds_migration');
$mig->doExit(0);
END {
- if ($mig) {
- if (!$mig->{keep}) {
- unlink $mig->{inffile};
- }
+ if ($mig and $mig->{keep}) {
+ $mig->{inf}->write("__temp__");
}
}
+
+# emacs settings
+# Local Variables:
+# mode:perl
+# indent-tabs-mode: nil
+# tab-width: 4
+# End:
diff --git a/ldap/admin/src/scripts/setup-ds.pl.in b/ldap/admin/src/scripts/setup-ds.pl.in
index 266d396..7613ed8 100644
--- a/ldap/admin/src/scripts/setup-ds.pl.in
+++ b/ldap/admin/src/scripts/setup-ds.pl.in
@@ -74,7 +74,6 @@ if (!$setup->{silent}) {
if ($rc) {
$setup->doExit();
}
- $setup->{inf}->write();
}
my @errs;
@@ -105,10 +104,8 @@ if (@errs) {
$setup->doExit(0);
END {
- if ($setup) {
- if (!$setup->{keep}) {
- unlink $setup->{inffile};
- }
+ if ($setup and $setup->{keep}) {
+ $setup->{inf}->write("__temp__");
}
}
13 years, 11 months
Branch 'Directory_Server_8_2_Branch' - ldap/servers
by Noriko Hosoi
ldap/servers/slapd/pw.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
New commits:
commit 142fc25d8d5f38df212fbc197d4e589fda5a458e
Author: Noriko Hosoi <nhosoi(a)redhat.com>
Date: Tue May 25 17:47:47 2010 -0700
511112 - Password history limited to 25 values
https://bugzilla.redhat.com/show_bug.cgi?id=511112
Fix Description: If an entry already having more than 25 password
history attributes is added and password modify is performed on
the entry, it overflows the fixed length values_replace array and
crashes the server. This patch protects the overflow.
diff --git a/ldap/servers/slapd/pw.c b/ldap/servers/slapd/pw.c
index f1e87a3..7014079 100644
--- a/ldap/servers/slapd/pw.c
+++ b/ldap/servers/slapd/pw.c
@@ -1115,10 +1115,10 @@ int update_pw_history( Slapi_PBlock *pb, char *dn, char *old_pw ) {
}
strcpy ( history_str, str );
strcat ( history_str, old_pw );
- if ( i == pwpolicy->pw_inhistory ) {
+ if ( i >= pwpolicy->pw_inhistory ) {
/* replace the oldest password in history */
- values_replace [oldest] = history_str;
- values_replace[i]=NULL;
+ values_replace[oldest] = history_str;
+ values_replace[pwpolicy->pw_inhistory] = NULL;
} else {
/* add old_pw at the end of password history */
values_replace[i] = history_str;
13 years, 11 months
ldap/servers
by Noriko Hosoi
ldap/servers/slapd/pw.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
New commits:
commit caaa2b7c5fdab6d3bf8c3155f32020eae8fc82ce
Author: Noriko Hosoi <nhosoi(a)redhat.com>
Date: Tue May 25 17:47:47 2010 -0700
511112 - Password history limited to 25 values
https://bugzilla.redhat.com/show_bug.cgi?id=511112
Fix Description: If an entry already having more than 25 password
history attributes is added and password modify is performed on
the entry, it overflows the fixed length values_replace array and
crashes the server. This patch protects the overflow.
diff --git a/ldap/servers/slapd/pw.c b/ldap/servers/slapd/pw.c
index 15add06..bf98877 100644
--- a/ldap/servers/slapd/pw.c
+++ b/ldap/servers/slapd/pw.c
@@ -1115,10 +1115,10 @@ int update_pw_history( Slapi_PBlock *pb, char *dn, char *old_pw ) {
}
strcpy ( history_str, str );
strcat ( history_str, old_pw );
- if ( i == pwpolicy->pw_inhistory ) {
+ if ( i >= pwpolicy->pw_inhistory ) {
/* replace the oldest password in history */
- values_replace [oldest] = history_str;
- values_replace[i]=NULL;
+ values_replace[oldest] = history_str;
+ values_replace[pwpolicy->pw_inhistory] = NULL;
} else {
/* add old_pw at the end of password history */
values_replace[i] = history_str;
13 years, 11 months
Branch 'Directory_Server_8_2_Branch' - ldap/servers
by Noriko Hosoi
ldap/servers/slapd/dn.c | 22 +++++++++++++++++++---
1 file changed, 19 insertions(+), 3 deletions(-)
New commits:
commit 1ebcfd4538948335594a2a7cff178a90e5d6b335
Author: Noriko Hosoi <nhosoi(a)redhat.com>
Date: Tue May 25 16:54:46 2010 -0700
595893 - Base DN in SASL mapping is not normalized
https://bugzilla.redhat.com/show_bug.cgi?id=595893
Fix Description: It must be guaranteed that ndn returned
from slapi_sdn_get_ndn is normalized. Putting back the
normalization code in slapi_sdn_get_ndn.
diff --git a/ldap/servers/slapd/dn.c b/ldap/servers/slapd/dn.c
index fc3695c..108c165 100644
--- a/ldap/servers/slapd/dn.c
+++ b/ldap/servers/slapd/dn.c
@@ -1919,10 +1919,26 @@ slapi_sdn_get_ndn(const Slapi_DN *sdn)
if(sdn->dn!=NULL)
{
char *p= slapi_ch_strdup(sdn->dn);
+ char *normed = NULL;
+ size_t dnlen = 0;
+ int rc = 0;
+
Slapi_DN *ncsdn= (Slapi_DN*)sdn; /* non-const Slapi_DN */
- slapi_dn_ignore_case(p); /* dn is normalized; just ignore case */
- ncsdn->ndn= p;
- ncsdn->ndn_len=strlen(p);
+ rc = slapi_dn_normalize_case_ext(p, 0, &normed, &dnlen);
+ if (rc < 0) {
+ /* we give up, just set dn to ndn */
+ slapi_dn_ignore_case(p); /* ignore case */
+ ncsdn->ndn = p;
+ ncsdn->ndn_len = strlen(p);
+ } else if (rc == 0) { /* p is passed in */
+ *(normed + dnlen) = '\0';
+ ncsdn->ndn = normed;
+ ncsdn->ndn_len = dnlen;
+ } else { /* rc > 0 */
+ slapi_ch_free_string(&p);
+ ncsdn->ndn = normed;
+ ncsdn->ndn_len = dnlen;
+ }
ncsdn->flag= slapi_setbit_uchar(sdn->flag,FLAG_NDN);
PR_INCREMENT_COUNTER(slapi_sdn_counter_ndn_created);
PR_INCREMENT_COUNTER(slapi_sdn_counter_ndn_exist);
13 years, 11 months
ldap/servers
by Noriko Hosoi
ldap/servers/slapd/dn.c | 22 +++++++++++++++++++---
1 file changed, 19 insertions(+), 3 deletions(-)
New commits:
commit 50d1c0aaa081a6e2ead6518e992b18e3a12521b3
Author: Noriko Hosoi <nhosoi(a)redhat.com>
Date: Tue May 25 16:54:46 2010 -0700
595893 - Base DN in SASL mapping is not normalized
https://bugzilla.redhat.com/show_bug.cgi?id=595893
Fix Description: It must be guaranteed that ndn returned
from slapi_sdn_get_ndn is normalized. Putting back the
normalization code in slapi_sdn_get_ndn.
diff --git a/ldap/servers/slapd/dn.c b/ldap/servers/slapd/dn.c
index bd229d7..bd22f76 100644
--- a/ldap/servers/slapd/dn.c
+++ b/ldap/servers/slapd/dn.c
@@ -1918,10 +1918,26 @@ slapi_sdn_get_ndn(const Slapi_DN *sdn)
if(sdn->dn!=NULL)
{
char *p= slapi_ch_strdup(sdn->dn);
+ char *normed = NULL;
+ size_t dnlen = 0;
+ int rc = 0;
+
Slapi_DN *ncsdn= (Slapi_DN*)sdn; /* non-const Slapi_DN */
- slapi_dn_ignore_case(p); /* dn is normalized; just ignore case */
- ncsdn->ndn= p;
- ncsdn->ndn_len=strlen(p);
+ rc = slapi_dn_normalize_case_ext(p, 0, &normed, &dnlen);
+ if (rc < 0) {
+ /* we give up, just set dn to ndn */
+ slapi_dn_ignore_case(p); /* ignore case */
+ ncsdn->ndn = p;
+ ncsdn->ndn_len = strlen(p);
+ } else if (rc == 0) { /* p is passed in */
+ *(normed + dnlen) = '\0';
+ ncsdn->ndn = normed;
+ ncsdn->ndn_len = dnlen;
+ } else { /* rc > 0 */
+ slapi_ch_free_string(&p);
+ ncsdn->ndn = normed;
+ ncsdn->ndn_len = dnlen;
+ }
ncsdn->flag= slapi_setbit_uchar(sdn->flag,FLAG_NDN);
PR_INCREMENT_COUNTER(slapi_sdn_counter_ndn_created);
PR_INCREMENT_COUNTER(slapi_sdn_counter_ndn_exist);
13 years, 11 months
Branch 'Directory_Server_8_2_Branch' - ldap/servers
by Noriko Hosoi
ldap/servers/plugins/acl/aclparse.c | 1 +
1 file changed, 1 insertion(+)
New commits:
commit 14fc7fca2a92566e483382492527c2991b92d88c
Author: Noriko Hosoi <nhosoi(a)redhat.com>
Date: Fri May 21 18:26:53 2010 -0700
593899 - adding specific ACI causes very large mem allocate request
https://bugzilla.redhat.com/show_bug.cgi?id=593899
Additional fix: if a target value is double quoted followed by
trailing spaces, the double quotes were not correctly handled.
Sample failed case:
aci: ( target = "ldap:///ou=organizationalUnit, o=test_ACIs.com" )
^
Changed to call __acl_strip_trailing_space to remove them.
diff --git a/ldap/servers/plugins/acl/aclparse.c b/ldap/servers/plugins/acl/aclparse.c
index b128ff8..8c88bf4 100644
--- a/ldap/servers/plugins/acl/aclparse.c
+++ b/ldap/servers/plugins/acl/aclparse.c
@@ -326,6 +326,7 @@ __aclp__parse_aci (char *str, aci_t *aci_item)
if ( (s = strchr( str, '=' )) != NULL ) {
value = s + 1;
__acl_strip_leading_space(&value);
+ __acl_strip_trailing_space(value);
len = strlen ( value );
/* strip double quotes */
if (*value == '"' && value[len-1] == '"') {
13 years, 11 months
ldap/servers
by Noriko Hosoi
ldap/servers/plugins/acl/aclparse.c | 1 +
1 file changed, 1 insertion(+)
New commits:
commit 08a38d39590e4117673ca5d5fe2f4d6b1924da1f
Author: Noriko Hosoi <nhosoi(a)redhat.com>
Date: Fri May 21 18:26:53 2010 -0700
593899 - adding specific ACI causes very large mem allocate request
https://bugzilla.redhat.com/show_bug.cgi?id=593899
Additional fix: if a target value is double quoted followed by
trailing spaces, the double quotes were not correctly handled.
Sample failed case:
aci: ( target = "ldap:///ou=organizationalUnit, o=test_ACIs.com" )
^
Changed to call __acl_strip_trailing_space to remove them.
diff --git a/ldap/servers/plugins/acl/aclparse.c b/ldap/servers/plugins/acl/aclparse.c
index b128ff8..8c88bf4 100644
--- a/ldap/servers/plugins/acl/aclparse.c
+++ b/ldap/servers/plugins/acl/aclparse.c
@@ -326,6 +326,7 @@ __aclp__parse_aci (char *str, aci_t *aci_item)
if ( (s = strchr( str, '=' )) != NULL ) {
value = s + 1;
__acl_strip_leading_space(&value);
+ __acl_strip_trailing_space(value);
len = strlen ( value );
/* strip double quotes */
if (*value == '"' && value[len-1] == '"') {
13 years, 11 months
ldap/servers
by Noriko Hosoi
ldap/servers/slapd/slapi_counter.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
New commits:
commit 80f3188a3a9789824128f1f6baede66de8c92c37
Author: Noriko Hosoi <nhosoi(a)redhat.com>
Date: Fri May 21 16:34:24 2010 -0700
588867 - entryusn plugin fails on solaris
https://bugzilla.redhat.com/show_bug.cgi?id=588867
Fix description: _sparcv9_AtomicAdd, _sparcv9_AtomicSub, and
_sparcv9_AtomicSet were not correctly declared. It brought
in the implicit function declaration, where the return value
were casted to 32-bit integer and the comparison against the
64-bit unsigned integer failed. The comparison was in the
endless loop and it caused the server hang.
diff --git a/ldap/servers/slapd/slapi_counter.c b/ldap/servers/slapd/slapi_counter.c
index 0f56c8a..c3f1f44 100644
--- a/ldap/servers/slapd/slapi_counter.c
+++ b/ldap/servers/slapd/slapi_counter.c
@@ -42,9 +42,9 @@
#include "slap.h"
#ifdef SOLARIS
-PRUint64 _sparcv9_AtomicSet_il(PRUint64 *address, PRUint64 newval);
-PRUint64 _sparcv9_AtomicAdd_il(PRUint64 *address, PRUint64 val);
-PRUint64 _sparcv9_AtomicSub_il(PRUint64 *address, PRUint64 val);
+PRUint64 _sparcv9_AtomicSet(PRUint64 *address, PRUint64 newval);
+PRUint64 _sparcv9_AtomicAdd(PRUint64 *address, PRUint64 val);
+PRUint64 _sparcv9_AtomicSub(PRUint64 *address, PRUint64 val);
#endif
#ifdef HPUX
13 years, 11 months
Branch 'Directory_Server_8_2_Branch' - ldap/servers
by Noriko Hosoi
ldap/servers/slapd/slapi_counter.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
New commits:
commit 3ae15e27afd96770546b2c81c0daef3837d1d1e2
Author: Noriko Hosoi <nhosoi(a)redhat.com>
Date: Fri May 21 16:34:24 2010 -0700
588867 - entryusn plugin fails on solaris
https://bugzilla.redhat.com/show_bug.cgi?id=588867
Fix description: _sparcv9_AtomicAdd, _sparcv9_AtomicSub, and
_sparcv9_AtomicSet were not correctly declared. It brought
in the implicit function declaration, where the return value
were casted to 32-bit integer and the comparison against the
64-bit unsigned integer failed. The comparison was in the
endless loop and it caused the server hang.
diff --git a/ldap/servers/slapd/slapi_counter.c b/ldap/servers/slapd/slapi_counter.c
index 0f56c8a..c3f1f44 100644
--- a/ldap/servers/slapd/slapi_counter.c
+++ b/ldap/servers/slapd/slapi_counter.c
@@ -42,9 +42,9 @@
#include "slap.h"
#ifdef SOLARIS
-PRUint64 _sparcv9_AtomicSet_il(PRUint64 *address, PRUint64 newval);
-PRUint64 _sparcv9_AtomicAdd_il(PRUint64 *address, PRUint64 val);
-PRUint64 _sparcv9_AtomicSub_il(PRUint64 *address, PRUint64 val);
+PRUint64 _sparcv9_AtomicSet(PRUint64 *address, PRUint64 newval);
+PRUint64 _sparcv9_AtomicAdd(PRUint64 *address, PRUint64 val);
+PRUint64 _sparcv9_AtomicSub(PRUint64 *address, PRUint64 val);
#endif
#ifdef HPUX
13 years, 11 months
ldap/servers
by Richard Allen Megginson
ldap/servers/plugins/replication/repl_session_plugin.c | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
New commits:
commit 3880411360a9f2a47629ef30e2878d89ebe0fc02
Author: Rich Megginson <rmeggins(a)redhat.com>
Date: Fri May 21 11:27:51 2010 -0600
Repl Session API needs to check for NULL api before init
The new repl sesssion API will crash when adding a replication agreement.
It should check to see if there is a repl session api before attempting
to get the init function.
Reviewed by: nhosoi
Branch: HEAD
Platforms tested: RHEL5 x86_64
diff --git a/ldap/servers/plugins/replication/repl_session_plugin.c b/ldap/servers/plugins/replication/repl_session_plugin.c
index 0e5b6ce..0da2b78 100644
--- a/ldap/servers/plugins/replication/repl_session_plugin.c
+++ b/ldap/servers/plugins/replication/repl_session_plugin.c
@@ -72,7 +72,9 @@ repl_session_plugin_call_agmt_init_cb(Repl_Agmt *ra)
LDAPDebug0Args( LDAP_DEBUG_PLUGIN, "--> repl_session_plugin_call_agmt_init_cb -- begin\n");
- initfunc = (repl_session_plugin_agmt_init_cb)_ReplSessionAPI[REPL_SESSION_PLUGIN_AGMT_INIT_CB];
+ if (_ReplSessionAPI) {
+ initfunc = (repl_session_plugin_agmt_init_cb)_ReplSessionAPI[REPL_SESSION_PLUGIN_AGMT_INIT_CB];
+ }
if (initfunc) {
replarea = agmt_get_replarea(ra);
cookie = (*initfunc)(replarea);
13 years, 11 months