From: Simon Wilkinson Date: Thu, 30 Dec 2010 17:52:00 +0000 (+0000) Subject: libadmin: Don't use internal struct for key data X-Git-Tag: upstream/1.8.0_pre1^2~4314 X-Git-Url: https://git.michaelhowe.org/gitweb/?a=commitdiff_plain;h=cfee25cdc885a5ad669b206ab4e96fa09d1c19a6;p=packages%2Fo%2Fopenafs.git libadmin: Don't use internal struct for key data The afsconf_dir structure should be regarded as private to the libauth library, which provides accessors for the commonly used parameters within it. Rework libadmin so that it uses those accessors when looking up key data. Change-Id: I9a623ccadba95622894931ee25319d3bcb019136 Reviewed-on: http://gerrit.openafs.org/3608 Tested-by: BuildBot Reviewed-by: Derrick Brashear Tested-by: Derrick Brashear --- diff --git a/src/libadmin/cfg/cfghost.c b/src/libadmin/cfg/cfghost.c index 12e96e046..2d95ef573 100644 --- a/src/libadmin/cfg/cfghost.c +++ b/src/libadmin/cfg/cfghost.c @@ -98,6 +98,7 @@ cfg_HostQueryStatus(const char *hostName, /* name of host */ afs_status_p st) { /* completion status */ int rc = 1; + struct afsconf_keys keys; afs_status_t tst2, tst = 0; afs_status_t serverSt = 0; char *serverCellName = NULL; @@ -168,7 +169,8 @@ cfg_HostQueryStatus(const char *hostName, /* name of host */ if (confdir->cellName == NULL || *confdir->cellName == '\0') { /* no cell set for server */ serverSt = ADMCFGSERVERNOTINCELL; - } else if (confdir->keystr == NULL || confdir->keystr->nkeys == 0) { + } else if ((afsconf_GetKeys(confdir, &keys) != 0) + || (keys.nkeys == 0)) { /* no server keys */ serverSt = ADMCFGSERVERNOKEYS; } else {