2
0

Fix .mpw parsing.

This commit is contained in:
Maarten Billemont 2014-05-06 17:21:12 -04:00
parent 7e96496614
commit 09afe61a4c
5 changed files with 14 additions and 15 deletions

2
External/LoveLyndir vendored

@ -1 +1 @@
Subproject commit 97eafd9b59f84bd9e3fc3cb4313df8b3c034e766
Subproject commit adab69df05840d94a3f2f883251869d6cb352b0e

2
External/Pearl vendored

@ -1 +1 @@
Subproject commit 9e41cebeba085fce2bbae2592d52bbfd740f9ffb
Subproject commit 081c2dec20b3638694a5ad20cd2fddccdb298447

View File

@ -0,0 +1 @@
../Resources/Data/ciphers.plist

View File

@ -132,13 +132,11 @@ int main(int argc, char *const argv[]) {
char *line = NULL;
size_t linecap = 0;
ssize_t linelen;
while ((linelen = getline(&line, &linecap, mpwConfig)) > 0) {
char *configUserName = strsep(&line, "\t: ");
if (configUserName == userName) {
while (line[0] && strlen(masterPassword = strsep(&line, "\t: ")) == 0);
while ((linelen = getline(&line, &linecap, mpwConfig)) > 0)
if (strcmp(strsep(&line, ":"), userName) == 0) {
masterPassword = line;
break;
}
}
if (!masterPassword) {
fprintf (stderr, "Missing master password for user: %s\n", userName);
return 1;