From 331b61d9b2b655ec2d239effdd63c8388937ef1b Mon Sep 17 00:00:00 2001 From: Wolfgang Sourdeau Date: Mon, 22 Oct 2012 15:17:47 -0400 Subject: [PATCH] escape the username part of the tablename in order to obtain an acceptable SQL identifier --- OpenChange/MAPIStoreUserContext.m | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/OpenChange/MAPIStoreUserContext.m b/OpenChange/MAPIStoreUserContext.m index afcca27ea..4f398fe26 100644 --- a/OpenChange/MAPIStoreUserContext.m +++ b/OpenChange/MAPIStoreUserContext.m @@ -37,6 +37,7 @@ #import #import #import +#import #import #import @@ -291,7 +292,8 @@ static NSMapTable *contextsTable = nil; { /* If "OCSFolderInfoURL" is properly configured, we must have 5 parts in this url. */ - ocFSTableName = [NSString stringWithFormat: @"socfs_%@", username]; + ocFSTableName = [NSString stringWithFormat: @"socfs_%@", + [username asCSSIdentifier]]; [parts replaceObjectAtIndex: 4 withObject: ocFSTableName]; folderTableURL = [NSURL URLWithString: [parts componentsJoinedByString: @"/"]];