Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 5629 - Default shell in /etc/passwd
Summary: Default shell in /etc/passwd
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: [OLD] Core system (show other bugs)
Hardware: x86 Linux
: High major (vote)
Assignee: Martin Schlemmer (RETIRED)
URL:
Whiteboard:
Keywords:
: 9374 (view as bug list)
Depends on: 5699
Blocks:
  Show dependency tree
 
Reported: 2002-07-26 19:49 UTC by Mauro Sciaccaluga
Modified: 2003-02-04 19:42 UTC (History)
2 users (show)

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


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Mauro Sciaccaluga 2002-07-26 19:49:29 UTC
I've noticed when you add a user in /etc/passwd without a spicified shell (like
/bin/sh, /bin/bash, so forth), the variable $SHELL assumes to be void. So some
application like gnome-terminal dont work correctly. It should be : if ($SHELL
== '') then SHELL="/bin/sh"; at least.

bye
Comment 1 Martin Schlemmer (RETIRED) gentoo-dev 2002-07-27 12:09:35 UTC
You need to be more specific as what you think is broked/want changed.
Comment 2 Mauro Sciaccaluga 2002-07-27 13:13:46 UTC
What more can I say? Try to install gnome-terminal using a new account without a
psecified shell like:

sciack:x:406:100:Mauro Sciaccaluga:/home/sciack:

instead of:

sciack:x:406:100:Mauro Sciaccaluga:/home/sciack:/bin/bash

I think that if someone doesnt specify his preferred shell login should assume
/bin/sh as default shell.


Comment 3 Martin Schlemmer (RETIRED) gentoo-dev 2002-07-27 14:34:39 UTC
It is the way that adduser from shadow works ....

If you really want that changed, guess you will have to do a bugreport with
them, or patch adduser.
Comment 4 Mauro Sciaccaluga 2002-07-27 15:18:49 UTC
Hey.. I'm not talking about "adduser".. this is a strage behaviour of LOGIN (i
think)... the variable $SHELL should point always to a DEFAULT SHELL like
/bin/sh. But it doesnt. Please try to understand what I'm saying...

bye
Comment 5 Martin Schlemmer (RETIRED) gentoo-dev 2002-07-27 15:57:31 UTC
$SHELL will point to the shell in /etc/passwd.  Thus if you do not have one
defined, and want what you want, you must either:

1) hack adduser to add a shell by default if not specified

2) hack login to set $SHELL to something if one is not defined by default in
   /etc/passwd.

Either means patching some or other util to behave as not expected in general.
Point is, the guru's that designed these decided not to set anything by default
if not defined.

In general, the admin who adds accounts, *should* know to also define a default
shell for the user if required.
Comment 6 Mauro Sciaccaluga 2002-07-28 09:17:10 UTC
I thought you were right... but investigating i discover that by default it
should work:

        /*
         * Create the SHELL environmental variable and export it.
         */
        if (info->pw_shell == (char *) 0 || ! *info->pw_shell) {
                static char temp_pw_shell[] = "/bin/sh";
                info->pw_shell = temp_pw_shell;
        }
        addenv("SHELL", info->pw_shell);

libmisc/setupenv.c, setup_env function, in pam_login package. Take a look. thanks
Comment 7 Mauro Sciaccaluga 2002-07-28 09:23:09 UTC
I discovered: if i do an adduser testing and logging in as testing and doing
echo $SHELL, it works. So login works. But if I do it with GDM or KDM, it doesnt.
Comment 8 SpanKY gentoo-dev 2002-08-02 23:15:47 UTC
Similar bugs:
http://bugs.gentoo.org/show_bug.cgi?id=4313
http://bugs.gentoo.org/show_bug.cgi?id=4955
http://bugs.gentoo.org/show_bug.cgi?id=5629
http://bugs.gentoo.org/show_bug.cgi?id=5683
http://bugs.gentoo.org/show_bug.cgi?id=5699

everyone has something diff to say ... think it should all be wrapped up and 
put into 1 bundle though ;)
Comment 9 SpanKY gentoo-dev 2002-10-20 10:00:45 UTC
*** Bug 9374 has been marked as a duplicate of this bug. ***
Comment 10 Martin Schlemmer (RETIRED) gentoo-dev 2002-12-24 20:54:49 UTC
Added /etc/default/useradd with default shell of /bin/bash to shadow-4.0.3-r3.