chsh.ldap in nslcd-utils crashes with segfault
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
nss-pam-ldapd (Ubuntu) |
New
|
Undecided
|
Unassigned |
Bug Description
```
$ chsh.ldap -s $(which fish)
Segmentation fault (core dumped)
$ uname -r
4.15.0-50-generic
$ cat /etc/os-release
NAME="Ubuntu"
VERSION="18.04.3 LTS (Bionic Beaver)"
ID=ubuntu
ID_LIKE=debian
PRETTY_NAME="Ubuntu 18.04.3 LTS"
VERSION_ID="18.04"
HOME_URL="https:/
SUPPORT_URL="https:/
BUG_REPORT_URL="https:/
PRIVACY_
VERSION_
$ apt list --upgradable
Listing... Done
$ chsh.ldap --version
nss-pam-ldapd 0.9.9
Written by Arthur de Jong.
Copyright (C) 2013-2017 Arthur de Jong
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
```
Debian bug tracker: https:/
```
$ LANG=C gdb -args $(which python) $(which chsh.ldap) -s $(which fish)
GNU gdb (Ubuntu 8.2-0ubuntu1~18.04) 8.2
Copyright (C) 2018 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.
Type "show copying" and "show warranty" for details.
This GDB was configured as "x86_64-linux-gnu".
Type "show configuration" for configuration details.
For bug reporting instructions, please see:
<http://
Find the GDB manual and other documentation resources online at:
<http://
For help, type "help".
Type "apropos word" to search for commands related to "word"...
Reading symbols from /usr/bin/
(gdb) r
Starting program: /usr/bin/python /usr/bin/chsh.ldap -s /usr/bin/fish
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/lib/x86_
[Detaching after fork from child process 48187]
Program received signal SIGSEGV, Segmentation fault.
__strlen_avx2 () at ../sysdeps/
93 ../sysdeps/
(gdb) bt
#0 __strlen_avx2 () at ../sysdeps/
#1 0x0000555555621cf4 in PyString_FromString ()
#2 0x000055555565e399 in ?? ()
#3 0x00005555555a70d2 in _PyObject_
#4 0x00005555556497e0 in PyEval_EvalFrameEx ()
#5 0x0000555555661f68 in ?? ()
#6 0x00005555556eca2d in _PySequence_
#7 0x0000555555650b9c in PyEval_EvalFrameEx ()
#8 0x0000555555646d3a in PyEval_EvalCodeEx ()
#9 0x000055555564e83e in PyEval_EvalFrameEx ()
#10 0x0000555555646d3a in PyEval_EvalCodeEx ()
#11 0x00005555556467b9 in PyEval_EvalCode ()
#12 0x00005555556774df in ?? ()
#13 0x00005555556722d2 in PyRun_FileExFlags ()
#14 0x000055555567174d in PyRun_SimpleFil
#15 0x0000555555620de4 in Py_Main ()
#16 0x00007ffff7a05b97 in __libc_start_main (main=0x5555556
argv=
rtld_
#17 0x000055555562069a in _start ()
$
```
ProblemType: Bug
DistroRelease: Ubuntu 18.04
Package: nslcd-utils 0.9.9-1
ProcVersionSign
Uname: Linux 4.15.0-50-generic x86_64
ApportVersion: 2.20.9-0ubuntu7.7
Architecture: amd64
Date: Mon Oct 21 13:50:06 2019
InstallationDate: Installed on 2016-08-11 (1165 days ago)
InstallationMedia: Ubuntu-Server 16.04 LTS "Xenial Xerus" - Release amd64 (20160420.3)
PackageArchitec
ProcEnviron:
TERM=screen-
PATH=(custom, no user)
XDG_RUNTIME_
LANG=C
SHELL=/bin/bash
SourcePackage: nss-pam-ldapd
UpgradeStatus: Upgraded to bionic on 2018-11-17 (337 days ago)
Line #33 in `/usr/share/ nslcd-utils/ shells. py` causes the problem.
ctypes. c_char_ p(libc. getusershell( )) -> OK c_char_ p(libc. getusershell( )).value -> SEGFAULT!
ctypes.