aboutsummaryrefslogtreecommitdiff
path: root/libbb
diff options
context:
space:
mode:
authoraldot <aldot@69ca8d6d-28ef-0310-b511-8ec308f3f277>2006-05-19 12:30:00 +0000
committeraldot <aldot@69ca8d6d-28ef-0310-b511-8ec308f3f277>2006-05-19 12:30:00 +0000
commit2a3cf942949522c245ed5525018dc9c205d642b1 (patch)
tree91766f417783ee69b93d44f1a39a70e874285f98 /libbb
parentbd16aecbd1d9654275c751a884a714bd4f99386e (diff)
downloadbusybox-w32-2a3cf942949522c245ed5525018dc9c205d642b1.tar.gz
busybox-w32-2a3cf942949522c245ed5525018dc9c205d642b1.tar.bz2
busybox-w32-2a3cf942949522c245ed5525018dc9c205d642b1.zip
- include strings.h
Thanks to Rich Felker for pointing this out. git-svn-id: svn://busybox.net/trunk/busybox@15124 69ca8d6d-28ef-0310-b511-8ec308f3f277
Diffstat (limited to 'libbb')
-rw-r--r--libbb/obscure.c15
-rw-r--r--libbb/u_signal_names.c1
2 files changed, 9 insertions, 7 deletions
diff --git a/libbb/obscure.c b/libbb/obscure.c
index a152456b2..d6a87b5de 100644
--- a/libbb/obscure.c
+++ b/libbb/obscure.c
@@ -18,12 +18,12 @@
18 This password types should not be permitted: 18 This password types should not be permitted:
19 a) pure numbers: birthdates, social security number, license plate, phone numbers; 19 a) pure numbers: birthdates, social security number, license plate, phone numbers;
20 b) words and all letters only passwords (uppercase, lowercase or mixed) 20 b) words and all letters only passwords (uppercase, lowercase or mixed)
21 as palindromes, consecutive or repetitive letters 21 as palindromes, consecutive or repetitive letters
22 or adjacent letters on your keyboard; 22 or adjacent letters on your keyboard;
23 c) username, real name, company name or (e-mail?) address 23 c) username, real name, company name or (e-mail?) address
24 in any form (as-is, reversed, capitalized, doubled, etc.). 24 in any form (as-is, reversed, capitalized, doubled, etc.).
25 (we can check only against username, gecos and hostname) 25 (we can check only against username, gecos and hostname)
26 d) common and obvious letter-number replacements 26 d) common and obvious letter-number replacements
27 (e.g. replace the letter O with number 0) 27 (e.g. replace the letter O with number 0)
28 such as "M1cr0$0ft" or "P@ssw0rd" (CAVEAT: we cannot check for them 28 such as "M1cr0$0ft" or "P@ssw0rd" (CAVEAT: we cannot check for them
29 without the use of a dictionary). 29 without the use of a dictionary).
@@ -42,12 +42,13 @@
42#include <ctype.h> 42#include <ctype.h>
43#include <unistd.h> 43#include <unistd.h>
44#include <string.h> 44#include <string.h>
45#include <strings.h>
45 46
46#include "libbb.h" 47#include "libbb.h"
47 48
48 49
49/* passwords should consist of 6 (to 8 characters) */ 50/* passwords should consist of 6 (to 8 characters) */
50#define MINLEN 6 51#define MINLEN 6
51 52
52 53
53static int string_checker_helper(const char *p1, const char *p2) __attribute__ ((__pure__)); 54static int string_checker_helper(const char *p1, const char *p2) __attribute__ ((__pure__));
@@ -93,7 +94,7 @@ static int string_checker(const char *p1, const char *p2)
93#define NUMBERS 4 94#define NUMBERS 4
94#define SPECIAL 8 95#define SPECIAL 8
95 96
96static const char *obscure_msg(const char *old_p, const char *new_p, const struct passwd *pw) 97static const char *obscure_msg(const char *old_p, const char *new_p, const struct passwd *pw)
97{ 98{
98 int i; 99 int i;
99 int c; 100 int c;
@@ -107,7 +108,7 @@ static const char *obscure_msg(const char *old_p, const char *new_p, const struc
107 /* size */ 108 /* size */
108 if (!new_p || (length = strlen(new_p)) < MINLEN) 109 if (!new_p || (length = strlen(new_p)) < MINLEN)
109 return("too short"); 110 return("too short");
110 111
111 /* no username as-is, as sub-string, reversed, capitalized, doubled */ 112 /* no username as-is, as sub-string, reversed, capitalized, doubled */
112 if (string_checker(new_p, pw->pw_name)) { 113 if (string_checker(new_p, pw->pw_name)) {
113 return "similar to username"; 114 return "similar to username";
@@ -152,11 +153,11 @@ static const char *obscure_msg(const char *old_p, const char *new_p, const struc
152 return "too many similar characters"; 153 return "too many similar characters";
153 } 154 }
154 } 155 }
155 for(i=0;i<4;i++) 156 for (i=0; i<4; i++)
156 if (mixed & (1<<i)) size -= 2; 157 if (mixed & (1<<i)) size -= 2;
157 if (length < size) 158 if (length < size)
158 return "too weak"; 159 return "too weak";
159 160
160 if (old_p && old_p[0] != '\0') { 161 if (old_p && old_p[0] != '\0') {
161 /* check vs. old password */ 162 /* check vs. old password */
162 if (string_checker(new_p, old_p)) { 163 if (string_checker(new_p, old_p)) {
diff --git a/libbb/u_signal_names.c b/libbb/u_signal_names.c
index 31ebd895a..bf65fa3e9 100644
--- a/libbb/u_signal_names.c
+++ b/libbb/u_signal_names.c
@@ -11,6 +11,7 @@
11#include <signal.h> 11#include <signal.h>
12#include <ctype.h> 12#include <ctype.h>
13#include <string.h> 13#include <string.h>
14#include <strings.h>
14#include <stdlib.h> 15#include <stdlib.h>
15#include <stdio.h> 16#include <stdio.h>
16 17