Generating salt value depends on /dev/urandom. But after the
function process_root_flag changed the root directory, It does
not exist.
So, generate salt value before changeing the directory.
Fixes: #514
(void) bindtextdomain (PACKAGE, LOCALEDIR);
(void) textdomain (PACKAGE);
- process_root_flag ("-R", argc, argv);
-
process_flags (argc, argv);
+ salt = get_salt();
+ process_root_flag ("-R", argc, argv);
+
#ifdef USE_PAM
if (md5flg || eflg || cflg) {
use_pam = false;
const struct passwd *pw;
struct passwd newpw;
- salt = get_salt();
if (salt) {
cp = pw_encrypt (newpwd, salt);
if (NULL == cp) {