mirror of
https://git.openafs.org/openafs.git
synced 2025-01-18 23:10:58 +00:00
auth: Catch long cells in backwards compat code
ktc_SetTokenEx can fall back to calling the SetToken pioctl when the kernel module doesn't support the newer call. When we do this, we have to transform the token structure into the older format. Catch tokens whose cells are too long to be represented in the older format, and bail with KTC_INVAL, rather than overflowing the array. Caught by coverity (#985770) Change-Id: Ibaa1cc92c494cc6f4e56ebe7b16109d4558db131 Reviewed-on: http://gerrit.openafs.org/9449 Tested-by: BuildBot <buildbot@rampaginggeek.com> Reviewed-by: Derrick Brashear <shadow@your-file-system.com>
This commit is contained in:
parent
b0b3def56c
commit
8c664a8c0f
@ -356,7 +356,11 @@ ktc_SetTokenEx(struct ktc_setTokenData *token) {
|
||||
|
||||
memset(&server, 0, sizeof(server));
|
||||
strcpy(server.name, "afs");
|
||||
strcpy(server.cell, token->cell);
|
||||
if (strlcpy(server.cell, token->cell, sizeof(server.cell))
|
||||
>= sizeof(server.cell)) {
|
||||
free(rxkadToken);
|
||||
return KTC_INVAL;
|
||||
}
|
||||
code = ktc_SetToken(&server, rxkadToken, &client, flags);
|
||||
free(rxkadToken);
|
||||
return code;
|
||||
|
Loading…
Reference in New Issue
Block a user