Bug 1814

Summary: kpilot vcal conduit corrupts vcs file
Product: [Retired] Red Hat Linux Reporter: andrewm
Component: kpilotAssignee: Preston Brown <pbrown>
Status: CLOSED NEXTRELEASE QA Contact:
Severity: medium Docs Contact:
Priority: medium    
Version: 6.0   
Target Milestone: ---   
Target Release: ---   
Hardware: i386   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 1999-09-23 15:37:50 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description andrewm 1999-03-26 14:10:30 UTC
I recently build kpilot 3.1b8 and ran into a snag with the
conduit with
korganizer.  After syncing, korganizer would segfault when
trying to
read the updated .vcs file. I found that the conduit has
split the code
"NEEDS ACTION" into two lines.  A bit of snooping found that
the versit
code in korganizer had a patch for this problem, but the
patch was not
included in kpilot. After applying the patch, kpilot seems
to work
wonderfully.

Martin

--- kpilot-3.1/conduits/vcalconduit/versit/vcc.y.orig	Sat
Jan  9 14:19:30 1999
+++ kpilot-3.1/conduits/vcalconduit/versit/vcc.y	Tue Jan 19
14:10:31 1999
@@ -660,7 +660,10 @@
     lexSkipWhite();
     lexClearToken();
     c = lexLookahead();
-    while (c != EOF && !strchr("\t\n ;:=",c)) {
+    // some "words" have a space in them, like "NEEDS
ACTION".
+    // this may be an oversight of the spec, but it is true
nevertheless.
+    //    while (c != EOF && !strchr("\t\n ;:=",c)) {
+    while (c != EOF && !strchr("\n;:=",c)) {
 	lexAppendc(c);
 	lexSkipLookahead();
 	c = lexLookahead();
@@ -1102,9 +1105,9 @@
 		case '=':
 		    DBG_(("db: EQ\n"));
 		    return EQ;
-		/* ignore whitespace in this mode */
-		case '\t':
-		case ' ': continue;
+		/* ignore tabs/newlines in this mode.  We can't ignore
+		 * spaces, because values like NEEDS ACTION have a space.
*/
+	        case '\t': continue;
 		case '\n': {
 		    ++mime_lineNum;
 		    continue;
@@ -1113,7 +1116,7 @@
 		    break;
 		default: {
 		    lexPushLookaheadc(c);
-		    if (isalpha(c)) {
+		    if (isalpha(c) || c == " ") {
 			char *t = lexGetWord();
 			yylval.str = t;
 			if (!strcasecmp(t, "begin")) {
--- kpilot-3.1/conduits/vcalconduit/versit/Makefile.am.orig
Thu Mar 25 10:59:49 1999
+++ kpilot-3.1/conduits/vcalconduit/versit/Makefile.am	Thu
Mar 25 11:01:05 1999
@@ -28,6 +28,9 @@
 # Which sources should be compiled for kpilot
 libversit_a_SOURCES = vcc.c vobject.c

+$(srcdir)/vcc.c: vcc.y
+	bison $(srcdir)/vcc.y -o $(srcdir)/vcc.c
+
 noinst_HEADERS = port.h vcc.h vobject.h

 # just to make sure, automake makes them

Comment 1 Preston Brown 1999-09-23 15:37:59 UTC
fixed for the next release (with kpilot-3.1b9).