summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorDenis Vlasenko2008-06-12 16:55:59 +0000
committerDenis Vlasenko2008-06-12 16:55:59 +0000
commit4ea83bf562c44a6792e7c77e7d87cba91f86f763 (patch)
tree64dba9163b29724e282c1e94027001a11978e74b /include
parent9de462205542547694299e9fe2bc321088ab79aa (diff)
downloadbusybox-4ea83bf562c44a6792e7c77e7d87cba91f86f763.zip
busybox-4ea83bf562c44a6792e7c77e7d87cba91f86f763.tar.gz
uclibc insists on having 70k static buffer for crypt.
For bbox it's not acceptable. Roll our own des and md5 crypt implementation. Against older uclibc: text data bss dec hex filename 759945 604 6684 767233 bb501 busybox_old 759766 604 6684 767054 bb44e busybox_unstripped so, we still save on code size.
Diffstat (limited to 'include')
-rw-r--r--include/libbb.h22
1 files changed, 10 insertions, 12 deletions
diff --git a/include/libbb.h b/include/libbb.h
index 97aae0b..bd2dbe5 100644
--- a/include/libbb.h
+++ b/include/libbb.h
@@ -1032,18 +1032,8 @@ extern int restricted_shell(const char *shell);
extern void setup_environment(const char *shell, int clear_env, int change_env, const struct passwd *pw);
extern int correct_password(const struct passwd *pw);
/* Returns a ptr to static storage */
-extern char *pw_encrypt(const char *clear, const char *salt);
+extern char *pw_encrypt(const char *clear, const char *salt, int cleanup);
extern int obscure(const char *old, const char *newval, const struct passwd *pwdp);
-
-int index_in_str_array(const char *const string_array[], const char *key);
-int index_in_strings(const char *strings, const char *key);
-int index_in_substr_array(const char *const string_array[], const char *key);
-int index_in_substrings(const char *strings, const char *key);
-const char *nth_string(const char *strings, int n);
-
-extern void print_login_issue(const char *issue_file, const char *tty);
-extern void print_login_prompt(void);
-
/* rnd is additional random input. New one is returned.
* Useful if you call crypt_make_salt many times in a row:
* rnd = crypt_make_salt(buf1, 4, 0);
@@ -1052,11 +1042,19 @@ extern void print_login_prompt(void);
* (otherwise we risk having same salt generated)
*/
extern int crypt_make_salt(char *p, int cnt, int rnd);
-
/* Returns number of lines changed, or -1 on error */
extern int update_passwd(const char *filename, const char *username,
const char *new_pw);
+int index_in_str_array(const char *const string_array[], const char *key);
+int index_in_strings(const char *strings, const char *key);
+int index_in_substr_array(const char *const string_array[], const char *key);
+int index_in_substrings(const char *strings, const char *key);
+const char *nth_string(const char *strings, int n);
+
+extern void print_login_issue(const char *issue_file, const char *tty);
+extern void print_login_prompt(void);
+
/* NB: typically you want to pass fd 0, not 1. Think 'applet | grep something' */
int get_terminal_width_height(int fd, unsigned *width, unsigned *height);