FS#55053 - [mksh] pkexec fails because $SHELL is not listed in /etc/shells
Attached to Project:
Community Packages
Opened by Matthew T. Hoare (Head_on_a_Stick) - Sunday, 06 August 2017, 18:16 GMT
Last edited by Eli Schwartz (eschwartz) - Thursday, 17 May 2018, 16:04 GMT
Opened by Matthew T. Hoare (Head_on_a_Stick) - Sunday, 06 August 2017, 18:16 GMT
Last edited by Eli Schwartz (eschwartz) - Thursday, 17 May 2018, 16:04 GMT
|
Details
Description:
If /usr/bin/mksh is not added to /etc/shells then pkexec will not work because $SHELL is set to that value. Error message: "The value for the SHELL variable was not found in the /etc/shells file This incident has been reported." Additional info: * package version(s) 55-1 * config and/or log files etc. Stock /etc/skel/.mkshrc copied to $HOME * kernel version linux-hardened 4.12.4.a-1 Steps to reproduce: `gparted_polkit` (or `pkexec foo`) |
This task depends upon
Closed by Eli Schwartz (eschwartz)
Thursday, 17 May 2018, 16:04 GMT
Reason for closing: Fixed
Additional comments about closing: mksh 56.c-3
Thursday, 17 May 2018, 16:04 GMT
Reason for closing: Fixed
Additional comments about closing: mksh 56.c-3
The problem is that pkexec expects to find $SHELL listed in /etc/shells but /etc/skel/.mkshrc sets this to $MKSH, which is /usr/bin/mksh in Arch.
My mksh AUR packages now add /usr/bin/mksh to /etc/shells and do not suffer this error.
where is this set? Can't reproduce here.
It is probably also worth noting that Arch's zsh package does add /usr/bin/zsh to /etc/shells in it's install script, presumably for this reason.
\: "${MKSH:=$(\\builtin whence -p mksh)}${MKSH:=/bin/mksh}"
which returns /bin/mksh.
No, it is not:
`empty@Xanadu:~ $ echo $PATH
/home/empty/bin:/usr/local/bin:/usr/local/sbin:/usr/bin:/usr/bin/site_perl:/usr/bin/vendor_perl:/usr/bin/core_perl:/usr/lib/plan9/bin`
Adding /bin to PATH does not change the error.
I have just reproduced the problem with a fresh user, here are my exact steps:
Create user with: `useradd -m -s /bin/mksh test && passwd test`
Log in with user "test" and run `pkexec gparted` to produce the error.
From the new user, `echo $MKSH` produces "/usr/bin/mksh" and /bin is not in PATH.
The error does not occur if I switch to my usual mksh-static-git package from the AUR, that package adds /usr/bin/mksh to /etc/shells (as does the Arch zsh package with /usr/bin/zsh).
> Is /bin in you PATH?
Not since filesystem 2013.05-2 which removed it: https://git.archlinux.org/svntogit/packages.git/commit/trunk?h=packages/filesystem&id=3566438bf5174d9ac71432d59c248da08f70c7ac
Are you using a non-default setup that adds this "redundant entries" for unreproducible effects? :p
$ arch-nspawn /path/to/new/chroot pacman -Syu mksh
[...]
$ arch-nspawn /path/to/new/chroot mksh -c 'whence -p mksh'
/usr/bin/mksh
$ type -a bash
bash is /usr/bin/bash # but nothing does $SHELL lookup like that, since bash sets it internally, mksh doesn't
I'm unsure why this is controversial anyway, fixed in mksh 56.c-3