summaryrefslogtreecommitdiffstats
path: root/ldap
diff options
context:
space:
mode:
authorRich Megginson <rmeggins@redhat.com>2006-11-06 20:39:01 +0000
committerRich Megginson <rmeggins@redhat.com>2006-11-06 20:39:01 +0000
commit379091dfc02ea735b75764dbe50cfe17019f89be (patch)
tree8edac7af48c0533bbbcd2ad80ddc7e88a8f757b7 /ldap
parent6f4bf3ed01dd5b7fba4e603b0c3f495c766d64ba (diff)
downloadds-379091dfc02ea735b75764dbe50cfe17019f89be.tar.gz
ds-379091dfc02ea735b75764dbe50cfe17019f89be.tar.xz
ds-379091dfc02ea735b75764dbe50cfe17019f89be.zip
Bug(s) fixed: 214243
Bug Description: Advanced install loops at install sample entries Reviewed by: nhosoi (Thanks!) Fix Description: There were a couple of problems. The first problem is that askPopulate is not a YesNo dialog, it is just a general Input dialog. The second problem is that askPopulateSetup sets the input buffer size greater than the static buffer used to hold the input in the Dialog class, which is defined as char _buf[MED_BUF]. So the solution is to set the InputLen to be MED_BUF-1, which allows for the trailing null as well. Platforms tested: FC5 Flag Day: no Doc impact: no
Diffstat (limited to 'ldap')
-rw-r--r--ldap/cm/newinst/ux-dialog.cc6
-rw-r--r--ldap/cm/newinst/ux-dialog.h2
2 files changed, 5 insertions, 3 deletions
diff --git a/ldap/cm/newinst/ux-dialog.cc b/ldap/cm/newinst/ux-dialog.cc
index 4f4c010d..7de31488 100644
--- a/ldap/cm/newinst/ux-dialog.cc
+++ b/ldap/cm/newinst/ux-dialog.cc
@@ -1034,7 +1034,7 @@ askSampleNext(Dialog *me)
return DIALOG_NEXT;
}
-DialogYesNo askPopulate(
+DialogInput askPopulate(
"You may wish to populate your new directory instance with some data.\n"
"You may already have a file in LDIF format to use or some suggested\n"
"entries can be added. If you want to import entries from an LDIF\n"
@@ -1074,7 +1074,9 @@ askPopulateSetup(Dialog *me)
}
dialogSetup(me, SLAPD_KEY_INSTALL_LDIF_FILE, "none");
- me->setInputLen(1024); // it seems to get reset somewhere . . .
+ // max input buffer size is sizeof(Dialog::_buf)-1
+ // Dialog::_buf is defined as char[MED_BUF]
+ me->setInputLen(MED_BUF-1); // it seems to get reset somewhere . . .
long setupval = 0;
if (me->getUserData(SETUP_DEFAULTS, setupval) == SETUP_ONLY ||
diff --git a/ldap/cm/newinst/ux-dialog.h b/ldap/cm/newinst/ux-dialog.h
index 26ef8302..5b892480 100644
--- a/ldap/cm/newinst/ux-dialog.h
+++ b/ldap/cm/newinst/ux-dialog.h
@@ -54,7 +54,7 @@ extern DialogInput askSlapdSuffix;
extern DialogInput askSlapdRootDN;
extern DialogYesNo askReplication;
extern DialogYesNo askSample;
-extern DialogYesNo askPopulate;
+extern DialogInput askPopulate;
extern DialogInput askOrgSize;
extern DialogYesNo askCIR;
extern DialogInput askCIRHost;