Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

scheduler: Fix cupsd activated on-demand via socket #988

Merged
merged 1 commit into from
Jun 18, 2024

Conversation

zdohnal
Copy link
Member

@zdohnal zdohnal commented Jun 17, 2024

If only the expected cups.sock is set as listener in cupsd.conf, the array Listeners was NULL. To prevent copying the code, do the array allocation earlier and have only one check for Listeners, in service_checkin() which is run every time cupsd starts.

Fixes #985

@zdohnal zdohnal requested a review from michaelrsweet June 17, 2024 15:26
Copy link
Member

@michaelrsweet michaelrsweet left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for figuring this out - it didn't occur to me to make sure the Listeners array was allocated... Once you address my two comments this is ready to go.

scheduler/conf.c Show resolved Hide resolved
scheduler/conf.c Show resolved Hide resolved
@Maryse47
Copy link

I can confirm this fixes reported issue.

@zdohnal zdohnal force-pushed the fix-socket-on-demand-24 branch from 458bba1 to 0884199 Compare June 18, 2024 08:36
If only the expected cups.sock is set as listener in cupsd.conf, the
array Listeners was NULL. To prevent copying the code, do the array
allocation earlier and have only one check for Listeners, in
service_checkin() which is run every time cupsd starts.

Fixes OpenPrinting#985
@zdohnal zdohnal force-pushed the fix-socket-on-demand-24 branch from c7b1a99 to 145b946 Compare June 18, 2024 08:38
@zdohnal zdohnal merged commit cd13b3e into OpenPrinting:2.4.x Jun 18, 2024
3 of 5 checks passed
risicle pushed a commit to NixOS/nixpkgs that referenced this pull request Aug 28, 2024
If cups is started with no network listeners,
i.e., only with `Listen /path/to/unix.socket`
lines in cupsd.conf, it fails to start.
This is caused by the patch of CVE-2024-35235, see also

bdf63d7
dfe9603

Upstream documented the problem here

OpenPrinting/cups#985

and fixed it here

OpenPrinting/cups#988 .

In NixOS, the problem manifests itself with this configuration:

> services.printing.listenAddresses = [];

The commit at hand adds three more
patches from the upstream repository.
This is the smalles possible change that
fixes the regression caused by the initial patch.
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.

3 participants