Lines Matching +full:1 +full:- +full:cell
2 * Copyright (c) 1997 - 2005 Kungliga Tekniska Högskolan
10 * 1. Redistributions of source code must retain the above copyright
44 #define ToAsciiUpper(c) ((c) - 'a' + 'A')
70 kafs_settoken_rxkad(const char *cell, struct ClearToken *ct, in kafs_settoken_rxkad() argument
96 * do *not* mark as primary cell in kafs_settoken_rxkad()
102 * follow with cell name in kafs_settoken_rxkad()
104 sizeof_x = strlen(cell) + 1; in kafs_settoken_rxkad()
105 memcpy(t, cell, sizeof_x); in kafs_settoken_rxkad()
112 parms.in_size = t - buf; in kafs_settoken_rxkad()
122 #define ODD(x) ((x) & 1) in _kafs_fixup_viceid()
124 * (EndTimestamp - BeginTimestamp) is odd. By decrementing EndTime in _kafs_fixup_viceid()
127 * (issue_date, life) -> (StartTime, EndTime) -> (issue_date, life) in _kafs_fixup_viceid()
132 if (!ODD(ct->EndTimestamp - ct->BeginTimestamp)) in _kafs_fixup_viceid()
133 ct->EndTimestamp--; in _kafs_fixup_viceid()
137 if (ODD(ct->EndTimestamp - ct->BeginTimestamp)) in _kafs_fixup_viceid()
138 ct->EndTimestamp--; in _kafs_fixup_viceid()
142 /* Try to get a db-server for an AFS cell from a AFSDB record */
145 dns_find_cell(const char *cell, char *dbserver, size_t len) in dns_find_cell() argument
148 int ok = -1; in dns_find_cell()
149 r = rk_dns_lookup(cell, "afsdb"); in dns_find_cell()
151 struct rk_resource_record *rr = r->head; in dns_find_cell()
153 if(rr->type == rk_ns_t_afsdb && rr->u.afsdb->preference == 1){ in dns_find_cell()
155 rr->u.afsdb->domain, in dns_find_cell()
160 rr = rr->next; in dns_find_cell()
175 char cell[64]; in find_cells() local
182 while (fgets(cell, sizeof(cell), f)) { in find_cells()
184 t = cell + strlen(cell); in find_cells()
185 for (; t >= cell; t--) in find_cells()
188 if (cell[0] == '\0' || cell[0] == '#') in find_cells()
191 if(strcmp((*cells)[i], cell) == 0) in find_cells()
196 tmp = realloc(*cells, (ind + 1) * sizeof(**cells)); in find_cells()
200 (*cells)[ind] = strdup(cell); in find_cells()
220 int er = (*data->afslog_uid)(data, cells[i], 0, uid, homedir); in afslog_cells()
257 free(cells[--idx]); in _kafs_afslog_all_local_cells()
265 const char *cell, char **realm, int exact) in file_find_cell() argument
270 int ret = -1; in file_find_cell()
281 continue; /* Not a cell name line, try next line */ in file_find_cell()
286 cmp = strcmp(buf + 1, cell); in file_find_cell()
288 cmp = strncmp(buf + 1, cell, strlen(cell)); in file_find_cell()
292 * We found the cell name we're looking for. in file_find_cell()
293 * Read next line on the form ip-address '#' hostname in file_find_cell()
301 if (buf[strlen(buf) - 1] == '\n') in file_find_cell()
302 buf[strlen(buf) - 1] = '\0'; in file_find_cell()
303 *realm = (*data->get_realm)(data, p); in file_find_cell()
314 /* Find the realm associated with cell. Do this by opening CellServDB
315 file and getting the realm-of-host for the first VL-server for the
316 cell.
318 This does not work when the VL-server is living in one realm, but
319 the cell it is serving is living in another realm.
321 Return 0 on success, -1 otherwise.
326 const char *cell, char **realm) in _kafs_realm_of_cell() argument
331 ret = file_find_cell(data, cell, realm, 1); in _kafs_realm_of_cell()
334 if (dns_find_cell(cell, buf, sizeof(buf)) == 0) { in _kafs_realm_of_cell()
335 *realm = (*data->get_realm)(data, buf); in _kafs_realm_of_cell()
339 return file_find_cell(data, cell, realm, 0); in _kafs_realm_of_cell()
343 _kafs_try_get_cred(struct kafs_data *data, const char *user, const char *cell, in _kafs_try_get_cred() argument
348 ret = (*data->get_cred)(data, user, cell, realm, uid, kt); in _kafs_try_get_cred()
350 const char *estr = (*data->get_error)(data, ret); in _kafs_try_get_cred()
352 asprintf(&str, "%s tried afs%s%s@%s -> %s (%d)", in _kafs_try_get_cred()
353 data->name, cell ? "/" : "", in _kafs_try_get_cred()
354 cell ? cell : "", realm, estr ? estr : "unknown", ret); in _kafs_try_get_cred()
357 (*data->free_error)(data, estr); in _kafs_try_get_cred()
367 const char *cell, in _kafs_get_cred() argument
373 int ret = -1; in _kafs_get_cred()
375 char CELL[64]; in _kafs_get_cred() local
378 * the specified cell. The problem is that null-instance in _kafs_get_cred()
379 * afs-principals are common and that hitting the wrong realm might in _kafs_get_cred()
384 * If there is a realm with the same name as the cell, it is most in _kafs_get_cred()
387 * In most (maybe even all) cases the database servers of the cell in _kafs_get_cred()
403 cell, realm_hint, uid, kt); in _kafs_get_cred()
410 _kafs_foldup(CELL, cell); in _kafs_get_cred()
414 * REALM we still don't have to resort to cross-cell authentication. in _kafs_get_cred()
415 * Try afs.cell@REALM. in _kafs_get_cred()
418 cell, realm, uid, kt); in _kafs_get_cred()
422 * If cell == realm we don't need no cross-cell authentication. in _kafs_get_cred()
425 if (strcmp(CELL, realm) == 0) { in _kafs_get_cred()
433 * fall back to cross-cell authentication. in _kafs_get_cred()
434 * Try afs@CELL. in _kafs_get_cred()
435 * Try afs.cell@CELL. in _kafs_get_cred()
438 NULL, CELL, uid, kt); in _kafs_get_cred()
441 cell, CELL, uid, kt); in _kafs_get_cred()
445 * Perhaps the cell doesn't correspond to any realm? in _kafs_get_cred()
447 * Try afs.cell@VL_REALM. in _kafs_get_cred()
450 if (_kafs_realm_of_cell(data, cell, &vl_realm) == 0 in _kafs_get_cred()
452 && strcmp(vl_realm, CELL) != 0) { in _kafs_get_cred()
454 cell, vl_realm, uid, kt); in _kafs_get_cred()