Bug 107223

Summary: chsh does not assign /bin/sh as shell
Product: Red Hat Enterprise Linux 2.1 Reporter: Chris Van Hoof <vanhoof>
Component: util-linuxAssignee: Elliot Lee <sopwith>
Status: CLOSED NOTABUG QA Contact: Ben Levenson <benl>
Severity: low Docs Contact:
Priority: medium    
Version: 2.1   
Target Milestone: ---   
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2003-10-28 14:17:09 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Chris Van Hoof 2003-10-15 22:32:41 UTC
Description of problem:
When using chsh to change a users shell to /bin/sh, in this case root nothing is
assigned.  I can reproduce this on all RHL 7.x, 8, 9 and RHEL 2.1

This is not reproducable on Fedora Core or the Beta release for RHEL

Version-Release number of selected component (if applicable):

util-linux-2.11f-20 ; RHEL
util-linux-2.11y-9 ; RHL9

How reproducible:

Easily Reproduced:

[root@crashtestdummy root]# echo $SHELL
/bin/bash
[root@crashtestdummy root]# chsh
Changing shell for root.
New shell [/bin/bash]: /bin/sh
Shell changed.
[root@crashtestdummy root]# finger root
Login: root                             Name: root
Directory: /root                        Shell: /bin/sh
On since Wed Oct 15 11:23 (EDT) on tty1    3 minutes 42 seconds idle
On since Wed Oct 15 11:30 (EDT) on pts/0 from unplugged.rdu.redhat.com
Mail forwarded to vanhoof
New mail received Mon Oct 13 04:06 2003 (EDT)
     Unread since Fri Sep 26 13:33 2003 (EDT)
No Plan.
[root@crashtestdummy root]# grep ^root /etc/passwd
root:x:0:0:root:/root:

[root@crashtestdummy root]# chsh
Changing shell for root.
New shell [/bin/sh]: /bin/bash
Shell changed.
[root@crashtestdummy root]# grep ^root /etc/passwd
root:x:0:0:root:/root:/bin/bash
[root@crashtestdummy root]#


Steps to Reproduce:
1. As root run chsh and select /bin/sh as shell
2. Look at entry in /etc/passwd for shell
3. Attempt a login
    
Actual results:

Login attempts fail

Expected results:

Shell changed to /bin/sh

Additional info:

Any other shell ( ksh, zsh, tcsh ) all change fine with chsh

Comment 1 Elliot Lee 2003-10-28 14:17:09 UTC
Login treats an empty shell field as /bin/sh, so all is well. I think this is
intentional behaviour by chsh.