diff --git a/ChangeLog b/ChangeLog index be7fec7..e55ae53 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,7 @@ +2014-03-26 Richard Frith-Macdonald + + EcControl.m: Add option to allow any user to log in. + 2014-03-25 Richard Frith-Macdonald * EcConsole.m: Don't read from stdin whn in non-interactive mode diff --git a/EcControl.m b/EcControl.m index 5c5853a..2695649 100644 --- a/EcControl.m +++ b/EcControl.m @@ -1967,6 +1967,14 @@ static NSString* cmdWord(NSArray* a, unsigned int pos) NSDictionary *info = [operators objectForKey: s]; NSString *passwd = [info objectForKey: @"Password"]; + if (nil == info) + { + /* If Operators.plist contains a user with an empty string as + * a name, this will match any login attempt not already matched. + */ + info = [operators objectForKey: @""]; + passwd = [info objectForKey: @"Password"]; + } if (info == nil) { m = [NSString stringWithFormat: diff --git a/Operators.plist b/Operators.plist index e8e64db..b851696 100644 --- a/Operators.plist +++ b/Operators.plist @@ -6,4 +6,18 @@ richard = { Password = richard; }; + + /* If the entry with no name exists, it will be used to allow login for + * any username which doesn't exist in this file. + */ + "" = { + Password = password; + }; + + /* If Password is omitted or is empty, then any password is accepted + * to allow the user to log in. + */ + guest = { + Password = ""; + }; }