[X2Go-User] Remote printing not working
Mike Gabriel
mike.gabriel at das-netzwerkteam.de
Sat Sep 23 21:03:48 CEST 2023
Hi Rui,
On Sa 23 Sep 2023 02:01:23 CEST, Rui Ferreira wrote:
> Às 19:37 de 21/09/23, Mike Gabriel escreveu:
>> HI Rui,
>>
>> thanks for reporting the below issue.
>>
> [...]>
>> However, we can tweak cups-x2go [1]. It would be nice if you could
>> experiment with that a little and move the "$ENV{TMPDIR}="/tmp";"
>> statement that is part of the script to the very top of the script
>> (after all the "use ...;" statements.
>>
>> When done, remove your hack again (which brings back more security
>> into your CUPS daemon) and re-test cups-x2go. Let me know if that
>> works for you. If so, please send your patch.
>>
>> Thanks,
>> Mike
>
> Hello Mike
>
> Thank you for your fast response and sorry for my slow one.
>
> It wasn't that, but your tip showed me the way.
> The answer begins here:
>
> https://git.ghostscript.com/?p=ghostpdl.git&a=search&h=HEAD&st=commit&s=setpdfwrite
>
> Ghostscript deprecated 'setpdfwrite' in 2019 and removed it in 2021,
> or version 9.54.
> To solve this, I edited /etc/cups/cups-x2go.conf:
>
> ps2pdf = /usr/bin/gs -q -dCompatibilityLevel=1.4 -dNOPAUSE -dBATCH
> -dSAFER -sDEVICE=pdfwrite -sOutputFile=-
> -dAutoRotatePages=/PageByPage -dAutoFilterColorImages=false
> -dColorImageFilter=/FlateEncode -dPDFSETTINGS=/prepress
> -dDoNumCopies -f \"%s\"
>
> This alone should've solved my problem... yet it wasn't working :(
> After many hours of self commiseration, I found that the culprit to
> be a leading space in the command, in this line
>
> my $gs_pid = open2 ($gs_out, $gs_in, $ps2pdf_cmd, @ps2pdf_args);
>
> where $ps2pdf_cmd would translate to ' /usr/bin/gs'.
>
> So, I had to learn just enough Perl to correct this:
>
> if($option eq "ps2pdf")
> {
> $ps2pdf=$value;
> $ps2pdf=~s/^\s+//; <-------- my solution
> }
>
> Now, about sending patches... I've never done it before.
>
> I'm not sure if just changing the default ghostscript command line,
> hardcoded in the Perl script and the .conf file, is the best
> solution for everyone.
> And I'm not sure if the way I found to trim that leading whitespace
> is the best solution.
>
> I'm too uncertain.
>
> Regards,
> Rui Ferreira
Thanks for the follow-up. To be 100% sure, your changes land in
cups-x2go appropriately, please do the following:
<install package git>
git clone https://code.x2go.org/git/cups-x2go.git
Now copy your version of the cups-x2go script into the newly cloned
cups-x2go/ folder.
Change dir into that folder and check output of "git diff".
Commit that change, e.g. via "git commit --patch -m "cups-x2go: Fix
<this and that>." Find a good commit message one-liner.
The run "git format-patch HEAD~..HEAD". This will create a patch file.
Please send this patch file attached to a reply to this mail.
Thanks!
Mike
--
DAS-NETZWERKTEAM
c\o Technik- und Ökologiezentrum Eckernförde
Mike Gabriel, Marienthaler Str. 17, 24340 Eckernförde
mobile: +49 (1520) 1976 148
landline: +49 (4351) 850 8940
GnuPG Fingerprint: 9BFB AEE8 6C0A A5FF BF22 0782 9AF4 6B30 2577 1B31
mail: mike.gabriel at das-netzwerkteam.de, http://das-netzwerkteam.de
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 851 bytes
Desc: Digitale PGP-Signatur
URL: <https://lists.x2go.org/pipermail/x2go-user/attachments/20230923/33c5907d/attachment.sig>
More information about the x2go-user
mailing list