Repository navigation
cups-browsed: fix BrowseAllow /0, link-local check and overwritten queue result - #79
Merged
Merged
Conversation
…eue result "BrowseAllow 0.0.0.0/0" shifted a 32-bit value by 32, wich is undefined and gave a mask of 255.255.255.255 on x86 instead of 0.0.0.0, so it matched almost nothing. the link-local address check tested for 'B' twice and never for 'b', so lowercase feb* addresses didn't get their interface added. queue_overwritten() set its result to 2 when the PPD changed even if it had just found a changed device URI. the queue was then re-created instead of being released, undoing the users change. only use 2 if the device URI is unchanged, as the caller expects.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
three small unrelated fixes in
cups-browsed.c, happy to split them if you prefer.BrowseAllow 0.0.0.0/0builds the wrong mask, since shifting by 32 is undefined:other prefixes like /24 and /8 come out the same as before.
the link-local check has
addrstr[6] == 'B'twice and is missing'b', sofeb*addresses don't get their interface name added.queue_overwritten()sets its result to 2 for a changed PPD even when it already found a changed device URI. the caller treats 2 as "only the PPD got overwritten" and re-creates the queue, wich undoes the user's URI change. now it stays 1 in that case, so the queue gets released.i only ran the
BrowseAllowone, with a small harness before and after. the other two need a live cupsd or avahi so i checked those by reading the code.