View Issue Details

IDProjectCategoryView StatusLast Update
0002121SOGoBackend Calendarpublic2012-11-29 14:27
Reporterlemeurt Assigned To 
PrioritynormalSeveritymajorReproducibilityalways
Status closedResolutionfixed 
Product Version2.0.2a 
Summary0002121: [PATCH-PROPOSED] Events imported from Funambol are always using the Public Classification
Description

When an even is imported from the funambol-sogo-connector, the "_quick" table isn't filled with the correct confidentiality level (the Classification in SOGo).

Even though the ical data are using the correct PRIVTATE CLASS, the fact that the _quick table isn't filled with the correct c_classification attribute may result in a disclosure of events to users subscribed to the calendar with only the PUBLIC-view righ.
This is why I mark this ticket as severity major.

Additional Information
  • create an event in outlook and click the Private icon
  • synchronize using Funambol sync client
  • the event is imported into SOGo and will display PRIVATE as tjhe confidentiality level, but will not display the "locker" in the calendar view. If the agenda is shared with another ueser having only the view-public-events right, he will be able to see all the imported PRIVATE events.
TagsNo tags attached.

Activities

lemeurt

lemeurt

2012-11-23 22:01

reporter   ~0004971

The problem is with teh getClassification method in the SOGoUtilies class. It assumes that the String representation of the Classification property is the Name of the CLASS from the event (PRIVATE, CONFIDENTIAL, ...). However it is an integer specific to Funambol. I've found this by troubleshooting the bug and analysing code from other synch clients.
The correspondances between the ics CLASS, SOGo internal code for classification and Funambo internal code for Sensitivity is given in the patch as a comment that can be removed if you want.

2012-11-23 22:02

 

classification-fix.diff (1,542 bytes)   
diff --git a/src/java/ca/inverse/sogo/engine/source/SOGoUtilities.java b/src/java/ca/inverse/sogo/engine/source/SOGoUtilities.java
index c672e35..bd4001a 100644
--- a/src/java/ca/inverse/sogo/engine/source/SOGoUtilities.java
+++ b/src/java/ca/inverse/sogo/engine/source/SOGoUtilities.java
@@ -52,6 +52,17 @@ public class SOGoUtilities {
 	// Constants
 	static final int RX = 1;
 	static final int TX = 2;
+	// Classification correspondances
+	// iCal-vCard		; Funambol	; SOGo
+	// PUBLIC		; 0		; 0
+	// PRIVATE		; 2		; 1
+	// CONFIDENTIAL		; 3		; 2
+	// X-PERSONAL		; 1		; N/A
+	// Funambol internal codes for sensitivity (Classification in SOGo)
+	public static final Short SENSITIVITY_PRIVATE      = 2; // OlSensitivity.olPrivate
+	public static final Short SENSITIVITY_CONFIDENTIAL = 3; // OlSensitivity.olConfidential
+	public static final Short SOGO_SENSITIVITY_PRIVATE       = 1;
+	public static final Short SOGO_SENSITIVITY_CONFIDENTIAL  = 2;
 	
 	/**
 	
@@ -1125,6 +1136,7 @@ public class SOGoUtilities {
 		
 		classification = 0;
 		
+		/**
 		if (cc.getAccessClass() != null) {
 			String ac;
 			
@@ -1136,6 +1148,16 @@ public class SOGoUtilities {
 				classification = 2;
 		}
 		
+		*/
+
+		int ac;
+		if (cc.getAccessClass() != null) {
+			ac = Integer.parseInt(cc.getAccessClass().getPropertyValueAsString());
+			if (ac == SENSITIVITY_PRIVATE)
+				classification = SOGO_SENSITIVITY_PRIVATE;
+			if (ac == SENSITIVITY_CONFIDENTIAL)
+				classification = SOGO_SENSITIVITY_CONFIDENTIAL;
+		}
 		return classification;
 	}
 	
classification-fix.diff (1,542 bytes)   
lemeurt

lemeurt

2012-11-23 22:04

reporter   ~0004972

