]> git.ipfire.org Git - thirdparty/shadow.git/commit
lib/: Include <gshadow.h> if it's available
authorAlejandro Colomar <alx@kernel.org>
Wed, 6 Nov 2024 13:19:12 +0000 (14:19 +0100)
committerAlejandro Colomar <alx@kernel.org>
Fri, 24 Jan 2025 11:10:15 +0000 (12:10 +0100)
commitc30fdba8ad4eaf7daa78b74e2c2ed0909c985ea5
tree05fe8f65c4f79b885f24bc7228eeabcd3e2cb9fa
parent76727c324d60d74861c87af9db646922c524022f
lib/: Include <gshadow.h> if it's available

The existing code was assuming that libc's <shadow.h> includes
<gshadow.h>.  That's not true.

alx@debian:~$ find /usr/include/shadow.h
/usr/include/shadow.h
alx@debian:~$ find /usr/include/gshadow.h
/usr/include/gshadow.h
alx@debian:~$ grep include.*gshadow /usr/include/shadow.h
alx@debian:~$

As a result, we were unconditionally including our own "gshadow_.h".

Fix that incorrect assumption, and do the following instead:

-  Include unconditionally our own "gshadow_.h".
-  Make our "gshadow_.h" include <gshadow.h> if it exists,
   and only provide the declarations otherwise.

While at it, fix the include guard to be consistent with the project.

Reviewed-by: Serge Hallyn <serge@hallyn.com>
Signed-off-by: Alejandro Colomar <alx@kernel.org>
lib/defines.h
lib/gshadow_.h