os: auth: let GenerateAuthorization() return 0 on error
XID = 0 already is used as sign for error in several places, so let's use that here, too. Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
This commit is contained in:
parent
a68f5c125c
commit
6c6e0b09a1
|
@ -491,7 +491,7 @@ ProcSecurityGenerateAuthorization(ClientPtr client)
|
|||
authId = GenerateAuthorization(stuff->nbytesAuthProto, protoname,
|
||||
stuff->nbytesAuthData, protodata,
|
||||
&authdata_len, &pAuthdata);
|
||||
if ((XID) ~0L == authId) {
|
||||
if (!authId) {
|
||||
return SecurityErrorBase + XSecurityBadAuthorizationProtocol;
|
||||
}
|
||||
|
||||
|
|
|
@ -68,7 +68,7 @@ winGenerateAuthorization(void)
|
|||
g_authId = GenerateAuthorization(strlen(AUTH_NAME),
|
||||
AUTH_NAME,
|
||||
0, NULL, &g_uiAuthDataLen, &g_pAuthData);
|
||||
if ((XID) ~0L == g_authId) {
|
||||
if (!g_authId) {
|
||||
ErrorF("winGenerateAuthorization - GenerateAuthorization failed\n");
|
||||
return FALSE;
|
||||
}
|
||||
|
|
|
@ -293,5 +293,5 @@ GenerateAuthorization(unsigned name_length,
|
|||
data_length_return, data_return);
|
||||
}
|
||||
}
|
||||
return -1;
|
||||
return 0;
|
||||
}
|
||||
|
|
|
@ -161,7 +161,7 @@ MitGenerateCookie(unsigned data_length,
|
|||
GenerateRandomData(sizeof(cookie), cookie);
|
||||
XID id = MitAddCookie(sizeof(cookie), cookie);
|
||||
if (!id)
|
||||
return -1;
|
||||
return 0;
|
||||
|
||||
*data_return = cookie;
|
||||
*data_length_return = sizeof(cookie);
|
||||
|
|
Loading…
Reference in New Issue