From: Arnaud Rebillout <arnaudr@kali.org>
Date: Mon, 27 May 2024 10:13:10 +0700
Subject: Fix implicit-function-declaration errors
MIME-Version: 1.0
Content-Type: text/plain; charset="utf-8"
Content-Transfer-Encoding: 8bit

```
rules.c: In function ‘Char2Int’:
rules.c:477:18: error: implicit declaration of function ‘elcid_pwsize’ [-Werror=implicit-function-declaration]
  477 |         pwsize = elcid_pwsize();
```

```
elcid.c: In function ‘elcid_test’:
elcid.c:33:18: error: implicit declaration of function ‘crypt’ [-Werror=implicit-function-declaration]
   33 | #define CRYPTALG crypt
```

```
cracker.c: In function ‘Logger’:
cracker.c:108:5: error: implicit declaration of function ‘time’ [-Werror=implicit-function-declaration]
  108 |     time(&t);
```
---
 src/lib/rules.c      | 3 +++
 src/util/cracker.c   | 2 ++
 src/util/elcid.c     | 1 +
 src/util/elcid.c,bsd | 1 +
 4 files changed, 7 insertions(+)

diff --git a/src/lib/rules.c b/src/lib/rules.c
index 5d4a8af..3525287 100644
--- a/src/lib/rules.c
+++ b/src/lib/rules.c
@@ -466,6 +466,9 @@ char class;
 
 /* -------- BACK TO NORMALITY -------- */
 
+// defined in src/util/elcid.c
+extern int elcid_pwsize();
+
 int
 Char2Int(character)
 char character;
diff --git a/src/util/cracker.c b/src/util/cracker.c
index 8e73636..5d8d52c 100644
--- a/src/util/cracker.c
+++ b/src/util/cracker.c
@@ -9,6 +9,8 @@
    # document which accompanies distributions of Crack v5.0 and upwards.
  */
 
+#include <time.h>
+
 #include "libcrack.h"
 #include "elcid.h"
 
diff --git a/src/util/elcid.c b/src/util/elcid.c
index 6c52753..0bc4386 100644
--- a/src/util/elcid.c
+++ b/src/util/elcid.c
@@ -30,6 +30,7 @@ static char private_salt[SALTSIZE + 1];
 #define CRYPTALG fcrypt
 #endif /* CRYPT16 */
 #ifndef CRYPTALG /* fall thry default */
+#include <crypt.h>
 #define CRYPTALG crypt
 #endif /* CRYPTALG */
 
diff --git a/src/util/elcid.c,bsd b/src/util/elcid.c,bsd
index b5a0048..2e63a4d 100644
--- a/src/util/elcid.c,bsd
+++ b/src/util/elcid.c,bsd
@@ -33,6 +33,7 @@ static char private_salt[SALTSIZE + 1];
 #undef CRYPT16
 
 #undef CRYPTALG
+#include <crypt.h>
 #define CRYPTALG crypt
 
 #define EBS             1024    /* BIG number - and why not ? */
