[Fedora-directory-commits] ldapserver/ldap/cm/newinst ux-dialog.cc, 1.9, 1.10 ux-dialog.h, 1.4, 1.5

Richard Allen Megginson (rmeggins) fedora-directory-commits at redhat.com
Mon Nov 6 20:39:04 UTC 2006


Author: rmeggins

Update of /cvs/dirsec/ldapserver/ldap/cm/newinst
In directory cvs-int.fedora.redhat.com:/tmp/cvs-serv14326

Modified Files:
	ux-dialog.cc ux-dialog.h 
Log Message:
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 



Index: ux-dialog.cc
===================================================================
RCS file: /cvs/dirsec/ldapserver/ldap/cm/newinst/ux-dialog.cc,v
retrieving revision 1.9
retrieving revision 1.10
diff -u -r1.9 -r1.10
--- ux-dialog.cc	7 Apr 2006 01:33:37 -0000	1.9
+++ ux-dialog.cc	6 Nov 2006 20:39:01 -0000	1.10
@@ -1034,7 +1034,7 @@
 	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 @@
 	}
 
 	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 ||


Index: ux-dialog.h
===================================================================
RCS file: /cvs/dirsec/ldapserver/ldap/cm/newinst/ux-dialog.h,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -r1.4 -r1.5
--- ux-dialog.h	19 Apr 2005 22:07:21 -0000	1.4
+++ ux-dialog.h	6 Nov 2006 20:39:01 -0000	1.5
@@ -54,7 +54,7 @@
 extern DialogInput askSlapdRootDN;
 extern DialogYesNo askReplication;
 extern DialogYesNo askSample;
-extern DialogYesNo askPopulate;
+extern DialogInput askPopulate;
 extern DialogInput askOrgSize;
 extern DialogYesNo askCIR;
 extern DialogInput askCIRHost;




More information about the Fedora-directory-commits mailing list