LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware
User Name
Password
Slackware This Forum is for the discussion of Slackware Linux.

Notices


Reply
  Search this Thread
Old 10-18-2014, 01:20 AM   #1
kikinovak
MLED Founder
 
Registered: Jun 2011
Location: Montpezat (South France)
Distribution: CentOS, OpenSUSE
Posts: 3,453

Rep: Reputation: 2154Reputation: 2154Reputation: 2154Reputation: 2154Reputation: 2154Reputation: 2154Reputation: 2154Reputation: 2154Reputation: 2154Reputation: 2154Reputation: 2154
Bug in adduser?


Hi,

I just noticed a strange bug in the interactive adduser script. Normally there's a functionality to add a user to several additional groups (like lp, floppy, audio, video, cdrom, etc.) by hitting the UP key at one point. And this is what I usually do.

I'm currently writing the chapter about user and group management for my new Linux book, so I'm running a few tests on a vanilla Slackware 14.1 installation. And I just noticed that not hitting the up key for adding the user to additional groups... adds him to these anyway. What I'd expect after adding a user by simply hitting ENTER at the additional groups question would be to only see him or her in the users group. Instead, the user gets added to users, lp, floppy, audio, video, cdrom and scanner (but curiously enough, not plugdev).

Edit: after some more tests, I get some really weird results. I added a user 'kjoly' to a vanilla Slackware system running in a virtual host. I ask adduser not to add this user to any additional groups.

1. When I login as kjoly in init 3, I get this:

Code:
kjoly@slackbox:~$ groups
users lp floppy audio video cdrom scanner
2. When I login as root, I get this:

Code:
root@slackbox:~# groups kjoly
users
3. When I SSH into that virtual installation as user 'kjoly', I get this:

Code:
kjoly@slackbox:~$ groups
users
I have a distinct feeling something is very wrong here.

Edit after some more fiddling. The bug seems to be in the 'groups' command. User kjoly doesn't appear in any additional groups in /etc/group, as expected. But when she issues the 'groups' command, she appears to be a member of lp, floppy, audio, etc.

I added a screenshot so you get an idea of what's happening.

Cheers,

Niki
Attached Thumbnails
Click image for larger version

Name:	groups.png
Views:	32
Size:	49.7 KB
ID:	16678  

Last edited by kikinovak; 10-18-2014 at 01:41 AM.
 
Old 10-18-2014, 03:00 AM   #2
GazL
LQ Veteran
 
Registered: May 2008
Posts: 7,014

Rep: Reputation: 5144Reputation: 5144Reputation: 5144Reputation: 5144Reputation: 5144Reputation: 5144Reputation: 5144Reputation: 5144Reputation: 5144Reputation: 5144Reputation: 5144
It's from the CONSOLE_GROUPS setting in /etc/login.defs. That's normal on a vanilla Slackware install. I always comment that out when I do a fresh install.
 
1 members found this post helpful.
Old 10-18-2014, 03:05 AM   #3
drmozes
Slackware Contributor
 
Registered: Apr 2008
Distribution: Slackware
Posts: 1,595

Rep: Reputation: 1339Reputation: 1339Reputation: 1339Reputation: 1339Reputation: 1339Reputation: 1339Reputation: 1339Reputation: 1339Reputation: 1339Reputation: 1339
Quote:
Originally Posted by kikinovak View Post
Code:
kjoly@slackbox:~$ groups
users
I have a distinct feeling something is very wrong here.
Code:
less /etc/login.defs
 
Old 10-18-2014, 03:08 AM   #4
drmozes
Slackware Contributor
 
Registered: Apr 2008
Distribution: Slackware
Posts: 1,595

Rep: Reputation: 1339Reputation: 1339Reputation: 1339Reputation: 1339Reputation: 1339Reputation: 1339Reputation: 1339Reputation: 1339Reputation: 1339Reputation: 1339
Quote:
Originally Posted by drmozes View Post
Code:
less /etc/login.defs
Actually, I wonder whether we can remove this from adduser now - since I think that those extra groups are relevant for a user sitting at the computer.
 
Old 10-18-2014, 03:23 AM   #5
GazL
LQ Veteran
 
Registered: May 2008
Posts: 7,014

