mirror of
https://github.com/X11Libre/xserver.git
synced 2026-04-14 17:18:09 +00:00
Xext: security: use REPLY_*() macros for preparing / sending replies
Use the new macros for preparing and sending replies to clients. Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
This commit is contained in:
@@ -361,10 +361,8 @@ ProcSecurityQueryVersion(ClientPtr client)
|
||||
.minorVersion = SERVER_SECURITY_MINOR_VERSION
|
||||
};
|
||||
|
||||
if (client->swapped) {
|
||||
swaps(&reply.majorVersion);
|
||||
swaps(&reply.minorVersion);
|
||||
}
|
||||
REPLY_FIELD_CARD16(majorVersion);
|
||||
REPLY_FIELD_CARD16(minorVersion);
|
||||
|
||||
return X_SEND_REPLY_SIMPLE(client, reply);
|
||||
} /* ProcSecurityQueryVersion */
|
||||
@@ -562,21 +560,20 @@ ProcSecurityGenerateAuthorization(ClientPtr client)
|
||||
x_rpcbuf_t rpcbuf = { .swapped = client->swapped, .err_clear = TRUE };
|
||||
x_rpcbuf_write_binary_pad(&rpcbuf, pAuthdata, authdata_len);
|
||||
|
||||
/* tell client the auth id and data */
|
||||
xSecurityGenerateAuthorizationReply reply = {
|
||||
.authId = authId,
|
||||
.dataLength = authdata_len
|
||||
};
|
||||
|
||||
if (client->swapped) {
|
||||
swapl(&reply.authId);
|
||||
swaps(&reply.dataLength);
|
||||
}
|
||||
|
||||
SecurityAudit
|
||||
("client %d generated authorization %lu trust %d timeout %lu group %lu events %lu\n",
|
||||
client->index, (unsigned long)pAuth->id, pAuth->trustLevel, (unsigned long)pAuth->timeout,
|
||||
(unsigned long)pAuth->group, (unsigned long)eventMask);
|
||||
|
||||
REPLY_FIELD_CARD32(authId);
|
||||
REPLY_FIELD_CARD16(dataLength);
|
||||
|
||||
/* the request succeeded; don't call RemoveAuthorization or free pAuth */
|
||||
return X_SEND_REPLY_WITH_RPCBUF(client, reply, rpcbuf);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user