View Issue Details
ID | Project | Category | View Status | Date Submitted | Last Update |
---|---|---|---|---|---|
0002121 | SOGo | Backend Calendar | public | 2012-11-23 21:56 | 2012-11-29 14:27 |
Reporter | lemeurt | Assigned To | |||
Priority | normal | Severity | major | Reproducibility | always |
Status | closed | Resolution | fixed | ||
Product Version | 2.0.2a | ||||
Summary | 0002121: [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. | ||||
Additional Information |
| ||||
Tags | No tags attached. | ||||
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. |
|
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; } |
Once reviewed I will clean up the patch. |
|
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; } |
Here is the new patch. |
|
Is the patch okay, or do you want me to work on it again ? Thanks in advance, |
|
Patch pushed (https://github.com/inverse-inc/funambol-sogo-connector/commit/d3139cb46699538b171609b918c0a8323916b2cf), thanks for your good work! |
|
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 |