From 06419a4edfcaf4306f85bec81a7460058cff923b Mon Sep 17 00:00:00 2001 From: Ludovic Marcotte Date: Thu, 16 Jun 2011 15:35:13 +0000 Subject: [PATCH 1/4] Fix for bug #1035 Monotone-Parent: 869378c97b2bf3386ab9d61f8e107135f0dc0529 Monotone-Revision: 698461b7043455867e02dfbd291566ea991bf8a5 Monotone-Author: ludovic@Sophos.ca Monotone-Date: 2011-06-16T15:35:13 Monotone-Branch: ca.inverse.sogo --- SoObjects/SOGo/GNUmakefile.preamble | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/SoObjects/SOGo/GNUmakefile.preamble b/SoObjects/SOGo/GNUmakefile.preamble index 7823443df..d35e9d3af 100644 --- a/SoObjects/SOGo/GNUmakefile.preamble +++ b/SoObjects/SOGo/GNUmakefile.preamble @@ -21,10 +21,16 @@ SOGo_LIBRARIES_DEPEND_UPON += \ -lNGCards \ -lNGMime \ -lNGStreams -lNGExtensions -lEOControl \ - -lXmlRpc -lDOM -lSaxObjC -lcrypt \ + -lXmlRpc -lDOM -lSaxObjC \ -lNGLdap -lSBJson \ -lGDLContentStore +ifeq ($(findstring openbsd, $(GNUSTEP_HOST_OS)), openbsd) +SOGo_LIBRARIES_DEPEND_UPON += -lcrypto +else +SOGo_LIBRARIES_DEPEND_UPON += -lcrypt +endif + ADDITIONAL_TOOL_LIBS += \ -L$(GNUSTEP_OBJ_DIR)/ \ -lSOGo \ From a3ede0e519fc4ebaa25da9739af4089507bb94a6 Mon Sep 17 00:00:00 2001 From: Ludovic Marcotte Date: Thu, 16 Jun 2011 15:37:51 +0000 Subject: [PATCH 2/4] Fix for bug #1034 Monotone-Parent: 698461b7043455867e02dfbd291566ea991bf8a5 Monotone-Revision: 745ebe569ac5b050683e557f5e5fb7c1699ca7f5 Monotone-Author: ludovic@Sophos.ca Monotone-Date: 2011-06-16T15:37:51 Monotone-Branch: ca.inverse.sogo --- SoObjects/SOGo/GNUmakefile.preamble | 2 +- configure | 10 ++++++++++ 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/SoObjects/SOGo/GNUmakefile.preamble b/SoObjects/SOGo/GNUmakefile.preamble index d35e9d3af..ee71f35ab 100644 --- a/SoObjects/SOGo/GNUmakefile.preamble +++ b/SoObjects/SOGo/GNUmakefile.preamble @@ -5,7 +5,7 @@ SOGo_INCLUDE_DIRS += -I.. -I../../UI \ -DSOGO_MINOR_VERSION="@\"$(MINOR_VERSION)\"" \ -DSOGO_SUBMINOR_VERSION="@\"$(SUBMINOR_VERSION)\"" -HOSTNAME = $(shell hostname -f) +HOSTNAME ?= $(shell hostname -f) BUILD_DATE = $(shell echo $$USER@$(HOSTNAME); date +"%Y%m%d%H%M") ADDITIONAL_CPPFLAGS += \ diff --git a/configure b/configure index 73ecdbb4e..d2b2317ee 100755 --- a/configure +++ b/configure @@ -37,6 +37,15 @@ else MAKE=gmake fi +# hostname(1) on some systems may not know the -f parameter +hostname -f 2>/dev/null >/dev/null +if [ $? -eq 0 ];then + HOSTNAME=`hostname -f` +else + HOSTNAME=`hostname` +fi + + NGSTREAMS_DIR="./sope-core/NGStreams" LINK_SYSLIBDIRS="-L/usr/local/pgsql/lib -L/usr/local/lib -L/usr/lib" @@ -251,6 +260,7 @@ genConfigMake() { cfgwrite "CGS_LIBDIR_NAME:=lib" fi + cfgwrite "HOSTNAME=${HOSTNAME}" cfgwrite "SOGO_SYSLIBDIR=\${GNUSTEP_LIBRARIES}" cfgwrite "SOGO_LIBDIR=\${GNUSTEP_LIBRARY}/SOGo" cfgwrite "SOGO_TEMPLATESDIR=\${SOGO_LIBDIR}/Templates" From 8145059809c57df5c0cc1af7d92027f381454401 Mon Sep 17 00:00:00 2001 From: Ludovic Marcotte Date: Thu, 16 Jun 2011 15:47:28 +0000 Subject: [PATCH 3/4] Fixed the logrotate script to not restart SOGo but rather do a copy/truncate Monotone-Parent: 745ebe569ac5b050683e557f5e5fb7c1699ca7f5 Monotone-Revision: 9b6ca5cb2b17f229443223ae6bb703c37ca1f0c3 Monotone-Author: ludovic@Sophos.ca Monotone-Date: 2011-06-16T15:47:28 Monotone-Branch: ca.inverse.sogo --- Scripts/logrotate | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/Scripts/logrotate b/Scripts/logrotate index f07979381..9f76e9ddd 100644 --- a/Scripts/logrotate +++ b/Scripts/logrotate @@ -5,9 +5,5 @@ compress delaycompress notifempty - create 640 sogo sogo - sharedscripts - postrotate - /etc/init.d/sogod restart > /dev/null - endscript + copytruncate } From 310c6affbf2ca85ad725cfd18d8d4fb6c5474795 Mon Sep 17 00:00:00 2001 From: Ludovic Marcotte Date: Thu, 16 Jun 2011 17:04:00 +0000 Subject: [PATCH 4/4] See ChangeLog Monotone-Parent: 9b6ca5cb2b17f229443223ae6bb703c37ca1f0c3 Monotone-Revision: 95fd526cbec8bccb226bbd63d3442c7d12061aa3 Monotone-Author: ludovic@Sophos.ca Monotone-Date: 2011-06-16T17:04:00 Monotone-Branch: ca.inverse.sogo --- ChangeLog | 6 ++++ UI/Contacts/UIxContactFolderActions.m | 50 ++++++++++++++++++++++++--- 2 files changed, 51 insertions(+), 5 deletions(-) diff --git a/ChangeLog b/ChangeLog index 4ac74c0c7..0f546a190 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,9 @@ +2011-06-16 Ludovic Marcotte + + * UI/Contacts/UIxContactFolderActions.m (importLdifData:): + Fixed folded lines import and base64 encoded values. Patch + from bug #1251 + 2011-06-16 Wolfgang Sourdeau * Tools/SOGoToolRenameUser.m: new sogo-tool module that updates diff --git a/UI/Contacts/UIxContactFolderActions.m b/UI/Contacts/UIxContactFolderActions.m index cbac6a365..2dd503615 100644 --- a/UI/Contacts/UIxContactFolderActions.m +++ b/UI/Contacts/UIxContactFolderActions.m @@ -30,6 +30,7 @@ #import #import #import +#import #import #import @@ -154,30 +155,69 @@ for (i = 0; i < count; i++) { SOGoContactLDIFEntry *ldifEntry; - entry = [NSMutableDictionary dictionary]; + NSEnumerator *keyEnumerator; + NSMutableDictionary *encodedEntry; + encodedEntry = [NSMutableDictionary dictionary]; lines = [[ldifContacts objectAtIndex: i] componentsSeparatedByString: @"\n"]; + key = NULL; linesCount = [lines count]; for (j = 0; j < linesCount; j++) { - components = [[lines objectAtIndex: j] - componentsSeparatedByString: @": "]; + NSString *line; + line = [lines objectAtIndex: j]; + + /* skip embedded comment lines */ + if ([line hasPrefix: @"#"]) + { + key = NULL; + continue; + } + + /* handle continuation lines */ + if ([line hasPrefix: @" "]) + { + if (key != NULL) + { + value = [[encodedEntry valueForKey: key] + stringByAppendingString: [line substringFromIndex: 1]]; + [encodedEntry setValue: value forKey: key]; + } + continue; + } + + components = [line componentsSeparatedByString: @": "]; if ([components count] == 2) { - key = [components objectAtIndex: 0]; + key = [[components objectAtIndex: 0] lowercaseString]; value = [components objectAtIndex: 1]; if ([key length] == 0) key = @"dn"; - [entry setObject: value forKey: [key lowercaseString]]; + [encodedEntry setValue: value forKey: key]; } else { break; } } + + /* decode Base64-encoded attributes */ + entry = [NSMutableDictionary dictionary]; + keyEnumerator = [encodedEntry keyEnumerator]; + while ((key = [keyEnumerator nextObject])) + { + value = [encodedEntry valueForKey: key]; + if ([key hasSuffix: @":"]) + { + key = [key substringToIndex: [key length] - 1]; + value = [value stringByDecodingBase64]; + } + [entry setValue: value forKey: key]; + } + uid = [folder globallyUniqueObjectId]; ldifEntry = [SOGoContactLDIFEntry contactEntryWithName: uid withLDIFEntry: entry