From 8b60082c1f31f2aa02107e509f161e4e79ea5daa Mon Sep 17 00:00:00 2001 From: Simon Wilkinson Date: Wed, 27 Jul 2011 11:30:51 +0100 Subject: [PATCH] pts: Add the -config option Add the -config option to all pts commands, so that the user can set the location of the configuration directory to use. This is primarily provided for testing purposes, to make it simpler to build fake AFS cells with configuration in non-standard locations. Change-Id: I90c9c95cbf99b3853bfbe93dab1ab71c3ae7e228 Reviewed-on: http://gerrit.openafs.org/5103 Tested-by: BuildBot Reviewed-by: Derrick Brashear --- doc/man-pages/pod1/pts.pod | 5 +++++ src/ptserver/pts.c | 7 +++++++ 2 files changed, 12 insertions(+) diff --git a/doc/man-pages/pod1/pts.pod b/doc/man-pages/pod1/pts.pod index aa9d1ea38..0720f0b66 100644 --- a/doc/man-pages/pod1/pts.pod +++ b/doc/man-pages/pod1/pts.pod @@ -115,6 +115,11 @@ specified foreign cell. =back +=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<-force> Enables the command to continue executing as far as possible when errors diff --git a/src/ptserver/pts.c b/src/ptserver/pts.c index 3e77f3aed..1d69a0eef 100644 --- a/src/ptserver/pts.c +++ b/src/ptserver/pts.c @@ -217,6 +217,12 @@ GetGlobals(struct cmd_syndesc *as, void *arock) else confdir = AFSDIR_CLIENT_ETC_DIRPATH; } + + if (as->parms[23].items) { /* -config */ + changed = 1; + confdir = as->parms[23].items->data; + } + if (changed) { CleanUp(as, arock); code = pr_Initialize(sec, confdir, cell); @@ -1086,6 +1092,7 @@ add_std_args(struct cmd_syndesc *ts) "use user's authentication (default)"); cmd_AddParm(ts, "-encrypt", CMD_FLAG, CMD_OPTIONAL, "encrypt commands"); + cmd_AddParm(ts, "-config", CMD_SINGLE, CMD_OPTIONAL, "config location"); } /* -- 2.39.5