From 49ddcc3b3e9645255db394af0256ea374d06766e Mon Sep 17 00:00:00 2001 From: Simon Wilkinson Date: Sun, 8 Apr 2012 18:31:31 -0400 Subject: [PATCH] kas: Don't require config for help Modify the call to ka_Init in kas, so that a fully configured client isn't required in order to generate help output. In particular, permit kas -help, kas -version and kas apropos to run without initialising the ka library. This fixes a problem with running 'make check' on systems that don't have an AFS client installed (or where the AFS client is installed in a different location) Change-Id: I5edd10a319ed6aee163723f99c4f37183f572b2f Reviewed-on: http://gerrit.openafs.org/7129 Reviewed-by: Jeffrey Altman Tested-by: BuildBot Reviewed-by: Derrick Brashear --- src/kauth/kas.c | 16 ++++++++++++---- 1 files changed, 12 insertions(+), 4 deletions(-) diff --git a/src/kauth/kas.c b/src/kauth/kas.c index fa57df5..027b448 100644 --- a/src/kauth/kas.c +++ b/src/kauth/kas.c @@ -66,10 +66,18 @@ main(int argc, char *argv[]) } #endif - code = ka_Init(0); - if (code) { - afs_com_err(whoami, code, "Can't get cell info"); - exit(1); + /* Don't ka_Init if we're just returning help output. */ + if (argc== 0 || + ( strcmp(argv[1], "-help") != 0 && + strcmp(argv[1], "help") != 0 && + strcmp(argv[1], "-version") != 0 && + strcmp(argv[1], "version") !=0 && + strcmp(argv[1],"apropos") != 0)) { + code = ka_Init(0); + if (code) { + afs_com_err(whoami, code, "Can't get cell info"); + exit(1); + } } /* if there are no arguments or if the first argument is "-cell" or if the -- 1.7.1