passwd,cryptpw: make default encryption algorithm configurable
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
This commit is contained in:
parent
3e0c428c45
commit
d45efd3a9f
@ -283,6 +283,13 @@ config CHPASSWD
|
|||||||
Reads a file of user name and password pairs from standard input
|
Reads a file of user name and password pairs from standard input
|
||||||
and uses this information to update a group of existing users.
|
and uses this information to update a group of existing users.
|
||||||
|
|
||||||
|
config FEATURE_DEFAULT_PASSWD_ALGO
|
||||||
|
string "Default password encryption method (passwd -a, cryptpw -m parameter)"
|
||||||
|
default "des"
|
||||||
|
depends on PASSWD || CRYPTPW
|
||||||
|
help
|
||||||
|
Possible choices are "d[es]", "m[d5]", "s[ha256]" or "sha512".
|
||||||
|
|
||||||
config SU
|
config SU
|
||||||
bool "su"
|
bool "su"
|
||||||
default y
|
default y
|
||||||
|
@ -20,6 +20,8 @@
|
|||||||
//usage: "\n -m Use MD5 encryption instead of DES"
|
//usage: "\n -m Use MD5 encryption instead of DES"
|
||||||
//usage: )
|
//usage: )
|
||||||
|
|
||||||
|
//TODO: implement -c ALGO
|
||||||
|
|
||||||
#if ENABLE_LONG_OPTS
|
#if ENABLE_LONG_OPTS
|
||||||
static const char chpasswd_longopts[] ALIGN1 =
|
static const char chpasswd_longopts[] ALIGN1 =
|
||||||
"encrypted\0" No_argument "e"
|
"encrypted\0" No_argument "e"
|
||||||
|
@ -105,7 +105,7 @@ int cryptpw_main(int argc UNUSED_PARAM, char **argv)
|
|||||||
applet_long_options = mkpasswd_longopts;
|
applet_long_options = mkpasswd_longopts;
|
||||||
#endif
|
#endif
|
||||||
fd = STDIN_FILENO;
|
fd = STDIN_FILENO;
|
||||||
opt_m = "d";
|
opt_m = CONFIG_FEATURE_DEFAULT_PASSWD_ALGO;
|
||||||
opt_S = NULL;
|
opt_S = NULL;
|
||||||
/* at most two non-option arguments; -P NUM */
|
/* at most two non-option arguments; -P NUM */
|
||||||
opt_complementary = "?2:P+";
|
opt_complementary = "?2:P+";
|
||||||
|
@ -94,7 +94,7 @@ int passwd_main(int argc UNUSED_PARAM, char **argv)
|
|||||||
};
|
};
|
||||||
unsigned opt;
|
unsigned opt;
|
||||||
int rc;
|
int rc;
|
||||||
const char *opt_a = "d"; /* des */
|
const char *opt_a = CONFIG_FEATURE_DEFAULT_PASSWD_ALGO;
|
||||||
const char *filename;
|
const char *filename;
|
||||||
char *myname;
|
char *myname;
|
||||||
char *name;
|
char *name;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user