pts: Add the -config option
authorSimon Wilkinson <sxw@inf.ed.ac.uk>
Wed, 27 Jul 2011 10:30:51 +0000 (11:30 +0100)
committerDerrick Brashear <shadow@dementia.org>
Wed, 10 Aug 2011 03:54:51 +0000 (20:54 -0700)
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 <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementia.org>

doc/man-pages/pod1/pts.pod
src/ptserver/pts.c

index aa9d1ea..0720f0b 100644 (file)
@@ -115,6 +115,11 @@ specified foreign cell.
 
 =back
 
+=item B<-config> <I<config directory>>
+
+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
index 3e77f3a..1d69a0e 100644 (file)
@@ -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");
 }
 
 /*