commit | 19abb1e4e9a86e6a6e5f2b89e3aae7703a2c93ed | [log] [tgz] |
---|---|---|
author | Eric Orth <ericorth@chromium.org> | Tue Apr 13 22:48:04 2021 |
committer | Copybara-Service <copybara-worker@google.com> | Wed Apr 14 19:27:10 2021 |
tree | 687720181fa4e8d633c67da22089538d940f62a5 | |
parent | e71066acbe9b55092279938fe857c274717d5ade [diff] |
Better parsing of nsswitch.conf action brackets Fixing some overzealous DCHECKs that were designed to keep some helper parse methods from being misused without first stripping off '[' and ']', but were getting violated on extra '[' within the action text. E.g., "[SUCCESS=[RETURN]" parses out the action text as "SUCCESS=[RETURN", which then violates the DCHECK looking for '['. Make the DCHECKs more allowing to let stuff like that through and get recognized as invalid/unknown action labels. Also, because it's an easyish case to handle and it lets me keep some DCHECKs in place (e.g. that the first char of an action text still isn't a bracket), let the parser ignore repeated brackets only at the beginning or end of an action block, rather than get treated as an unknown label. Nothing so advanced as matching opening and closing brackets, just merging repeats into being treated as one. E.g., "[[SUCCESS=RETURN]]" or "[[SUCCESS=RETURN]" will parse fine. Unknown if there are any posix implementations that would allow that, but the configured intent is clear enough, so we might as well parse it when not too inconvenient for Chrome. Bug: 1197850 Change-Id: I664f4321d822f5f2fd8e544ef90bad568f5c8eaa Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2822035 Reviewed-by: Dan McArdle <dmcardle@chromium.org> Commit-Queue: Eric Orth <ericorth@chromium.org> Cr-Commit-Position: refs/heads/master@{#872151} GitOrigin-RevId: 72dd9c3fdb793a04e1b13722ebf411a949889ba1
This directory contains the code behind Chrome's networking stack. It is documented here.