Why is it an "error" to run hp-probe as root?

Asked by Johannes Meixner

I run HPLIP 2.8.4 from
http://download.opensuse.org/repositories/home:/jsmeix/openSUSE_Factory/i586/
on openSUSE 11.0 beta3 on i386 architecture.

When I run hp-probe as root I get an "error" message,
nevertheless it seems to autodetect correctly which I expect
in particular when I run an autodetection program as root
intentionally to make sure it can autodetect anything:
---------------------------------------------------------
root@host# hp-probe -busb -escan

HP Linux Imaging and Printing System (ver. 2.8.4)
Printer Discovery Utility ver. 4.1

Copyright (c) 2001-8 Hewlett-Packard Development Company, LP
This software comes with ABSOLUTELY NO WARRANTY.
This is free software, and you are welcome to distribute it
under certain conditions. See COPYING file for more details.

error: hp-probe should not be run as root.

--------------------
| DEVICE DISCOVERY |
--------------------

  Device URI Model
  -------------------------------------------- ----------------
  hp:/usb/HP_LaserJet_1220?serial=00XXXXXXXXXX HP LaserJet 1220

Found 1 printer(s) on the 'usb' bus.

Done.
---------------------------------------------------------

What is the reason behind this error message?

Does something not work or can it crash the whole
system whien it is run as root or ist is only because
of security related issues - if the latter, which security
related issues when I am already root (I can already
do anything)?

Shouldn't this message be only a warning?

Shouldn't the documentation "hp-probe -h" at least mention
why it shouldn_t be run as root?

Question information

Language:
English Edit question
Status:
Solved
For:
HPLIP Edit question
Assignee:
No assignee Edit question
Solved by:
Johannes Meixner
Solved:
Last query:
Last reply:
Revision history for this message
dwelch91 (dwelch91) said :
#1

Most of the tools try to load up and run dbus and connect to the session
bus. At least on my machine, root does not have a session bus, so this
fails. I added this error check to trap this situation. You are right, for
hp-probe, it doesn't matter. Some tools, like hp-info, will crash if run by
root because of this situation.

On Wed, May 21, 2008 at 2:44 AM, Johannes Meixner <
<email address hidden>> wrote:

> New question #33789 on HPLIP:
> https://answers.launchpad.net/hplip/+question/33789
>
> I run HPLIP 2.8.4 from
>
> http://download.opensuse.org/repositories/home:/jsmeix/openSUSE_Factory/i586/
> on openSUSE 11.0 beta3 on i386 architecture.
>
> When I run hp-probe as root I get an "error" message,
> nevertheless it seems to autodetect correctly which I expect
> in particular when I run an autodetection program as root
> intentionally to make sure it can autodetect anything:
> ---------------------------------------------------------
> root@host# hp-probe -busb -escan
>
> HP Linux Imaging and Printing System (ver. 2.8.4)
> Printer Discovery Utility ver. 4.1
>
> Copyright (c) 2001-8 Hewlett-Packard Development Company, LP
> This software comes with ABSOLUTELY NO WARRANTY.
> This is free software, and you are welcome to distribute it
> under certain conditions. See COPYING file for more details.
>
> error: hp-probe should not be run as root.
>
> --------------------
> | DEVICE DISCOVERY |
> --------------------
>
> Device URI Model
> -------------------------------------------- ----------------
> hp:/usb/HP_LaserJet_1220?serial=00XXXXXXXXXX HP LaserJet 1220
>
> Found 1 printer(s) on the 'usb' bus.
>
>
> Done.
> ---------------------------------------------------------
>
> What is the reason behind this error message?
>
> Does something not work or can it crash the whole
> system whien it is run as root or ist is only because
> of security related issues - if the latter, which security
> related issues when I am already root (I can already
> do anything)?
>
> Shouldn't this message be only a warning?
>
> Shouldn't the documentation "hp-probe -h" at least mention
> why it shouldn_t be run as root?
>
>
> You received this question notification because you are a member of HP
> Linux Imaging and Printing, which is an answer contact for HPLIP.
>

Revision history for this message
Johannes Meixner (jsmeix) said :
#2

hp-info seems to work as root in my case.
-------------------------------------------------------------
root@host# hp-info -p HP_LaserJet_1220

HP Linux Imaging and Printing System (ver. 2.8.4)
Device Information Utility ver. 4.1

Copyright (c) 2001-8 Hewlett-Packard Development Company, LP
This software comes with ABSOLUTELY NO WARRANTY.
This is free software, and you are welcome to distribute it
under certain conditions. See COPYING file for more details.

error: hp-info should not be run as root.

hp:/usb/HP_LaserJet_1220?serial=00XXXXXXXXXX

Device Parameters (dynamic data):
  Parameter Value(s)
  ---------------------------- ----------------------------------------------------------
  agent1-ack False
  agent1-desc Black toner cartridge
[...]
  usb-pid 0417
  usb-vid 03f0

Done.
-------------------------------------------------------------
Currently I have no hp-systray process running.