** Description changed:

+ [SRU justification]
+ The -h option should override the value stored in the CUPS_SERVER environment 
variable
+ 
+ [Impact]
+ Without this fix, user is unable to define the printserver to use with the -h 
option
+ 
+ [Fix]
+ Verify if the -h option has defined the printserver before using CUPS_SERVER 
to define it.
+ 
+ [Test Case]
+ $ export CUPS_SERVER="blah"
+ $ lp -h {valid printserver} -d {printqueue} /etc/hosts
+ 
+ Without the fix :
+ lp: No such file or directory
+ 
+ With the fix :
+ request id is {printqueue}-37 (1 file(s))
+ 
+ [Regression]
+ None expected. New code path (from upstream patch) is only triggered if
+ -h option is used.
+ 
+ [Original description of the problem]
+ 
  1) The release of Ubuntu you are using, via 'lsb_release -rd' or System
  -> About Ubuntu
  
  Description:  Ubuntu 14.04 LTS
  Release:      14.04
  Codename:     trusty
  
- 
- 2) The version of the package you are using, via 'apt-cache policy pkgname' 
or by checking in Software Center
+ 2) The version of the package you are using, via 'apt-cache policy
+ pkgname' or by checking in Software Center
  
  cups-client:
-   Installed: 1.7.2-0ubuntu1.1
+   Installed: 1.7.2-0ubuntu1.1
  
  3) What you expected to happen
  
  When using lp -h to send a print job to a printer, I expected to the job
  to be sent to the printer and to override any env variables set or conf
  file setting
  
  4) What happened instead
  
  To summarise the behaviour I'm seeing
  
  1) with CUPS_SERVER env variable unset and no ServerName set in 
/etc/cups/client.conf, we see that using lp -h with hostnames gives us error 
"lp: Error - add '/version=1.1' to server name."
  Using IPs sends the job to the printer as expected.
  
  2) with CUPS_SERVER env variable set using hostname with/without port
  and no ServerName set in /etc/cups/client.conf, we see that the only
  time it sends a job is when an IP and port are used. Otherwise it seems
  to error. I believe it's using the env variable, even though -h is being
  used.
  
  3) with CUPS_SERVER env variable set using IP address with/without port
  and no ServerName set in /etc/cups/client.conf we see that the job is
  always sent using lp -h but it is always sent to the value in env
  variable, thus ignoring the command line.
  
  ===
  
  with CUPS_SERVER env variable unset and no ServerName option set in
  /etc/cups/client.conf
  
  $ lp test2.txt
  lp: Error - scheduler not responding. (expected as no server is set or 
specified)
  
  Using hostname
  $ lp -h server1:631 test2.txt
  lp: Error - add '/version=1.1' to server name.
  
  $ lp -h server1 test2.txt
  lp: Error - add '/version=1.1' to server name.
  
  Using IP address
  $ lp -h 192.168.254.8 test2.txt
  request id is PDF-54 (1 file(s))
  
  $ lp -h 192.168.254.8:631 test2.txt
  request id is PDF-55 (1 file(s))
  
  ===
  
  With CUPS_SERVER env variable *set CUPS_SERVER=server1
  
  $ lp test2.txt
  lp: Error - add '/version=1.1' to server name.
  
  Using hostname
  $ lp -h server1 test2.txt
  lp: Error - add '/version=1.1' to server name.
  
  $ lp -h server1:631 test2.txt
  lp: Error - add '/version=1.1' to server name.
  
  Using IP address
  $ lp -h 192.168.254.8 test2.txt
  lp: Error - add '/version=1.1' to server name.
  
  $ lp -h 192.168.254.8:631 test2.txt
  request id is PDF-56 (1 file(s))
  
  ===
  
  With CUPS_SERVER env variable *set CUPS_SERVER=server:631
  
  Same results as above
  
  ===
  
  With CUPS_SERVER env variable *set CUPS_SERVER=192.168.254.8:631
  
  $ lp -h 555.555.555.555 test2.txt
  request id is PDF-66 (1 file(s))
  
  ===
  
  With CUPS_SERVER env variable *set CUPS_SERVER=192.168.254.8
  
  Same results as above

-- 
You received this bug notification because you are a member of Ubuntu
Bugs, which is subscribed to Ubuntu.
https://bugs.launchpad.net/bugs/1352809

Title:
  /usr/bin/lp on Trusty using -h option doesn't work as expected

To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu/+source/cups/+bug/1352809/+subscriptions

-- 
ubuntu-bugs mailing list
ubuntu-bugs@lists.ubuntu.com
https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs

Reply via email to