Fix compiled-in /bin/bash in foomatic filters

Foomatic filters contained a 64-char c string hardcoded to /bin/bash.
This caused some filters (at least pdftops) to fail.

I also had to increase the size of the string because nix paths are too
long.
This commit is contained in:
Brandon Dimcheff 2014-12-21 20:33:51 -05:00
parent 6a7971bee7
commit 6a2195c3a5
2 changed files with 21 additions and 1 deletions

View File

@ -1,5 +1,5 @@
{ stdenv, fetchurl, pkgconfig, cups, poppler, fontconfig { stdenv, fetchurl, pkgconfig, cups, poppler, fontconfig
, libjpeg, libpng, perl, ijs, qpdf, dbus }: , libjpeg, libpng, perl, ijs, qpdf, dbus, bash }:
stdenv.mkDerivation rec { stdenv.mkDerivation rec {
name = "cups-filters-${version}"; name = "cups-filters-${version}";
@ -34,6 +34,13 @@ stdenv.mkDerivation rec {
substituteInPlace filter/gstoraster.c --replace execve execvpe substituteInPlace filter/gstoraster.c --replace execve execvpe
''; '';
patches = [ ./longer-shell-path.patch ];
postPatch =
''
substituteInPlace filter/foomatic-rip/foomaticrip.c --replace "/bin/bash" "${bash}/bin/bash"
'';
postInstall = postInstall =
'' ''
for i in $out/lib/cups/filter/{pstopdf,texttops,imagetops}; do for i in $out/lib/cups/filter/{pstopdf,texttops,imagetops}; do

View File

@ -0,0 +1,13 @@
diff --git a/filter/foomatic-rip/foomaticrip.c b/filter/foomatic-rip/foomaticrip.c
index 1c019aa..431d2f9 100644
--- a/filter/foomatic-rip/foomaticrip.c
+++ b/filter/foomatic-rip/foomaticrip.c
@@ -174,7 +174,7 @@ char cupsfilterpath[PATH_MAX] = "/usr/local/lib/cups/filter:"
"/opt/cups/filter:"
"/usr/lib/cups/filter";
-char modern_shell[64] = "/bin/bash";
+char modern_shell[128] = "/bin/bash";
void config_set_option(const char *key, const char *value)
{