Fix warnings on some platforms with %llx and add a new message to handle

64-bit client flags.
This commit is contained in:
nicm
2020-09-22 05:23:34 +00:00
parent 88b66e9e28
commit 86d6ac2f06
4 changed files with 26 additions and 9 deletions

View File

@ -1985,6 +1985,7 @@ server_client_dispatch(struct imsg *imsg, void *arg)
switch (imsg->hdr.type) {
case MSG_IDENTIFY_FEATURES:
case MSG_IDENTIFY_FLAGS:
case MSG_IDENTIFY_LONGFLAGS:
case MSG_IDENTIFY_TERM:
case MSG_IDENTIFY_TTYNAME:
case MSG_IDENTIFY_CWD:
@ -2143,6 +2144,7 @@ server_client_dispatch_identify(struct client *c, struct imsg *imsg)
const char *data, *home;
size_t datalen;
int flags, feat;
uint64_t longflags;
char *name;
if (c->flags & CLIENT_IDENTIFIED)
@ -2167,6 +2169,14 @@ server_client_dispatch_identify(struct client *c, struct imsg *imsg)
c->flags |= flags;
log_debug("client %p IDENTIFY_FLAGS %#x", c, flags);
break;
case MSG_IDENTIFY_LONGFLAGS:
if (datalen != sizeof longflags)
fatalx("bad MSG_IDENTIFY_LONGFLAGS size");
memcpy(&longflags, data, sizeof longflags);
c->flags |= longflags;
log_debug("client %p IDENTIFY_LONGFLAGS %#llx", c,
(unsigned long long)longflags);
break;
case MSG_IDENTIFY_TERM:
if (datalen == 0 || data[datalen - 1] != '\0')
fatalx("bad MSG_IDENTIFY_TERM string");