From 7d65d808f6ff80a2a5bac2a8c55ad218ba44aaa6 Mon Sep 17 00:00:00 2001 From: Jean Raby Date: Wed, 20 Feb 2013 10:50:58 -0500 Subject: [PATCH] Strip newline characters from user password files Makes it easier to create those files with a regular editor. --- OpenChange/MAPIStoreUserContext.m | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/OpenChange/MAPIStoreUserContext.m b/OpenChange/MAPIStoreUserContext.m index 4f398fe26..7432f91fd 100644 --- a/OpenChange/MAPIStoreUserContext.m +++ b/OpenChange/MAPIStoreUserContext.m @@ -20,6 +20,7 @@ * Boston, MA 02111-1307, USA. */ +#import #import #import #import @@ -107,15 +108,17 @@ static NSMapTable *contextsTable = nil; password = nil; path = [NSString stringWithFormat: SAMBA_PRIVATE_DIR - @"/mapistore/%@/password", newUsername]; + @"/mapistore/%@/password", newUsername]; content = [NSData dataWithContentsOfFile: path]; if (content) { password = [[NSString alloc] initWithData: content - encoding: NSUTF8StringEncoding]; + encoding: NSUTF8StringEncoding]; [password autorelease]; + password = [password stringByTrimmingCharactersInSet: + [NSCharacterSet characterSetWithCharactersInString: @"\r\n"]]; } return password;