Skip to content

Fix: Satisfy all with multiple Require directives (Issue #1304)#1576

Closed
abubakarsabir924-cell wants to merge 2 commits into
OpenPrinting:masterfrom
abubakarsabir924-cell:fix/satisfy-all-multiple-require
Closed

Fix: Satisfy all with multiple Require directives (Issue #1304)#1576
abubakarsabir924-cell wants to merge 2 commits into
OpenPrinting:masterfrom
abubakarsabir924-cell:fix/satisfy-all-multiple-require

Conversation

@abubakarsabir924-cell
Copy link
Copy Markdown
Contributor

Problem

When using Satisfy all with multiple Require directives,
CUPS was granting access if ANY one condition passed instead
of requiring ALL conditions to pass.

Two bugs were found:

  1. conf.c: Second Require directive was overwriting the
    level set by first Require
  2. auth.c: OR logic was used instead of AND logic when
    Satisfy all was set

Fix

  • conf.c: Prevent level overwrite on multiple Require directives
  • auth.c: Implement proper AND logic for Satisfy all

Testing

Tested with user joe in @System group:

  • joe in @System only → 401 Unauthorized ✅
  • joe in @System + printadmin → 200 OK ✅

Fixes #1304

- conf.c: Prevent level overwrite when multiple Require
  directives are used in same Location block
- auth.c: Implement AND logic for Satisfy all with
  multiple Require conditions instead of OR logic

Fixes OpenPrinting#1304
@abubakarsabir924-cell
Copy link
Copy Markdown
Contributor Author

Hi @michaelrsweet Sir! This PR addresses #1304 by fixing the Satisfy all logic. I’ve corrected the level overwrite in conf.c and ensured that auth.c now uses AND logic for multiple Require directives. Tested locally and it now correctly restricts access unless all requirements are satisfied.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

AUTH: two Requires and Satisfy all does not work

1 participant