+ //Declare cargv array
+ char *cargvs[] = { CRYPTSETUP, "-d", "-", "luksOpen", device, luks, NULL };
+ //TODO: device cannot be an UUID=xyz, a resolved block device is required for it
+ char *scargvs[] = { SYSTEMDCRYPTSETUP, "attach", luks, device, "-", NULL };
+
+ //Check cryptsetup binary
+ if (access(CRYPTSETUP, F_OK|X_OK) == -1) {
+ //Check systemdcryptsetup binary
+ if (access(SYSTEMDCRYPTSETUP, F_OK|X_OK) == -1) {
+ die(500, "No cryptsetup available");
+ } else {
+ //Set contextual env
+ //TODO: resolve UUID in real device name
+ //TODO: passing password through the socket is not possible, as it rely on password ending with \0
+ die(500, "systemd-cryptsetupd is not implementable");
+ }
+ } else {
+ //Set contextual env
+ cargv = cargvs;
+ }
+