Bug 1814 - kpilot vcal conduit corrupts vcs file
kpilot vcal conduit corrupts vcs file
Status: CLOSED NEXTRELEASE
Product: Red Hat Linux
Classification: Retired
Component: kpilot (Show other bugs)
6.0
i386 Linux
medium Severity medium
: ---
: ---
Assigned To: Preston Brown
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 1999-03-26 09:10 EST by andrewm
Modified: 2008-05-01 11:37 EDT (History)
0 users

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 1999-09-23 11:37:50 EDT
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)

  None (edit)
Description andrewm 1999-03-26 09:10:30 EST
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 11:37:59 EDT
fixed for the next release (with kpilot-3.1b9).

Note You need to log in before you can comment on or make changes to this bug.