After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 679701 - Automagically added printers
Automagically added printers
Status: RESOLVED WONTFIX
Product: gnome-control-center
Classification: Core
Component: Printers
unspecified
Other Linux
: Normal normal
: ---
Assigned To: Marek Kašík
Control-Center Maintainers
3.10
Depends on:
Blocks:
 
 
Reported: 2012-07-10 17:29 UTC by David Zeuthen (not reading bugmail)
Modified: 2014-01-29 10:11 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Screenshot (268.68 KB, image/jpeg)
2012-07-10 17:31 UTC, David Zeuthen (not reading bugmail)
Details

Description David Zeuthen (not reading bugmail) 2012-07-10 17:29:09 UTC
As I was going to review a huge patch today, I was going to use a2ps(1) to pretty-print it. Since I haven't used that tool in a bit I forgot that it by default sends it to the default printer. So this is what happened:

 $ a2ps gvfs-gdbus-core-squashed.patch 
 [gvfs-gdbus-core-squashed.patch (plain): 316 pages on 158 sheets]
 request id is HP-Deskjet-6980-series-5 (0 file(s))
 [Total: 316 pages on 158 sheets] sent to the default printer
 [1068 lines wrapped]

This caught me by surprise since the only printer I have ever added is my printer at home (an Officejet 4500, also in the screenshot).

So I go into the control center and this I see that "HP-Deskjet-6980-series" is the default (see attached screensot). What's worse, there is no way to remove it (the "-" button is not sensitive)!

For the record, I never added that printer and I guess it only shows up because it's on the same local network as I'm currently connected to?

Printing the document failed (some obscure error message, can't remember) but I was able to go in and cancel the job via the control center.

I don't know how printing currently works so it's possible this is not a control center bug at all. But it was suggested that I started by filing a bug here. Thanks.

For the record I don't think we should *ever* automatically add any printer (and even worse, make it the default!) - it's just way too dangerous to do things like that behind the users back even if if you are just trying to "help" the user.

This is with GNOME 3.4 on Fedora 17.
Comment 1 David Zeuthen (not reading bugmail) 2012-07-10 17:31:38 UTC
Created attachment 218451 [details]
Screenshot

Here's the screenshot mentioned in comment 0.
Comment 2 Marek Kašík 2012-07-11 09:26:28 UTC
Hi David,

it seems that the printer was automatically added by CUPS. This is caused by "Browsing" ability. You can turn it off by setting it to "Browsing Off" in /etc/cups/cupsd.conf and restarting cups service.
Also, you can try to set the printer "Officejet 4500" as a default, this should remove the default flag from the "HP-Deskjet-6980-series-5".

Regards

Marek
Comment 3 Matthias Clasen 2012-07-12 11:40:15 UTC
Marek, even if the printer is automatically added by cups, we should always be able to remove it, no ?
Comment 4 Marek Kašík 2012-07-12 12:01:10 UTC
(In reply to comment #3)
> Marek, even if the printer is automatically added by cups, we should always be
> able to remove it, no ?

Actually, no, if you remove it (e.g. by lpadmin -x "MyPrinter"), the CUPS will add it again in few seconds.

Btw, system-config-printer doesn't allow you to remove it.
Comment 5 Matthias Clasen 2012-07-12 12:04:14 UTC
Still seems wrong to me, on both ends

- we should not add it automatically

- we should allow removing it, and that should stick

I guess I'm arguing for having 'Browsing Off', but then still show autodiscovered printers in the add-printer dialog - is that easily doable ?
Comment 6 Marek Kašík 2012-07-12 12:38:32 UTC
(In reply to comment #5)
> Still seems wrong to me, on both ends
> 
> - we should not add it automatically

This is default configuration of CUPS, we can not influence this except turning the browsing off (btw, browsing will be removed from CUPS since 1.6).
Turning browsing off would mean to call org.opensuse.CupsPkHelper.Mechanism.ServerSetSettings which needs administration authentication (this is additional to the "Unlock" button in the panel).


> - we should allow removing it, and that should stick

It is not possible with enabled browsing.


> I guess I'm arguing for having 'Browsing Off', but then still show
> autodiscovered printers in the add-printer dialog - is that easily doable ?

These printers can not be shown in the add-printer dialog, they are not detected by CUPS (by cupsGetDevices() function).
Comment 7 Matthias Clasen 2012-07-12 23:32:39 UTC
> It is not possible with enabled browsing.

Well, I guess we could just explicitly ignore them - ie maintain a client-side blacklist of printers to not show. Of course, that list would have to be shared with the gtk print dialog; and we could then show the detected printers from that list in the add-printer dialog.

But maybe this needs some more thought. I do think that we probably want printers to show up by default, it just needs to be possible to remove them. I'll talk to the designers about this.
Comment 8 Matthias Clasen 2012-07-12 23:33:25 UTC
> (btw, browsing will be removed from CUPS since 1.6)

Well, in that case, perhaps not worth worrying about
Comment 9 Marek Kašík 2014-01-29 10:11:41 UTC
(In reply to comment #8)
> > (btw, browsing will be removed from CUPS since 1.6)
> 
> Well, in that case, perhaps not worth worrying about

I'm closing this then. Actual version of CUPS is 1.7.x which uses avahi instead of CUPS' own protocol.