Make MacOS installer pane permit dashes

The MacOS installer only permits characters in [0-9A-Za-z] in cellnames.
However, OpenAFS itself will also allow dashes, and they're in use by some
sites.

This trivially amends the installer pane to permit dashes.

FIXES 125211

Reviewed-on: http://gerrit.openafs.org/323
Tested-by: Derrick Brashear <shadow@dementia.org>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
This commit is contained in:
Simon Wilkinson 2009-08-18 22:31:38 +01:00 committed by Derrick Brashear
parent f819561707
commit 57e218ab61

View File

@ -20,7 +20,9 @@ NSString *fileWriteCellAlias=@"/private/tmp/org.OpenAFS.Install.CellAlias";
/* check line of CellAlias provided for Cell name, if matches, returns alias in third parameter */ /* check line of CellAlias provided for Cell name, if matches, returns alias in third parameter */
- (BOOL)_cellInCellAliasLine:(NSString *)line cellName:(NSString *)cell intoAlias:(NSString **)alias - (BOOL)_cellInCellAliasLine:(NSString *)line cellName:(NSString *)cell intoAlias:(NSString **)alias
{ {
NSCharacterSet *alphaNum = [NSCharacterSet alphanumericCharacterSet]; NSMutableCharacterSet *alphaNum = [[NSCharacterSet alphanumericCharacterSet] mutableCopy];
[alphaNum addCharactersInString:@"-"];
NSScanner *cellScanner = [NSScanner scannerWithString:line]; NSScanner *cellScanner = [NSScanner scannerWithString:line];
if (![cellScanner scanUpToString:cell intoString:nil]) if (![cellScanner scanUpToString:cell intoString:nil])
{ {
@ -108,7 +110,8 @@ NSString *fileWriteCellAlias=@"/private/tmp/org.OpenAFS.Install.CellAlias";
} }
/* make sure it's in internet domain style, i.e. alphanum.alphanum */ /* make sure it's in internet domain style, i.e. alphanum.alphanum */
NSCharacterSet *alphaNum = [NSCharacterSet alphanumericCharacterSet]; NSMutableCharacterSet *alphaNum = [[NSCharacterSet alphanumericCharacterSet] mutableCopy];
[alphaNum addCharactersInString:@"-"];
NSScanner *cellScanner = [NSScanner scannerWithString:cellString]; NSScanner *cellScanner = [NSScanner scannerWithString:cellString];
/* first 'word' */ /* first 'word' */
@ -141,7 +144,8 @@ NSString *fileWriteCellAlias=@"/private/tmp/org.OpenAFS.Install.CellAlias";
} }
/* make sure it's alpha-numeric */ /* make sure it's alpha-numeric */
NSCharacterSet *alphaNum = [NSCharacterSet alphanumericCharacterSet]; NSMutableCharacterSet *alphaNum = [[NSCharacterSet alphanumericCharacterSet] mutableCopy];
[alphaNum addCharactersInString:@"-"];
NSScanner *aliasScanner = [NSScanner scannerWithString:aliasString]; NSScanner *aliasScanner = [NSScanner scannerWithString:aliasString];
if (![aliasScanner scanCharactersFromSet:alphaNum intoString:nil]) if (![aliasScanner scanCharactersFromSet:alphaNum intoString:nil])