if (!escaped_name)
return log_oom();
- id = strappenda("cryptsetup:", escaped_name);
+ id = strjoina("cryptsetup:", escaped_name);
r = ask_password_auto(text, "drive-harddisk", id, until, accept_cached, passwords);
if (r < 0)
if (asprintf(&text, "Please enter passphrase for disk %s! (verification)", name) < 0)
return log_oom();
- id = strappenda("cryptsetup-verification:", escaped_name);
+ id = strjoina("cryptsetup-verification:", escaped_name);
r = ask_password_auto(text, "drive-harddisk", id, until, false, &passwords2);
if (r < 0)
/* Ideally we'd do this on the open fd, but since this is just a
* warning it's OK to do this in two steps. */
- if (stat(key_file, &st) >= 0 && (st.st_mode & 0005)) {
- if(!STR_IN_SET(key_file, "/dev/urandom", "/dev/random", "/dev/hw_random"))
- log_warning("Key file %s is world-readable. This is not a good idea!", key_file);
- }
+ if (stat(key_file, &st) >= 0 && S_ISREG(st.st_mode) && (st.st_mode & 0005))
+ log_warning("Key file %s is world-readable. This is not a good idea!", key_file);
}
for (tries = 0; arg_tries == 0 || tries < arg_tries; tries++) {