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/Pearl vendored

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;