aboutsummaryrefslogtreecommitdiffstats
path: root/nlplug-findfs.c
diff options
context:
space:
mode:
author7heo <7heo@mail.com>2016-07-06 01:56:18 +0200
committer7heo <7heo@mail.com>2017-04-05 12:13:36 +0200
commit369d54c6e963ece750a3b6008cabe26c4222e99e (patch)
treed2303d89801f6baedb5802b7ebb4ebcafb29a273 /nlplug-findfs.c
parent26925318e5a5af67e9aaf90fdbbf5672339861a8 (diff)
downloadmkinitfs-369d54c6e963ece750a3b6008cabe26c4222e99e.tar.bz2
mkinitfs-369d54c6e963ece750a3b6008cabe26c4222e99e.tar.xz
nlplug-findfs: alloca isn't POSIX, use stack
Diffstat (limited to 'nlplug-findfs.c')
-rw-r--r--nlplug-findfs.c9
1 files changed, 5 insertions, 4 deletions
diff --git a/nlplug-findfs.c b/nlplug-findfs.c
index 68675bc..390a51b 100644
--- a/nlplug-findfs.c
+++ b/nlplug-findfs.c
@@ -560,15 +560,16 @@ static void *cryptsetup_thread(void *data)
{
struct ueventconf *c = (struct ueventconf *)data;
const char *data_devnode, *header_devnode;
+ struct crypt_params_luks1 param_struct;
struct crypt_params_luks1 *params = NULL;
struct crypt_device *cd;
int r, passwd_tries = 5;
data_devnode = header_devnode = c->crypt.data.devnode;
- if(c->crypt.header.devnode != NULL && c->crypt.header.devnode[0] != '\0') {
- params = alloca(sizeof(struct crypt_params_luks1));
- memset(params, 0, sizeof(struct crypt_params_luks1));
+ if(c->crypt.header.devnode[0] != '\0') {
+ params = &param_struct;
+ params->hash = NULL; /* No way of finding this */
params->data_alignment = c->crypt.payload_offset; /* Memset did set that to 0, so default is 0 */
params->data_device = c->crypt.data.devnode;
header_devnode = c->crypt.header.devnode;
@@ -631,7 +632,7 @@ static void start_thread(struct ueventconf *conf, void *(*thread_main)(void *))
static void start_cryptsetup(struct ueventconf *conf)
{
- if(conf->crypt.header.devnode != NULL) {
+ if(conf->crypt.header.devnode[0] != '\0') {
dbg("starting cryptsetup %s -> %s (header: %s)",
conf->crypt.data.devnode, conf->crypt.data.name,
conf->crypt.header.devnode);