aboutsummaryrefslogtreecommitdiff
path: root/libshouldbeinlibc/idvec-verify.c
diff options
context:
space:
mode:
Diffstat (limited to 'libshouldbeinlibc/idvec-verify.c')
-rw-r--r--libshouldbeinlibc/idvec-verify.c15
1 files changed, 7 insertions, 8 deletions
diff --git a/libshouldbeinlibc/idvec-verify.c b/libshouldbeinlibc/idvec-verify.c
index a7d95761..1c4bc494 100644
--- a/libshouldbeinlibc/idvec-verify.c
+++ b/libshouldbeinlibc/idvec-verify.c
@@ -27,12 +27,15 @@
#include <grp.h>
#include <pwd.h>
#include <shadow.h>
+#ifdef HAVE_LIBCRYPT
#include <crypt.h>
+#else
+#warning "No crypt on this system! Using plain-text passwords."
+#define crypt(password, encrypted) password
+#endif
#define SHADOW_PASSWORD_STRING "x" /* pw_passwd contents for shadow passwd */
-#pragma weak crypt
-
static error_t verify_id (); /* FWD */
/* Get a password from the user, returning it in malloced storage. */
@@ -71,12 +74,8 @@ verify_passwd (const char *password,
if (sys_encrypted[0] == '\0')
return 0; /* No password. */
- if (crypt)
- /* Encrypt the password entered by the user (SYS_ENCRYPTED is the salt). */
- encrypted = crypt (password, sys_encrypted);
- else
- /* No crypt on this system! Use plain-text passwords. */
- encrypted = password;
+ /* Encrypt the password entered by the user (SYS_ENCRYPTED is the salt). */
+ encrypted = crypt (password, sys_encrypted);
if (! encrypted)
/* Crypt failed. */