Monday, March 14, 2022

[SOLVED] Question about building shadow package on Debian

Issue

I am on a Debian 10.4 system. I am trying to compile the shadow-4.5 package due to changes in the source code.

Here is my quilt procedure: (from href="https://wiki.debian.org/UsingQuilt" rel="nofollow noreferrer">https://wiki.debian.org/UsingQuilt)

$ apt-get source shadow/stable
$ export QUILT_PATCHES=debian/patches
$ export QUILT_REFRESH_ARGS="-p ab --no-timestamps --no-index"
$ quilt push -a
$ quilt new xxx_test_patch
$ quilt add <file_changed>
$ < here my source code modifications ... >
$ quilt refresh
$ quilt pop -a

And, finally build my package :

$ debuild -b -us -uc

My package compiles without problem but the binaries contained in the generated .deb files do not contain my modifications.

However, when I manually compile the binaries (with configure an make), the binaries generated in the src directory of my source tree do contain my changes.

I would like to generate the debian package (.deb) with just my modifications in addition using the tool recommended by debian "debuild".

I don't know if I forgot or did something wrong.

Thanks in advance


Solution

I post the resolution to my problem if anyone has this problem. I think I found the solution.

I didn't think of using "strings" to check the contents of the binary, I validated or not the good functioning of my binary with "strace". This allowed me to see that my modified string (/etc/test/passwd) was present in the binary compiled.

I also noticed that the binary compiled "by hand" didn't load the PAM module during the build unlike the build done with "debuild". After some research, I saw that these same absolute paths (/etc/{passwd, shadow}) are also present in the shared libraries of the libpam-modules package :

$ strings /lib/x86_64-linux-gnu/security/pam_* | grep "shadow\|passwd"

I think that's why the hand-compiled binary works, because it doesn't use the paths present in the shared libraries. The "strace" of the binary made with debuild always returns the old paths (/etc/{passwd, shadow}) because they are overloaded by the PAM module.

The solution is to also recompile the libpam-modules package with modifications.

P.



Answered By - p_linux
Answer Checked By - Clifford M. (WPSolving Volunteer)