FS#32893 - [shadow] adduser script does not respect SHELL in /etc/defaults/useradd

Attached to Project: Arch Linux
Opened by Josh (codekoala) - Wednesday, 28 November 2012, 19:57 GMT
Last edited by Dave Reisner (falconindy) - Sunday, 13 January 2013, 21:00 GMT
Task Type Bug Report
Category Packages: Core
Status Closed
Assigned To Dave Reisner (falconindy)
Architecture All
Severity Low
Priority Normal
Reported Version
Due in Version Undecided
Due Date Undecided
Percent Complete 100%
Votes 0
Private No

Details

Apologies if this should be categorized as a FR. It feels like a bug to me given the contents of the shadow package at https://projects.archlinux.org/svntogit/packages.git/tree/trunk?h=packages/shadow including both useradd.defaults and the adduser script.

Description:
Customizing the SHELL variable in /etc/default/useradd has no effect on the adduser script in Arch's shadow package. The default shell for the adduser script is hardcoded on line 91: https://projects.archlinux.org/svntogit/packages.git/tree/trunk/adduser?h=packages/shadow#n91 It should be easy enough to source the /etc/default/useradd script and set defshell=$SHELL or at least to grep the default SHELL out of /etc/default/useradd.


Additional info:
* package version(s) shadow 4.1.5.1-2


Steps to reproduce:
* Set the default shell for useradd: useradd -Ds /bin/zsh
* Verify the shell has changed: useradd -D
* Execute the adduser script and note that the default shell remains /bin/bash
This task depends upon

Closed by  Dave Reisner (falconindy)
Sunday, 13 January 2013, 21:00 GMT
Reason for closing:  Fixed
Additional comments about closing:  removed adduser in testing/shadow-4.1.5.1-3
Comment by Dave Reisner (falconindy) - Wednesday, 28 November 2012, 21:10 GMT
Solution: don't use adduser? I think I'd rather just stop shipping this script. This isn't the only bug/feature it has.
Comment by Greg (dolby) - Wednesday, 28 November 2012, 22:53 GMT
+1 on dropping this. This is a Slackware script with the difference that Slackware actually maintains this.
Arch's is the same from 2004.
Comment by Josh (codekoala) - Wednesday, 28 November 2012, 23:18 GMT
That's certainly a solution. If there's only one "official" way to handle the creation of new users, there'd be less room for problems like this to arise. Being a former Slacker, I do think I would feel a big deprived at first, but I can learn to deal with it ;)

EDIT: For those who come here looking for adduser, I've created two packages in the AUR for it. One is the original script from Slackware and the other is one patched to handle the bug reported here:

Vanilla: https://aur.archlinux.org/packages/adduser/
Patched: https://aur.archlinux.org/packages/adduser-defaults/

Loading...