mirror of
https://git.openafs.org/openafs.git
synced 2025-01-18 23:10:58 +00:00
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:
parent
f819561707
commit
57e218ab61
@ -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 */
|
||||
- (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];
|
||||
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 */
|
||||
NSCharacterSet *alphaNum = [NSCharacterSet alphanumericCharacterSet];
|
||||
NSMutableCharacterSet *alphaNum = [[NSCharacterSet alphanumericCharacterSet] mutableCopy];
|
||||
[alphaNum addCharactersInString:@"-"];
|
||||
NSScanner *cellScanner = [NSScanner scannerWithString:cellString];
|
||||
|
||||
/* first 'word' */
|
||||
@ -141,7 +144,8 @@ NSString *fileWriteCellAlias=@"/private/tmp/org.OpenAFS.Install.CellAlias";
|
||||
}
|
||||
|
||||
/* make sure it's alpha-numeric */
|
||||
NSCharacterSet *alphaNum = [NSCharacterSet alphanumericCharacterSet];
|
||||
NSMutableCharacterSet *alphaNum = [[NSCharacterSet alphanumericCharacterSet] mutableCopy];
|
||||
[alphaNum addCharactersInString:@"-"];
|
||||
NSScanner *aliasScanner = [NSScanner scannerWithString:aliasString];
|
||||
|
||||
if (![aliasScanner scanCharactersFromSet:alphaNum intoString:nil])
|
||||
|
Loading…
Reference in New Issue
Block a user