From b500a76a06cebda4e0ee5855d9b795323a6f34c8 Mon Sep 17 00:00:00 2001 From: Mark Vitale Date: Tue, 22 Jun 2021 00:28:54 -0400 Subject: [PATCH] libadmin: allow tests to skip authentication setup src/libadmin/test/afscp is a testbed with subcommands to test many libadmin functions. Almost all of these subcommands call SetupCommonArgs to add authentication specification arguments (e.g. -noauth, -cell , etc). These common args are checked in MyBeforeProc to obtain authentication before processing the actual test subcommand. However, some afscp subcommands shouldn't need any authentication setup, for example: UtilErrorTranslate -error UtilNameToAddress -host In preparation for a future commit, modify MyBeforeProc to skip authentication setup for subcommands that haven't called SetupCommonArgs to define authentication options. Change-Id: I3d6be062c8264ece8eb27c3b2b72c8c45aacae56 Reviewed-on: https://gerrit.openafs.org/14646 Reviewed-by: Benjamin Kaduk Tested-by: BuildBot --- src/libadmin/test/afscp.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/libadmin/test/afscp.c b/src/libadmin/test/afscp.c index bb21a3edea..61b2cc648f 100644 --- a/src/libadmin/test/afscp.c +++ b/src/libadmin/test/afscp.c @@ -58,6 +58,9 @@ MyBeforeProc(struct cmd_syndesc *as, void *arock) char auth_cell[MAXCELLCHARS]; char exec_cell[MAXCELLCHARS]; + if (as->nParms < USER_PARAM) + return 0; /* no authentication parms defined for this subcommand */ + /* * Check what kind of authentication is necessary based upon * the arguments passed