Could no longer figure out that

AFS cell pdc.kth.se uses service principal afs.pdc.kth.se@NADA.KTH.SE.
Now fixed.


git-svn-id: svn://svn.h5l.se/heimdal/trunk/heimdal@3770 ec53bebd-3082-4978-b11e-865c3cabbd6b
This commit is contained in:
Björn Groenvall
1997-11-03 20:35:24 +00:00
parent bba616767a
commit 5240a1170d

View File

@@ -223,6 +223,8 @@ _kafs_afslog_all_local_cells(kafs_data *data, uid_t uid)
This does not work when the VL-server is living in one realm, but This does not work when the VL-server is living in one realm, but
the cell it is serving is living in another realm. the cell it is serving is living in another realm.
Return 0 on success, -1 otherwise.
*/ */
static int static int
@@ -233,21 +235,30 @@ realm_of_cell(kafs_data *data, const char *cell, char **realm)
char *p; char *p;
int ret = -1; int ret = -1;
if((F = fopen(_PATH_CELLSERVDB, "r"))){ if ((F = fopen(_PATH_CELLSERVDB, "r")))
while(fgets(buf, sizeof(buf), F)){ {
while (fgets(buf, sizeof(buf), F))
{
if (buf[0] != '>') if (buf[0] != '>')
continue; continue; /* Not a cell name line, try next line */
if(strncmp(buf + 1, cell, strlen(cell)) == 0){ if (strncmp(buf + 1, cell, strlen(cell)) == 0)
{
/*
* We found the cell name we're looking for.
* Read next line on the form ip-address '#' hostname
*/
if (fgets(buf, sizeof(buf), F) == NULL) if (fgets(buf, sizeof(buf), F) == NULL)
break; break; /* Read failed, give up */
p = strchr(buf, '#'); p = strchr(buf, '#');
if (p == NULL) if (p == NULL)
break; break; /* No '#', give up */
p++; p++;
if (buf[strlen(buf) - 1] == '\n') if (buf[strlen(buf) - 1] == '\n')
buf[strlen(buf) - 1] = 0; buf[strlen(buf) - 1] = 0;
*realm = (*data->get_realm)(data, p); *realm = (*data->get_realm)(data, p);
break; if (*realm && **realm != 0)
ret = 0;
break; /* Won't try any more */
} }
} }
fclose(F); fclose(F);
@@ -314,7 +325,6 @@ _kafs_get_cred(kafs_data *data,
/* this might work in some cases */ /* this might work in some cases */
if (realm_of_cell(data, cell, &vl_realm) == 0) { if (realm_of_cell(data, cell, &vl_realm) == 0) {
char *vl_realm;
ret = (*data->get_cred)(data, AUTH_SUPERUSER, cell, vl_realm, c); ret = (*data->get_cred)(data, AUTH_SUPERUSER, cell, vl_realm, c);
if (ret) if (ret)
ret = (*data->get_cred)(data, AUTH_SUPERUSER, "", vl_realm, c); ret = (*data->get_cred)(data, AUTH_SUPERUSER, "", vl_realm, c);