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

ghostscript: fix icc profile validation #47903

Closed

Conversation

flokli
Copy link
Contributor

@flokli flokli commented Oct 5, 2018

Currently, printing color documents fails with the following error:

Oct 05 08:34:21 tp cupsd[16855]: | ./base/gsicc_manage.c:1863: gsicc_verify_device_profiles(): Mismatch of ICC profiles and device color model
Oct 05 08:34:21 tp cupsd[16855]: | ./base/gsicc_manage.c:1990: gsicc_set_device_profile(): Error in device profiles
Oct 05 08:34:21 tp cupsd[16855]: Unrecoverable error: rangecheck in .putdeviceprops

Add the corresponding patch from ghostscript master to fix this.

Motivation for this change

Printing color documents didn't work on my printer (HP Officejet 4620). With this patch, it works again.

Things done
  • Tested using sandboxing (nix.useSandbox on NixOS, or option sandbox in nix.conf on non-NixOS)
  • Built on platform(s)
    • NixOS
    • macOS
    • other Linux distributions
  • Tested via one or more NixOS test(s) if existing and applicable for the change (look inside nixos/tests)
  • Tested compilation of all pkgs that depend on this change using nix-shell -p nox --run "nox-review wip"
  • Tested execution of all binary files (usually in ./result/bin/)
  • Determined the impact on package closure size (by running nix path-info -S before and after)
  • Fits CONTRIBUTING.md.

