From 5af57456d3669d048c16831bd3a5afdb7ca9b2e2 Mon Sep 17 00:00:00 2001 From: stuconnolly Date: Tue, 27 Apr 2010 09:16:49 +0000 Subject: Correctly quote database name when GRANT'ing and REVOK'ing privileges. Fixes issue #647. --- Source/SPUserManager.m | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'Source') diff --git a/Source/SPUserManager.m b/Source/SPUserManager.m index cad74193..26986d0b 100644 --- a/Source/SPUserManager.m +++ b/Source/SPUserManager.m @@ -1025,7 +1025,7 @@ { NSString *grantStatement = [NSString stringWithFormat:@"GRANT %@ ON %@.* TO %@@%@", [[grantPrivileges componentsJoinedByCommas] uppercaseString], - dbName, + [dbName backtickQuotedString], [[schemaPriv valueForKeyPath:@"user.parent.user"] tickQuotedString], [[schemaPriv valueForKeyPath:@"user.host"] tickQuotedString]]; DLog(@"%@", grantStatement); @@ -1038,7 +1038,7 @@ { NSString *revokeStatement = [NSString stringWithFormat:@"REVOKE %@ ON %@.* FROM %@@%@", [[revokePrivileges componentsJoinedByCommas] uppercaseString], - dbName, + [dbName backtickQuotedString], [[schemaPriv valueForKeyPath:@"user.parent.user"] tickQuotedString], [[schemaPriv valueForKeyPath:@"user.host"] tickQuotedString]]; DLog(@"%@", revokeStatement); -- cgit v1.2.3