Merge branch 'mc/cred-helper-ignore-unknown'
Most credential helpers ignored unknown entries in a credential description, but a few died upon seeing them. The latter were taught to ignore them, too * mc/cred-helper-ignore-unknown: osxkeychain: clarify that we ignore unknown lines netrc: ignore unknown lines (do not die) wincred: ignore unknown lines (do not die)
This commit is contained in:
@ -356,7 +356,10 @@ sub read_credential_data_from_stdin {
|
|||||||
next unless m/^([^=]+)=(.+)/;
|
next unless m/^([^=]+)=(.+)/;
|
||||||
|
|
||||||
my ($token, $value) = ($1, $2);
|
my ($token, $value) = ($1, $2);
|
||||||
die "Unknown search token $token" unless exists $q{$token};
|
|
||||||
|
# skip any unknown tokens
|
||||||
|
next unless exists $q{$token};
|
||||||
|
|
||||||
$q{$token} = $value;
|
$q{$token} = $value;
|
||||||
log_debug("We were given search token $token and value $value");
|
log_debug("We were given search token $token and value $value");
|
||||||
}
|
}
|
||||||
|
@ -159,6 +159,11 @@ static void read_credential(void)
|
|||||||
username = xstrdup(v);
|
username = xstrdup(v);
|
||||||
else if (!strcmp(buf, "password"))
|
else if (!strcmp(buf, "password"))
|
||||||
password = xstrdup(v);
|
password = xstrdup(v);
|
||||||
|
/*
|
||||||
|
* Ignore other lines; we don't know what they mean, but
|
||||||
|
* this future-proofs us when later versions of git do
|
||||||
|
* learn new lines, and the helpers are updated to match.
|
||||||
|
*/
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -278,8 +278,11 @@ static void read_credential(void)
|
|||||||
wusername = utf8_to_utf16_dup(v);
|
wusername = utf8_to_utf16_dup(v);
|
||||||
} else if (!strcmp(buf, "password"))
|
} else if (!strcmp(buf, "password"))
|
||||||
password = utf8_to_utf16_dup(v);
|
password = utf8_to_utf16_dup(v);
|
||||||
else
|
/*
|
||||||
die("unrecognized input");
|
* Ignore other lines; we don't know what they mean, but
|
||||||
|
* this future-proofs us when later versions of git do
|
||||||
|
* learn new lines, and the helpers are updated to match.
|
||||||
|
*/
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user