This service will be undergoing maintenance at 00:00 UTC, 2016-09-28. It is expected to last about 1 hours
Bug 67683 - CUPS lp, lpr do not recognize default printer
CUPS lp, lpr do not recognize default printer
Status: CLOSED CANTFIX
Product: Red Hat Linux
Classification: Retired
Component: cups (Show other bugs)
7.3
i386 Linux
medium Severity medium
: ---
: ---
Assigned To: Tim Waugh
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2002-06-29 01:01 EDT by Everett Lipman
Modified: 2007-04-18 12:43 EDT (History)
1 user (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2006-10-18 13:23:03 EDT
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:


Attachments (Terms of Use)

  None (edit)
Description Everett Lipman 2002-06-29 01:01:18 EDT
From Bugzilla Helper:
User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:0.9.9) Gecko/20020513

Description of problem:
The lp and lpr programs supplied with CUPS claim there
is no default destination even though there is one.

Version-Release number of selected component (if applicable):


How reproducible:
Always

Steps to Reproduce:
1.lpr testpage.ps
2.
3.
	

Actual Results:  strace output from 'lpr testpage.ps':

9855  open("/etc/cups/lpoptions", O_RDONLY) = 3
9855  fstat64(3, {st_mode=S_IFREG|0644, st_size=14, ...}) = 0
9855  read(3, "Default coach\n", 4096)  = 14
9855  read(3, "", 4096)                 = 0
9855  close(3)                          = 0
9855  open("/home/lipman/.lpoptions", O_RDONLY) = -1 ENOENT (No such file or
directory)
9855  write(2, "lpr: error - no default destinat"..., 47) = 47
9855  _exit(1)                          = ?


Expected Results:  As you can see, lpr read /etc/cups/lpoptions, which contained
the line "Default coach\n", and then proceeded to conclude
that there is "no default destination".

Additional info:
Comment 1 Everett Lipman 2002-07-01 19:28:58 EDT
OK, so I found the problem, and it was partially my fault.  I had
a non-empty PRINTER variable which contained the name of a printer
that had not yet been configured.  In cupsGetDefault() [line 638 of
cups/util.c], the contents of any existing LPDEST or PRINTER environment
variables are immediately returned as the default destination.

After the "if" statement on line 276 of cups/dest.c [in cupsGetDests()],
there is no error handling code, so if the printer in the environment
variable is not configured, this is silently ignored and no "is_default"
field gets set in any of the destination structures.  Hence the misleading
error message.
Comment 2 Michael Sweet 2003-04-18 10:47:32 EDT
The environment variables override the default printer in ~/.lpoptions,
/etc/cups/lpoptions, and /etc/cups/printers.conf; if you sent the env var to an
non-existent printer then CUPS doesn't know what to do.

We don't want to just use the default in the config files because that clearly
is not what the user is asking for...
Comment 3 Tim Waugh 2003-04-24 09:36:25 EDT
The error message *is* misleading though.  Something like 'specified printer not
available' would be better IMHO.
Comment 4 Everett Lipman 2003-04-24 14:10:32 EDT
I'd like to amplify what Tim said above; in addition
to being misleading, the error message is downright wrong.
That is the reason I had to go read source
code when I had the problem.  Seems to me that
kind of defeats the purpose of an error message.
Comment 5 Bill Nottingham 2006-08-05 01:41:19 EDT
Red Hat apologizes that these issues have not been resolved yet. We do want to
make sure that no important bugs slip through the cracks.

Red Hat Linux 7.3 and Red Hat Linux 9 are no longer supported by Red Hat, Inc.
They are maintained by the Fedora Legacy project (http://www.fedoralegacy.org/)
for security updates only. If this is a security issue, please reassign to the
'Fedora Legacy' product in bugzilla. Please note that Legacy security update
support for these products will stop on December 31st, 2006.

If this is not a security issue, please check if this issue is still present
in a current Fedora Core release. If so, please change the product and version
to match, and check the box indicating that the requested information has been
provided.

If you are currently still running Red Hat Linux 7.3 or 9, please note that
Fedora Legacy security update support for these products will stop on December
31st, 2006. You are strongly advised to upgrade to a current Fedora Core release
or Red Hat Enterprise Linux or comparable. Some information on which option may
be right for you is available at http://www.redhat.com/rhel/migrate/redhatlinux/.

Any bug still open against Red Hat Linux 7.3 or 9 at the end of 2006 will be
closed 'CANTFIX'. Again, if this bug still exists in a current release, or is a
security issue, please change the product as necessary. We thank you for your
help, and apologize again that we haven't handled these issues to this point.
Comment 6 Bill Nottingham 2006-10-18 13:23:03 EDT
Red Hat Linux is no longer supported by Red Hat, Inc. If you are still
running Red Hat Linux, you are strongly advised to upgrade to a
current Fedora Core release or Red Hat Enterprise Linux or comparable.
Some information on which option may be right for you is available at
http://www.redhat.com/rhel/migrate/redhatlinux/.

Closing as CANTFIX.

Note You need to log in before you can comment on or make changes to this bug.