From: Derrick Brashear Date: Mon, 8 Mar 2010 19:06:50 +0000 (-0500) Subject: afsconf srv lookup fill cellname X-Git-Tag: openafs-devel-1_5_73~84 X-Git-Url: https://git.michaelhowe.org/gitweb/?a=commitdiff_plain;h=84eee2ed411cab64b136ccea3a6c29f1313e2ecc;p=packages%2Fo%2Fopenafs.git afsconf srv lookup fill cellname pull out the cellname from the reply Change-Id: I8e0dbb5b82e353ecd29a9cce25eaee1255062cd9 Reviewed-on: http://gerrit.openafs.org/1537 Tested-by: Derrick Brashear Reviewed-by: Simon Wilkinson Reviewed-by: Derrick Brashear --- diff --git a/src/auth/cellconfig.c b/src/auth/cellconfig.c index 7cba99a2c..20099789b 100644 --- a/src/auth/cellconfig.c +++ b/src/auth/cellconfig.c @@ -1147,6 +1147,13 @@ afsconf_LookupServer(const char *service, const char *protocol, } if (type == T_SRV) { struct hostent *he; + /* math here: _ is 1, _ ._ is 3, _ ._ . is 4. then the domain. */ + if ((strncmp(host + 1, IANAname, strlen(IANAname)) == 0) && + (strncmp(host + strlen(IANAname) + 3, protocol, + strlen(protocol)) == 0)) { + realCellName = strdup(host + strlen(IANAname) + + strlen(protocol) + 4); + } code = dn_expand(answer, answer + len, p + 6, host, sizeof(host)); if (code < 0) {