Rep: Reputation: 5144Reputation: 5144Reputation: 5144Reputation: 5144Reputation: 5144Reputation: 5144Reputation: 5144Reputation: 5144Reputation: 5144Reputation: 5144Reputation: 5144
If I remember rightly, they only get applied when you login on a tty but not through the local X11 display manager. Because of this, I'd rather see them removed from login.defs than adduser.

Also, I vaguely remember something about dbus not playing well with CONSOLE_GROUPS.

Last edited by GazL; 10-18-2014 at 03:25 AM.
 
Old 10-18-2014, 07:11 AM   #6
Didier Spaier
LQ Addict
 
Registered: Nov 2008
Location: Paris, France
Distribution: Slint64-15.0
Posts: 11,182

Rep: Reputation: Disabled
I'd favor not modifying adduser if possible. Just because I'm a bit lazy, adduser (internationalized) is used at the end of the CONFIGURE step in Slint installers and therefore localized (11 locales beyond en_US at time of writing).

We could handle a small change however, preferably on the occasion of a new Slackware release then
 
Old 10-18-2014, 08:07 AM   #7
allend
LQ 5k Club
 
Registered: Oct 2003
Location: Melbourne
Distribution: Slackware64-15.0
Posts: 6,449

Rep: Reputation: 2788Reputation: 2788Reputation: 2788Reputation: 2788Reputation: 2788Reputation: 2788Reputation: 2788Reputation: 2788Reputation: 2788Reputation: 2788Reputation: 2788
I am with GazL and Didier Spaier on this one. It would be better to comment out CONSOLE_GROUPS in /etc/login.defs and leave it to the system administrator to assign groups via adduser when adding a user to the system.
 
Old 10-18-2014, 08:47 AM   #8
Alien Bob
Slackware Contributor
 
Registered: Sep 2005
Location: Eindhoven, The Netherlands
Distribution: Slackware
Posts: 8,559

Rep: Reputation: 8116Reputation: 8116Reputation: 8116Reputation: 8116Reputation: 8116Reputation: 8116Reputation: 8116Reputation: 8116Reputation: 8116Reputation: 8116Reputation: 8116
GazL is correct, nothing is wrong with adduser or login.defs. The user logged in at the console gets implicitly added to several groups that are related to the local peripherals. A user logged in through a graphical display manager can do so from anywhere - while sitting at the machine but also from the other end of the world over the network using XDMCP. In the patter case the user needs to be added to these groups explicitly or else he won't be able to control the machine fully. U user who only logs in remotely does not require to be added to the additonal groups since he will never interact with the machine locally.

Therefore, all is as it should be and nothing needs to be changed.

Eric
 
2 members found this post helpful.
Old 10-18-2014, 09:41 AM   #9
GazL
LQ Veteran
 
Registered: May 2008
Posts: 7,014

Rep: Reputation: 5144Reputation: 5144Reputation: 5144Reputation: 5144Reputation: 5144Reputation: 5144Reputation: 5144Reputation: 5144Reputation: 5144Reputation: 5144Reputation: 5144
Hmm. I think I clouded the issue by adding that aside saying that "I comment them out". I wasn't trying to infer that it is incorrect. Sorry about that - should have been clearer.

If they were commented out by default then that'd certainly suit me, as I prefer for users not to receive additional group membership simply because they're logging in on a virtual console, but its just a preference, nothing more, and I'm quite happy to go on changing it locally post-install.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
LXer: Bug Hunting with Linux (The story of the Samsung Ultrabooks lid close / AC status bug) LXer Syndicated Linux News 0 02-25-2014 06:30 PM
LXer: How to file bug-free bug report in KDE LXer Syndicated Linux News 0 04-06-2013 09:03 PM
Bug#314905 bug fix for Ubuntu and gcc is 4.4.1 bostan Linux - General 1 12-11-2010 12:35 PM
[BUG] Current pkgtools installpkg bug jazzor Slackware 7 04-16-2009 05:30 AM
LXer: 2008 CES: Bug Labs Introduces BUG, BUGbase. So Cool! LXer Syndicated Linux News 0 01-09-2008 01:21 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware

All times are GMT -5. The time now is 07:03 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration