Skip to content

Commit 979f46b

Browse files
committed
Corrections after testing. Password can include spaces. Remove username right padding, as trailing spaces are ignored anyway inside the engine.
1 parent ba58842 commit 979f46b

File tree

1 file changed

+4
-12
lines changed

1 file changed

+4
-12
lines changed

src/jrd/replication/Config.cpp

Lines changed: 4 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -133,20 +133,11 @@ namespace
133133
if (!file)
134134
configError("missing or inaccessible file", key, filename.c_str());
135135

136-
// skip first empty lines
137-
do
138-
{
139-
if (feof(file))
140-
break;
141-
142-
if (!temp.LoadFromFile(file))
143-
break;
144-
145-
temp.alltrim(" \t\r");
146-
} while (temp.isEmpty());
136+
if (temp.LoadFromFile(file))
137+
temp.alltrim("\r");
147138

148139
if (temp.isEmpty())
149-
configError("empty file", key, filename.c_str());
140+
configError("first empty line of file", key, filename.c_str());
150141
}
151142

152143
output = temp.c_str();
@@ -167,6 +158,7 @@ namespace
167158
if (output.username.hasData())
168159
configError("multiple values", output.database, "username");
169160
parseExternalValue(key, value, output.username);
161+
output.username.rtrim(" ");
170162
}
171163
else if (key.find("password") == 0)
172164
{

0 commit comments

Comments
 (0)