From e3e36c2a1e45889012bda605fff6fad42c0f0d2b Mon Sep 17 00:00:00 2001 From: Till Kamppeter Date: Sun, 10 Mar 2002 18:04:32 +0000 Subject: Protect the Star Office/OpenOffice.org configuration against manual changing of the "update-alternatives" assignment of the "lpr" command. --- perl-install/printer.pm | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/perl-install/printer.pm b/perl-install/printer.pm index 197e21183..64cfdcfa4 100644 --- a/perl-install/printer.pm +++ b/perl-install/printer.pm @@ -36,6 +36,13 @@ my $FOOMATIC_DEFAULT_SPOOLER = "$FOOMATICCONFDIR/defaultspooler"; ); %shortspooler_inv = reverse %shortspooler; +%lprcommand = ( + "cups" => "lpr-cups", + "lprng" => "lpr-lpd", + "lpd" => "lpr-lpd", + "pdq" => "lpr-pdq" +); + %printer_type = ( _("Local printer") => "LOCAL", _("Remote printer") => "REMOTE", @@ -1687,7 +1694,7 @@ sub configurestaroffice { ("ports", "default_queue=", $configfilecontent); $configfilecontent = addentry ("ports", - "default_queue=/usr/bin/perl -p -e \"s=16#80 /euro=16#80 /Euro=\" | /usr/bin/lpr", + "default_queue=/usr/bin/perl -p -e \"s=16#80 /euro=16#80 /Euro=\" | /usr/bin/$lprcommand{$printer->{SPOOLER}}", $configfilecontent); # Write back Star Office configuration file return writesofficeconfigfile($configfilename, $configfilecontent); @@ -1752,7 +1759,7 @@ sub configureopenoffice { ("Generic Printer", "Command=", $configfilecontent); $configfilecontent = addentry ("Generic Printer", - "Command=/usr/bin/perl -p -e \"s=/euro /unused=/Euro /unused=\" | /usr/bin/lpr", + "Command=/usr/bin/perl -p -e \"s=/euro /unused=/Euro /unused=\" | /usr/bin/$lprcommand{$printer->{SPOOLER}}", $configfilecontent); # Write back OpenOffice.org configuration file return writesofficeconfigfile($configfilename, $configfilecontent); @@ -1932,7 +1939,7 @@ sub makestarofficeprinterentry { # symbol correctly. $configfile = removeentry("ports", "$queue=", $configfile); $configfile = addentry("ports", - "$queue=/usr/bin/perl -p -e \"s=16#80 /euro=16#80 /Euro=\" | /usr/bin/lpr -P $queue", + "$queue=/usr/bin/perl -p -e \"s=16#80 /euro=16#80 /Euro=\" | /usr/bin/$lprcommand{$printer->{SPOOLER}} -P $queue", $configfile); # Make printer's section $configfile = addsection("$queue,PostScript,$queue", $configfile); @@ -1999,7 +2006,7 @@ sub makeopenofficeprinterentry { # symbol correctly. $configfile = removeentry($queue, "Command=", $configfile); $configfile = addentry($queue, - "Command=/usr/bin/perl -p -e \"s=/euro /unused=/Euro /unused=\" | /usr/bin/lpr -P $queue", + "Command=/usr/bin/perl -p -e \"s=/euro /unused=/Euro /unused=\" | /usr/bin/$lprcommand{$printer->{SPOOLER}} -P $queue", $configfile); # "Comment" line $configfile = removeentry($queue, "Comment=", $configfile); -- cgit v1.2.1