From a9c8d2b895dc25a9e3e4515add5255840431a533 Mon Sep 17 00:00:00 2001 From: Simon Wilkinson Date: Mon, 30 May 2011 20:14:45 +0100 Subject: [PATCH] vos: Add the -config option Add the -config option to all vos commands, so that the user can set the location of the configuration directory to use. This is primarily provided for testing purposes, and will shortly be used to hook vos up into the TAP-style test suite. Change-Id: I610a3161c7d5d52ce43e77a400bc752d43f76134 Reviewed-on: http://gerrit.openafs.org/4811 Reviewed-by: Jeffrey Altman Tested-by: BuildBot Reviewed-by: Derrick Brashear --- doc/man-pages/pod1/vos.pod | 5 +++++ src/volser/vos.c | 6 ++++++ 2 files changed, 11 insertions(+), 0 deletions(-) diff --git a/doc/man-pages/pod1/vos.pod b/doc/man-pages/pod1/vos.pod index 2ba2068..7a32d10 100644 --- a/doc/man-pages/pod1/vos.pod +++ b/doc/man-pages/pod1/vos.pod @@ -164,6 +164,11 @@ defined in the server machine's local F file), whereas a command on which the B<-cell> argument is included runs in the specified foreign cell. +=item B<-config> > + +The location of the directory to use to obtain configuration information, +including the CellServDB. This is primarily provided for testing purposes. + =item B<-help> Prints a command's online help message on the standard output stream. Do diff --git a/src/volser/vos.c b/src/volser/vos.c index 4a931d0..adddb07 100644 --- a/src/volser/vos.c +++ b/src/volser/vos.c @@ -78,6 +78,7 @@ cmd_AddParm(ts, "-localauth",CMD_FLAG,CMD_OPTIONAL,"use server tickets");\ cmd_AddParm(ts, "-verbose", CMD_FLAG, CMD_OPTIONAL, "verbose");\ cmd_AddParm(ts, "-encrypt", CMD_FLAG, CMD_OPTIONAL, "encrypt commands");\ cmd_AddParm(ts, "-noresolve", CMD_FLAG, CMD_OPTIONAL, "don't resolve addresses"); \ +cmd_AddParm(ts, "-config", CMD_SINGLE, CMD_OPTIONAL, "config location"); \ #define ERROR_EXIT(code) do { \ error = (code); \ @@ -5822,6 +5823,10 @@ MyBeforeProc(struct cmd_syndesc *as, void *arock) #endif /* AFS_NT40_ENV */ ) vsu_SetCrypt(1); + + if (as->parms[18].items) /* -config flag set */ + confdir = as->parms[18].items->data; + if ((code = vsu_ClientInit((as->parms[13].items != 0), confdir, tcell, sauth, &cstruct, UV_SetSecurity))) { @@ -5838,6 +5843,7 @@ MyBeforeProc(struct cmd_syndesc *as, void *arock) noresolve = 1; else noresolve = 0; + return 0; } -- 1.7.1