Try to build custom "su" on Ubuntu 20.04, but start from original sources for test (without changes).
Run
apt-get source login
I got shadow-4.8.1 dir. Run
./configure
make
and try run
src/su testuser
Its does not works! Auth fail error. Run original OS binary:
/usr/bin/su testuser
and its works fine!
Wtf?
I think some modules/params is missing in build process.
Going to buildlog of shadow package.
https://launchpad.net/ubuntu/+source/shadow/1:4.11.1+dfsg1-2ubuntu1/+build/23780688
and see next ./configure string
./configure --build=x86_64-linux-gnu --prefix=/usr --includedir=\${prefix}/include --mandir=\${prefix}/share/man --infodir=\${prefix}/share/info --sysconfdir=/etc --localstatedir=/var --disable-silent-rules --libdir=\${prefix}/lib/x86_64-linux-gnu --runstatedir=/run --disable-maintainer-mode --disable-dependency-tracking --disable-shared --without-libcrack --mandir=/usr/share/man --with-libpam --enable-shadowgrp --enable-man --disable-account-tools-setuid --with-group-name-max-length=32 --without-acl --without-attr --without-su --without-tcb
See there:
--without-su
Try this ./configure string and its really make all binaries without "su". Try replace it on
--with-su
And new binary dont work too. Auth fail. :(
Two questions about it.
- Where can i find buildlog of original "su"?
- Why fresh builded "su" cant see real OS user, which exists in /etc/shadow|passwd?