nss-pam-ldapd icon indicating copy to clipboard operation
nss-pam-ldapd copied to clipboard

chsh.ldap fails on every shell

Open miklcct opened this issue 1 year ago • 0 comments

chsh.ldap says every shell is an invalid shell:

[michael@vps ~]$ cat /etc/shells
# /etc/shells: valid login shells
/bin/sh
/bin/dash
/bin/bash
/bin/rbash
/usr/bin/fish
[michael@vps ~]$ chsh.ldap -s /usr/bin/fish
/usr/bin/chsh.ldap: /usr/bin/fish is an invalid shell
[michael@vps ~]$ chsh.ldap -s /bin/bash
/usr/bin/chsh.ldap: /bin/bash is an invalid shell

The following python script illustrate the source of the problem:

#!/usr/bin/env python3
import sys

sys.path.append('/usr/share/nslcd-utils')
import shells

for shell in shells.list_shells():
    print(shell)

print(shells.check('/bin/bash'))

Output:

b'/bin/sh'
b'/bin/dash'
b'/bin/bash'
b'/bin/rbash'
b'/usr/bin/fish'
./test.py: /bin/bash is an invalid shell

miklcct avatar Oct 09 '23 14:10 miklcct