]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
basic/user-util: properly protect use of gshadow
authorYann E. MORIN <yann.morin.1998@free.fr>
Wed, 21 Nov 2018 17:09:04 +0000 (18:09 +0100)
committerLennart Poettering <lennart@poettering.net>
Wed, 21 Nov 2018 23:57:08 +0000 (00:57 +0100)
Commit 100d5f6ee6 (user-util: add new wrappers for [...] database
files), ammended by commit 4f07ffa8f5 (Use #if instead of #ifdef for
ENABLE_GSHADOW) moved code from sysuser to basic/user-util.

In doing so, the combination of both commits properly propagated the
ENABLE_GSHADOW conditions around the function manipulating gshadow, but
they forgot to protect the inclusion of the gshadow.h header.

Fix that to be able to build on C libraries that do not provide gshadow
(e.g. uClibc-ng, where it does not exist.)

src/basic/user-util.h

index b6de0e4234040a782b75e96c505f04856dc16088..cc899ee76f7bb0bfc2ce63ed75cca1fc0522b90d 100644 (file)
@@ -2,7 +2,9 @@
 #pragma once
 
 #include <grp.h>
+#if ENABLE_GSHADOW
 #include <gshadow.h>
+#endif
 #include <pwd.h>
 #include <shadow.h>
 #include <stdbool.h>