@@ -46,6 +46,7 @@ stdenv.mkDerivation rec {
patches = [
./urw-font-files.patch
./doc-no-ref.diff
./0001-For-ICC-profile-validation-have-cups-id-iteself-as-D.patch
Copy link
Contributor Author

Choose a reason for hiding this comment

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

I didn't use fetchpatch, as the source url http://git.ghostscript.com/?p=ghostpdl.git;a=patch;h=bc3df0773fcc caused problems.

Copy link
Member

@edwtjo edwtjo Oct 5, 2018

Choose a reason for hiding this comment

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

Add the source url in the commit message and state that it must be included into nixpkgs due to invalid characters.

@flokli
Copy link
Contributor Author

flokli commented Oct 5, 2018

I didn't check whether unstable is affected too, as switching there took to long for me (but guess it is).

As there are some scary fixes on master anyhow, I assume we should bump to 9.26 as soon as it's released on both channels anyhow, but I didn't want to introduce a printing regression in 18.09

@flokli
Copy link
Contributor Author

flokli commented Oct 5, 2018

cc @vcunat @samueldr

@GrahamcOfBorg
Copy link

Success on aarch64-linux (full log)

Attempted: ghostscript

Partial log (click to expand)

shrinking RPATHs of ELF executables and libraries in /nix/store/mfw6kyiryxyc2khjxgf78l38vrll9bkj-ghostscript-9.24-man
gzipping man pages under /nix/store/mfw6kyiryxyc2khjxgf78l38vrll9bkj-ghostscript-9.24-man/share/man/
strip is /nix/store/y4ymnvgxygpq05h03kyzbj572zmh6zla-binutils-2.30/bin/strip
patching script interpreter paths in /nix/store/mfw6kyiryxyc2khjxgf78l38vrll9bkj-ghostscript-9.24-man
checking for references to /build in /nix/store/mfw6kyiryxyc2khjxgf78l38vrll9bkj-ghostscript-9.24-man...
shrinking RPATHs of ELF executables and libraries in /nix/store/c2136mql4l417wdvfrlgg7cc7437f6mc-ghostscript-9.24-doc
strip is /nix/store/y4ymnvgxygpq05h03kyzbj572zmh6zla-binutils-2.30/bin/strip
patching script interpreter paths in /nix/store/c2136mql4l417wdvfrlgg7cc7437f6mc-ghostscript-9.24-doc
checking for references to /build in /nix/store/c2136mql4l417wdvfrlgg7cc7437f6mc-ghostscript-9.24-doc...
/nix/store/yh5afax8jsidcz2354n8rz880z76n8kg-ghostscript-9.24

@GrahamcOfBorg
Copy link

Success on x86_64-linux (full log)

Attempted: ghostscript

Partial log (click to expand)

shrinking RPATHs of ELF executables and libraries in /nix/store/kaghvzzq67gh8vc9y49l13x53lxwqr03-ghostscript-9.24-man
gzipping man pages under /nix/store/kaghvzzq67gh8vc9y49l13x53lxwqr03-ghostscript-9.24-man/share/man/
strip is /nix/store/h0lbngpv6ln56hjj59i6l77vxq25flbz-binutils-2.30/bin/strip
patching script interpreter paths in /nix/store/kaghvzzq67gh8vc9y49l13x53lxwqr03-ghostscript-9.24-man
checking for references to /build in /nix/store/kaghvzzq67gh8vc9y49l13x53lxwqr03-ghostscript-9.24-man...
shrinking RPATHs of ELF executables and libraries in /nix/store/815bzw5b6zrwlhiwvayj9zwwhmrhqh1h-ghostscript-9.24-doc
strip is /nix/store/h0lbngpv6ln56hjj59i6l77vxq25flbz-binutils-2.30/bin/strip
patching script interpreter paths in /nix/store/815bzw5b6zrwlhiwvayj9zwwhmrhqh1h-ghostscript-9.24-doc
checking for references to /build in /nix/store/815bzw5b6zrwlhiwvayj9zwwhmrhqh1h-ghostscript-9.24-doc...
/nix/store/900ldasg3lbxg754py2phmay2s3mpqyi-ghostscript-9.24

@GrahamcOfBorg
Copy link

Success on x86_64-darwin (full log)

Attempted: ghostscript

Partial log (click to expand)

/nix/store/38a415gm0x2h5pl2i0l4x483p7rdyvcg-ghostscript-9.24/bin/ps2pdfwr: interpreter directive changed from "/bin/sh" to "/nix/store/cblfnvb5rmhd2z231mqasn0brzh1hhv4-bash-4.4-p23/bin/sh"
/nix/store/38a415gm0x2h5pl2i0l4x483p7rdyvcg-ghostscript-9.24/bin/ps2ps: interpreter directive changed from "/bin/sh" to "/nix/store/cblfnvb5rmhd2z231mqasn0brzh1hhv4-bash-4.4-p23/bin/sh"
/nix/store/38a415gm0x2h5pl2i0l4x483p7rdyvcg-ghostscript-9.24/bin/ps2ps2: interpreter directive changed from "/bin/sh" to "/nix/store/cblfnvb5rmhd2z231mqasn0brzh1hhv4-bash-4.4-p23/bin/sh"
/nix/store/38a415gm0x2h5pl2i0l4x483p7rdyvcg-ghostscript-9.24/bin/unix-lpr.sh: interpreter directive changed from "/bin/sh" to "/nix/store/cblfnvb5rmhd2z231mqasn0brzh1hhv4-bash-4.4-p23/bin/sh"
gzipping man pages under /nix/store/772rs1sw0s3n2b4855yq4hkdw1bpcm3h-ghostscript-9.24-man/share/man/
strip is /nix/store/df6k4mgdjxciy0f637lryp7c9ln7n1m3-cctools-binutils-darwin/bin/strip
patching script interpreter paths in /nix/store/772rs1sw0s3n2b4855yq4hkdw1bpcm3h-ghostscript-9.24-man
strip is /nix/store/df6k4mgdjxciy0f637lryp7c9ln7n1m3-cctools-binutils-darwin/bin/strip
patching script interpreter paths in /nix/store/hph177sqkx42c6vddnr0pcyfi68jvaqn-ghostscript-9.24-doc
/nix/store/38a415gm0x2h5pl2i0l4x483p7rdyvcg-ghostscript-9.24

@flokli flokli changed the base branch from release-18.09 to staging-18.09 October 5, 2018 07:05
@flokli flokli force-pushed the ghostscript-icc-profile-validation branch from b383f32 to 5aea394 Compare October 5, 2018 07:06
Currently, printing color documents fails with the following error:

Oct 05 08:34:21 tp cupsd[16855]: | ./base/gsicc_manage.c:1863: gsicc_verify_device_profiles(): Mismatch of ICC profiles and device color model
Oct 05 08:34:21 tp cupsd[16855]: | ./base/gsicc_manage.c:1990: gsicc_set_device_profile(): Error in device profiles
Oct 05 08:34:21 tp cupsd[16855]: Unrecoverable error: rangecheck in .putdeviceprops

Add the corresponding patch from ghostscript master to fix this
@flokli flokli force-pushed the ghostscript-icc-profile-validation branch from 5aea394 to df4456a Compare October 5, 2018 07:07
@GrahamcOfBorg
Copy link

Success on aarch64-linux (full log)

Attempted: ghostscript

Partial log (click to expand)

/nix/store/yh5afax8jsidcz2354n8rz880z76n8kg-ghostscript-9.24

@GrahamcOfBorg
Copy link

Success on x86_64-darwin (full log)

Attempted: ghostscript

Partial log (click to expand)

/nix/store/38a415gm0x2h5pl2i0l4x483p7rdyvcg-ghostscript-9.24/bin/unix-lpr.sh: interpreter directive changed from "/bin/sh" to "/nix/store/cblfnvb5rmhd2z231mqasn0brzh1hhv4-bash-4.4-p23/bin/sh"
/nix/store/38a415gm0x2h5pl2i0l4x483p7rdyvcg-ghostscript-9.24/bin/pdf2ps: interpreter directive changed from "/bin/sh" to "/nix/store/cblfnvb5rmhd2z231mqasn0brzh1hhv4-bash-4.4-p23/bin/sh"
/nix/store/38a415gm0x2h5pl2i0l4x483p7rdyvcg-ghostscript-9.24/bin/eps2eps: interpreter directive changed from "/bin/sh" to "/nix/store/cblfnvb5rmhd2z231mqasn0brzh1hhv4-bash-4.4-p23/bin/sh"
/nix/store/38a415gm0x2h5pl2i0l4x483p7rdyvcg-ghostscript-9.24/bin/lprsetup.sh: interpreter directive changed from "/bin/sh" to "/nix/store/cblfnvb5rmhd2z231mqasn0brzh1hhv4-bash-4.4-p23/bin/sh"
gzipping man pages under /nix/store/772rs1sw0s3n2b4855yq4hkdw1bpcm3h-ghostscript-9.24-man/share/man/
strip is /nix/store/df6k4mgdjxciy0f637lryp7c9ln7n1m3-cctools-binutils-darwin/bin/strip
patching script interpreter paths in /nix/store/772rs1sw0s3n2b4855yq4hkdw1bpcm3h-ghostscript-9.24-man
strip is /nix/store/df6k4mgdjxciy0f637lryp7c9ln7n1m3-cctools-binutils-darwin/bin/strip
patching script interpreter paths in /nix/store/hph177sqkx42c6vddnr0pcyfi68jvaqn-ghostscript-9.24-doc
/nix/store/38a415gm0x2h5pl2i0l4x483p7rdyvcg-ghostscript-9.24

@GrahamcOfBorg
Copy link

Success on x86_64-linux (full log)

Attempted: ghostscript

Partial log (click to expand)

shrinking RPATHs of ELF executables and libraries in /nix/store/kaghvzzq67gh8vc9y49l13x53lxwqr03-ghostscript-9.24-man
gzipping man pages under /nix/store/kaghvzzq67gh8vc9y49l13x53lxwqr03-ghostscript-9.24-man/share/man/
strip is /nix/store/h0lbngpv6ln56hjj59i6l77vxq25flbz-binutils-2.30/bin/strip
patching script interpreter paths in /nix/store/kaghvzzq67gh8vc9y49l13x53lxwqr03-ghostscript-9.24-man
checking for references to /build in /nix/store/kaghvzzq67gh8vc9y49l13x53lxwqr03-ghostscript-9.24-man...
shrinking RPATHs of ELF executables and libraries in /nix/store/815bzw5b6zrwlhiwvayj9zwwhmrhqh1h-ghostscript-9.24-doc
strip is /nix/store/h0lbngpv6ln56hjj59i6l77vxq25flbz-binutils-2.30/bin/strip
patching script interpreter paths in /nix/store/815bzw5b6zrwlhiwvayj9zwwhmrhqh1h-ghostscript-9.24-doc
checking for references to /build in /nix/store/815bzw5b6zrwlhiwvayj9zwwhmrhqh1h-ghostscript-9.24-doc...
/nix/store/900ldasg3lbxg754py2phmay2s3mpqyi-ghostscript-9.24

Copy link
Member

@peti peti left a comment

Choose a reason for hiding this comment

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

Ghostscript 9.24 has plenty of known security issues and we should update to 9.25 ASAP. Will this patch patch still apply to the new version?

@flokli
Copy link
Contributor Author

flokli commented Oct 5, 2018

duplicate of #46216.

@flokli flokli closed this Oct 5, 2018
@flokli flokli deleted the ghostscript-icc-profile-validation branch October 5, 2018 20:12
@flokli flokli mentioned this pull request Oct 6, 2018
9 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants