From 302a203cf99fc0f11a402a31121cbe306f9bed30 Mon Sep 17 00:00:00 2001 From: Michael Meffie Date: Thu, 20 Feb 2020 16:09:49 -0500 Subject: [PATCH] auth: pass the directory name to _afsconf_CellServDBPath Change the signature of the _afsconf_CellServDBPath() static function to take just the base directory name of the CellServDB file instead of the entire afsconf_dir data object. This makes it clear we do not need other members of the afsconf_dir structure to compose the CellServDB path. Change-Id: I57509b2ca09123e78df5533d63494c66b5b24cdf Reviewed-on: https://gerrit.openafs.org/14076 Reviewed-by: Benjamin Kaduk Tested-by: BuildBot Reviewed-by: Andrew Deason --- src/auth/cellconfig.c | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/src/auth/cellconfig.c b/src/auth/cellconfig.c index bc81423..ef69dec 100644 --- a/src/auth/cellconfig.c +++ b/src/auth/cellconfig.c @@ -315,32 +315,32 @@ _afsconf_IsClientConfigDirectory(const char *path) #ifdef AFS_NT40_ENV static void -_afsconf_CellServDBPath(struct afsconf_dir *adir, char **path) +_afsconf_CellServDBPath(const char *dirname, char **path) { char *p; /* NT client CellServDB has different file name than NT server or Unix */ - if (_afsconf_IsClientConfigDirectory(adir->name)) { + if (_afsconf_IsClientConfigDirectory(dirname)) { if (!afssw_GetClientCellServDBDir(&p)) { if (asprintf(path, "%s/%s", p, AFSDIR_CELLSERVDB_FILE_NTCLIENT) < 0) *path = NULL; free(p); } else { - if (asprintf(path, "%s/%s", adir->name, + if (asprintf(path, "%s/%s", dirname, AFSDIR_CELLSERVDB_FILE_NTCLIENT) < 0) *path = NULL; } } else { - if (asprintf(path, "%s/%s", adir->name, AFSDIR_CELLSERVDB_FILE) < 0) + if (asprintf(path, "%s/%s", dirname, AFSDIR_CELLSERVDB_FILE) < 0) *path = NULL; } return; } #else static void -_afsconf_CellServDBPath(struct afsconf_dir *adir, char **path) +_afsconf_CellServDBPath(const char *dirname, char **path) { - if (asprintf(path, "%s/%s", adir->name, AFSDIR_CELLSERVDB_FILE) < 0) + if (asprintf(path, "%s/%s", dirname, AFSDIR_CELLSERVDB_FILE) < 0) *path = NULL; } #endif /* AFS_NT40_ENV */ @@ -732,7 +732,7 @@ LoadConfig(struct afsconf_dir *adir) /* now parse the individual lines */ curEntry = 0; - _afsconf_CellServDBPath(adir, &adir->cellservDB); + _afsconf_CellServDBPath(adir->name, &adir->cellservDB); #ifdef AFS_NT40_ENV if (_afsconf_IsClientConfigDirectory(adir->name)) -- 1.9.4