int sock_do(int fd)
{
- int cmd = KEYD_CMD_UNKNOWN;
+ uint32_t cmd = KEYD_CMD_UNKNOWN;
ssize_t bytes = 0;
ssize_t count = 0;
int ret = 0;
case KEYD_CMD_VERSION:
cmd = KEYD_REPLY_OK;
write(fd, &cmd, sizeof(cmd));
+ cmd = sizeof(keyd_version);
+ write(fd, &cmd, sizeof(cmd));
write(fd, &keyd_version, sizeof(keyd_version));
break;
case KEYD_CMD_GET:
}
if (ret == 0) {
keyid = config.dbbackend->getfullkeyid(keyid);
+ cmd = sizeof(keyid);
+ write(fd, &cmd, sizeof(cmd));
write(fd, &keyid, sizeof(keyid));
}
break;
write(fd, &bytes, sizeof(bytes));
break;
case KEYD_CMD_CLOSE:
+ cmd = KEYD_REPLY_OK;
+ write(fd, &cmd, sizeof(cmd));
ret = 1;
break;
case KEYD_CMD_QUIT:
+ cmd = KEYD_REPLY_OK;
+ write(fd, &cmd, sizeof(cmd));
+ ret = 1;
trytocleanup();
break;
default: