mkpasswd: include crypt.h on Solaris

This commit is contained in:
Marco d'Itri 2018-09-16 04:34:58 +02:00
parent c12ad950fa
commit ae31f61a34
3 changed files with 4 additions and 3 deletions

View File

@ -52,14 +52,14 @@ DEFS += -DHAVE_ICONV
endif
ifeq ($(shell $(PKG_CONFIG) --exists 'libxcrypt >= 4.1' || echo NO),)
DEFS += -DHAVE_LINUX_CRYPT_GENSALT $(shell $(PKG_CONFIG) --cflags libcrypt)
DEFS += -DHAVE_CRYPT_H -DHAVE_LINUX_CRYPT_GENSALT $(shell $(PKG_CONFIG) --cflags libcrypt)
mkpasswd_LDADD += $(shell $(PKG_CONFIG) --libs libcrypt)
else ifdef HAVE_XCRYPT
DEFS += -DHAVE_XCRYPT_H -DHAVE_LINUX_CRYPT_GENSALT
mkpasswd_LDADD += -lxcrypt
else ifdef HAVE_LIBOWCRYPT
# owl and openSUSE have crypt_gensalt(3) in libowcrypt
DEFS += -DHAVE_LINUX_CRYPT_GENSALT -D_OW_SOURCE
DEFS += -DHAVE_CRYPT_H -DHAVE_LINUX_CRYPT_GENSALT -D_OW_SOURCE
mkpasswd_LDADD += -lcrypt -lowcrypt
else
mkpasswd_LDADD += -lcrypt

View File

@ -55,6 +55,7 @@
/* Unknown versions of Solaris */
#if defined __SVR4 && defined __sun
# define HAVE_SHA_CRYPT
# define HAVE_CRYPT_H
# define HAVE_SOLARIS_CRYPT_GENSALT
# define CRYPT_GENSALT_IMPLEMENTS_DEFAULT_PREFIX
#endif

View File

@ -39,7 +39,7 @@
#include <xcrypt.h>
#include <sys/stat.h>
#endif
#ifdef HAVE_LINUX_CRYPT_GENSALT
#ifdef HAVE_CRYPT_H
#include <crypt.h>
#endif
#ifdef HAVE_GETTIMEOFDAY