auth: fix include quotes for generated headers Change-Id: If4786c30b0b448ea4ff663d62d5e0f8623736084 Reviewed-on: http://gerrit.openafs.org/10870 Tested-by: BuildBot <buildbot@rampaginggeek.com> Reviewed-by: Benjamin Kaduk <kaduk@mit.edu> Reviewed-by: Chas Williams - CONTRACTOR <chas@cmf.nrl.navy.mil> Reviewed-by: D Brashear <shadow@your-file-system.com>
auth: token jar handling should realloc correctly instead of reallocing n+1 tokens, we would realloc 1 token plus N bytes Change-Id: Idb5a20b5b9becc9d48cb645bbc0bd26459220ccd Reviewed-on: http://gerrit.openafs.org/8163 Reviewed-by: Derrick Brashear <shadow@your-file-system.com> Tested-by: BuildBot <buildbot@rampaginggeek.com>
Use calloc, rather than malloc/memset Rather than doing a = malloc(sizeof(me)); memset(a, 0, sizeof(me)); Just use a = calloc(1, sizeof(me)); This is simpler, shorter, and removes the potential for the size of the memset not matching the size of the malloc (or the target of the memset being wrong!) Where the size is of the form (n * sizeof(me)), we also use calloc(n, sizeof(me)); Change-Id: Ia0f75665c1031fd2982eee0e1d8c8ebe23d7fbc0 Reviewed-on: http://gerrit.openafs.org/7454 Tested-by: BuildBot <buildbot@rampaginggeek.com> Reviewed-by: Derrick Brashear <shadow@dementix.org>
auth: Force correct evenness on rxkad tokens Rxkad tokens historically have forced odd lifetimes when the given viceid is actually an AFS ID, and even lifetimes when it is not. Force this when the new token-handling functions are used (so the viceid is correctly interpreted by users of the old token format), by creating rxkad tokens with token_importRxkadViceId. Slightly reworked by Simon Wilkinson to provide a generic token destructor function. Change-Id: I9f6aa518b8ae51a3772b69a0722a28bff6b47128 Reviewed-on: http://gerrit.openafs.org/4481 Tested-by: Simon Wilkinson <sxw@inf.ed.ac.uk> Reviewed-by: Derrick Brashear <shadow@dementix.org>
auth: Set correct flags in token_extractRxkad The flags that token_extractRxkad returns are flags that are passed to ktc_SetToken, not the flags that are passed directly to the PSetTokens pioctl. So, we should be setting AFS_SETTOK_SETPAG, which is interpreted by ktc_SetToken. Change-Id: Id63ba4d5874e43c8d1f02817bf33975516a974be Reviewed-on: http://gerrit.openafs.org/4480 Reviewed-by: Simon Wilkinson <sxw@inf.ed.ac.uk> Reviewed-by: Derrick Brashear <shadow@dementia.org> Tested-by: BuildBot <buildbot@rampaginggeek.com>
auth: Tidy header includes Since we adopted libroken, we get a lot of header includes automatically from roken.h. Use these, instead of including lots of things multiple times. Change-Id: I2afd32d86b40b84c14f8a6021a583b6a4888780c Reviewed-on: http://gerrit.openafs.org/4321 Tested-by: BuildBot <buildbot@rampaginggeek.com> Reviewed-by: Jeffrey Altman <jaltman@openafs.org>
libroken: Build on windows A minimal change set to get libroken to build on Windows. Sadly, libroken contains definitions for a number of platform compatibility macros which were previously scattered throughout the windows code. These scattered macros have to be removed in order to build libroken. The impact of this removal is that a very large number of files throughout the tree require the addition of "roken.h" to pick up the new compatibility code. The bulk of this change is adding these includes. In addition, some of the added includes add roken dependencies to the Unix build. So, also add libroken to the build rules in affected Unix Makefiles. Change-Id: Ifba431bd37e67b1e273fbc6f69b805a232193456 Reviewed-on: http://gerrit.openafs.org/3205 Tested-by: BuildBot <buildbot@rampaginggeek.com> Reviewed-by: Derrick Brashear <shadow@dementia.org>
Windows: Add new token interface with stub for ktc_GetTokenEx The Windows build was broken by the addition of dependencies on token_FreeSet, ktc_GetTokenEx, etc. Permit the build to continue. The ktc_GetTokenEx implementation will depend on the creation of a new Windows pioctl for the call. Change-Id: I1c486af0beda10a2d846dc6bdff8c6195031dbe7 Reviewed-on: http://gerrit.openafs.org/2765 Tested-by: BuildBot <buildbot@rampaginggeek.com> Reviewed-by: Derrick Brashear <shadow@dementia.org> Tested-by: Derrick Brashear <shadow@dementia.org>
auth: Make token_FreeSet work on an empty set If the set passed to token_FreeSet is already freed, just make the funciton a no-op, rather than segfaulting. Change-Id: I41342d1c7bd94bcf20ad67407b28d9ffcccf3c07 Reviewed-on: http://gerrit.openafs.org/2751 Reviewed-by: Derrick Brashear <shadow@dementia.org> Tested-by: Derrick Brashear <shadow@dementia.org>
New GetToken pioctl Implement a new, XDR based, GetToken pioctl which mirrors the new SetToken pioctl. Change-Id: I213e74edb3496baa40b5c8048e97df6888f742b4 Reviewed-on: http://gerrit.openafs.org/2584 Reviewed-by: Derrick Brashear <shadow@dementia.org> Tested-by: Derrick Brashear <shadow@dementia.org>
Add new SetTokenEx pioctl This change implements the new, XDR based, SetTokenEx pioctl. This pioctl permits sending multiple tokens, of multiple types, into the kernel in a single pioctl call. This patch provides a kernel implementation of the pioctl, and a new library function ktc_SetTokenEx, which will use either the new pioctl, or fall back to the old one should SetTokenEx not be available. Change-Id: Id1e2903e078c549f5675e3d2ecdf53a9bb33f5e9 Reviewed-on: http://gerrit.openafs.org/2582 Reviewed-by: Derrick Brashear <shadow@dementia.org> Tested-by: Derrick Brashear <shadow@dementia.org>