Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 449272 - net-print/hplip-3.12.11 may remove user from all groups except lp
Summary: net-print/hplip-3.12.11 may remove user from all groups except lp
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: [OLD] Printing (show other bugs)
Hardware: All Linux
: Normal normal (vote)
Assignee: Daniel Pielmeier
URL:
Whiteboard:
Keywords: PATCH
Depends on:
Blocks:
 
Reported: 2012-12-30 10:03 UTC by Marios Andreopoulos
Modified: 2013-10-14 19:04 UTC (History)
1 user (show)

See Also:
Package list:
Runtime testing required: ---


Attachments
distros.dat patch (distros.dat.patch,318 bytes, patch)
2012-12-30 10:05 UTC, Marios Andreopoulos
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Marios Andreopoulos 2012-12-30 10:03:24 UTC
hplip, under some circumstances that I can not pinpoint, may remove the user who runs it from all groups except his default group and lp.

Long story short:
Yesterday I wanted to print on a HP machine. I installed hplip, connected the printer, started hplip and run `hp-config_usb_printer 004:004` to setup my printer. I didn't know or expect at the time to be detected automatically.

During the setup process hplip asked for my root password only for me to find later, while trying to su, that I had been removed from all groups except lp.

I guess it ran `usermod -G lp` instead of `usermod -a -G lp`.

I try to reproduce this behavior so I can be more specific, alas I fail. I can't get hplip to ask for my root password again.

I am on a ~amd64 system. Sorry I can't provide more information.

Reproducible: Always
Comment 1 Marios Andreopoulos 2012-12-30 10:05:46 UTC
Created attachment 333742 [details, diff]
distros.dat patch

I think that this patch may fix the issue but I couldn't replicate the problem in order to test it.
Comment 2 Daniel Pielmeier gentoo-dev 2013-02-01 09:12:05 UTC
I did look up the code and there are three occurrences where usermod is called.

check.py
base/queues.py
installer/core_install.py

check.py looks up the information in installer/distros.dat and if nothing is there it prints a log message. 

installer/core_install.py looks up the information in installer/distros.dat and if nothing is there nothing happens.

base/queues.py which I think is responsible for the issue looks up the information in installer/distros.dat and if nothing is there it executes:
usermod -Glp username

So the "-a" is missing here. Your patch should fix the issue for Gentoo, but I think the queues.py should be fixed as well. From looking up installer/distros.dat Suse seems to be the only distribution which does not add the "-a" flag. So leaving it out in the general case seems wrong.
Comment 3 Daniel Pielmeier gentoo-dev 2013-10-14 19:04:13 UTC
This is fixed in hplip-3-13-10.