Avoid calling krb5_free_context(NULL) Several places in the code currently call krb5_free_context(ctx) in a cleanup code path, where 'ctx' may or may not be NULL. This is not guaranteed to be okay, so check for NULL to make sure we don't cause issues in these code paths. While we are here cleaning up krb5_free_context() calls, also fix a few call sites in afscp_util.c that were not calling krb5_free_context in all error paths. Change-Id: I881f01bdf94f00079f84c4bd4bcfa58998e51ac9 Reviewed-on: https://gerrit.openafs.org/13461 Tested-by: BuildBot <buildbot@rampaginggeek.com> Reviewed-by: Benjamin Kaduk <kaduk@mit.edu>
Disable deprecated warnings for krb5 routines In OS X 10.9 Mavericks, Apple has marked all of the krb5 routines as deprecated (in favor of the GSS framework). We must disable these warnings in order to allow the buildslave to have a successful build. Luckily, Apple has left in rope for us to programmatically disable the deprecated attribute with a preprocessor macro. Defining this macro should be safe everywhere, so do so unconditionally. Change-Id: Iedc920001fdc5731254336424b0ab7b27274555c Reviewed-on: http://gerrit.openafs.org/10699 Tested-by: BuildBot <buildbot@rampaginggeek.com> Reviewed-by: Derrick Brashear <shadow@your-file-system.com>
afs: casting NULL is generally unnecessary Casting NULL shouldn't be necessary in most cases. Eliminate this in favor of shorter lines and consistency. Function pointers, variadic arguments should still be cast. Change-Id: Ibcd67378556e45c2b24f7aa85a4d73c72cd88e02 Reviewed-on: http://gerrit.openafs.org/8151 Reviewed-by: Garrett Wollman <wollman@csail.mit.edu> Tested-by: BuildBot <buildbot@rampaginggeek.com> Reviewed-by: Derrick Brashear <shadow@your-file-system.com>
libafscp: Add afscp_LocalAuthAs Add the function afscp_LocalAuthAs to libafscp. This allows the caller to generate credentials based on the KeyFile on local disk, in order to appear as an arbitrary user. Based on code written by YFS. Change-Id: I9c2da8b3460a000be8e6073eb0925dc82fcc1de3 Reviewed-on: http://gerrit.openafs.org/7917 Tested-by: BuildBot <buildbot@rampaginggeek.com> Reviewed-by: Derrick Brashear <shadow@dementix.org>
afscp: avoid null dereference in _GetSecurityObject error case Handle the possible error return from krb5_get_host_realm in the same way as the other error cases (using an anonymous security object); otherwise "realm" would be left null. Change-Id: I5ce7a614a3e272b3a9903a8e95545a8116d1af3c Reviewed-on: http://gerrit.openafs.org/7891 Tested-by: BuildBot <buildbot@rampaginggeek.com> Reviewed-by: Jeffrey Altman <jaltman@your-file-system.com>
afscp: add confdir override allow an alternate config dir Change-Id: I454d63199dcfadc46ba957ddae0685efee6acf26 Reviewed-on: http://gerrit.openafs.org/5476 Reviewed-by: Derrick Brashear <shadow@dementix.org> Reviewed-by: Jeffrey Altman <jaltman@openafs.org> Tested-by: BuildBot <buildbot@rampaginggeek.com>
Build libafscp when we lack kerberos Currently, venus fails to build without kerberos, since the dependencies for afsio always include afscp.h, which does not exist when we do not build libafscp. To fix this the easy way, and since libafscp is still very useful without kerberos, allow libafscp to build without kerberos support (which limits it to anonymous connections only). Change-Id: Ief620ca99223f195795dcbe746b47fcbfa2e7450 Reviewed-on: http://gerrit.openafs.org/4577 Reviewed-by: Derrick Brashear <shadow@dementia.org> Tested-by: BuildBot <buildbot@rampaginggeek.com>
libafscp: fix kerberos bits get the correct afs principal. this entire blob will go away and be replaced by rxgk token getting, but deal for now. Change-Id: I8e63a5de74efa6c2eeec4c67b4d14d1f69396e41 Reviewed-on: http://gerrit.openafs.org/4475 Tested-by: BuildBot <buildbot@rampaginggeek.com> Reviewed-by: Derrick Brashear <shadow@dementia.org>
libafscp: code cleanup This patch is intended to bring libafscp into accordance with the current OpenAFS coding standards while also fixing a few small issues. Apologies in advance for the numerous whitespace changes. Change-Id: I606ed5024395319e12e8759f31494ebd27ff6112 Reviewed-on: http://gerrit.openafs.org/4380 Reviewed-by: Derrick Brashear <shadow@dementia.org> Tested-by: Derrick Brashear <shadow@dementia.org>
libafscp: a library for "clientless" operations libafscp provides the ability to accomplish many of the functions of an AFS client without a running afsd cache manager. It is being introduced into the OpenAFS source tree in order to improve the capabilities of several utilities but may have additional benefits for testing clients and servers and for use on platforms which do not have afsd support. Change-Id: I24ee9416662c15b2d267317cea6fe0b7439ee022 Change-Id: I61037736e6edd01106b5b5ed982b211c16e1e7d9 Reviewed-on: http://gerrit.openafs.org/2371 Reviewed-by: Chaz Chandler <clc31@inbox.com> Tested-by: Chaz Chandler <clc31@inbox.com> Tested-by: BuildBot <buildbot@rampaginggeek.com> Reviewed-by: Derrick Brashear <shadow@dementia.org> Tested-by: Derrick Brashear <shadow@dementia.org>