Once reviewed I will clean up the patch.
The getClassification method is also called from the Contact part of the code, though I don't see any support for Classification in the SOGo Web user interface for Contacts.

ludovic

ludovic

2012-11-23 23:01

administrator   ~0004974

This looks good, cleanup the patch and resend it.

2012-11-24 16:09

 

classification-fix2.diff (1,657 bytes)   
diff --git a/src/java/ca/inverse/sogo/engine/source/SOGoUtilities.java b/src/java/ca/inverse/sogo/engine/source/SOGoUtilities.java
index c672e35..addaac0 100644
--- a/src/java/ca/inverse/sogo/engine/source/SOGoUtilities.java
+++ b/src/java/ca/inverse/sogo/engine/source/SOGoUtilities.java
@@ -52,6 +52,16 @@ public class SOGoUtilities {
 	// Constants
 	static final int RX = 1;
 	static final int TX = 2;
+	// Classification codes mapping
+	// iCal-vCard		; Funambol	; SOGo
+	// PUBLIC		; 0		; 0
+	// X-PERSONAL		; 1		; N/A
+	// PRIVATE		; 2		; 1
+	// CONFIDENTIAL		; 3		; 2
+	public static final Short SENSITIVITY_PRIVATE      = 2; // OlSensitivity.olPrivate
+	public static final Short SENSITIVITY_CONFIDENTIAL = 3; // OlSensitivity.olConfidential
+	public static final Short SOGO_SENSITIVITY_PRIVATE       = 1;
+	public static final Short SOGO_SENSITIVITY_CONFIDENTIAL  = 2;
 	
 	/**
 	
@@ -1121,21 +1131,16 @@ public class SOGoUtilities {
 	 * @return
 	 */
 	public static int getClassification(CalendarContent cc) {
-		int classification;
+		int classification, ac;
 		
 		classification = 0;
-		
 		if (cc.getAccessClass() != null) {
-			String ac;
-			
-			ac = cc.getAccessClass().getPropertyValueAsString();
-			
-			if ("PRIVATE".equalsIgnoreCase(ac))
-				classification = 1;
-			else if ("CONFIDENTIAL".equalsIgnoreCase(ac))
-				classification = 2;
+			ac = Integer.parseInt(cc.getAccessClass().getPropertyValueAsString());
+			if (ac == SENSITIVITY_PRIVATE)
+				classification = SOGO_SENSITIVITY_PRIVATE;
+			if (ac == SENSITIVITY_CONFIDENTIAL)
+				classification = SOGO_SENSITIVITY_CONFIDENTIAL;
 		}
-		
 		return classification;
 	}
 	
classification-fix2.diff (1,657 bytes)   
lemeurt

lemeurt

2012-11-24 16:11

reporter   ~0004976

Here is the new patch.
I've let the comments describing the mapping of classifications between vCard/SOGo/Funambol as a reference for future use.

lemeurt

lemeurt

2012-11-29 08:32

reporter   ~0004999

@ludovic,

Is the patch okay, or do you want me to work on it again ?

Thanks in advance,
Thibault

ludovic

ludovic

2012-11-29 14:27

administrator   ~0005000

Patch pushed (https://github.com/inverse-inc/funambol-sogo-connector/commit/d3139cb46699538b171609b918c0a8323916b2cf), thanks for your good work!

Issue History

Date Modified Username Field Change
2012-11-23 21:56 lemeurt New Issue
2012-11-23 22:01 lemeurt Note Added: 0004971
2012-11-23 22:02 lemeurt File Added: classification-fix.diff
2012-11-23 22:04 lemeurt Note Added: 0004972
2012-11-23 23:01 ludovic Note Added: 0004974
2012-11-24 16:09 lemeurt File Added: classification-fix2.diff
2012-11-24 16:11 lemeurt Note Added: 0004976
2012-11-29 08:32 lemeurt Note Added: 0004999
2012-11-29 14:27 ludovic Note Added: 0005000
2012-11-29 14:27 ludovic Status new => closed
2012-11-29 14:27 ludovic Resolution open => fixed