Initial revision

git-svn-id: svn://svn.h5l.se/heimdal/trunk/heimdal@298 ec53bebd-3082-4978-b11e-865c3cabbd6b
This commit is contained in:
Unknown User d91-jda
1996-03-15 14:55:26 +00:00
parent 3635cccce3
commit 81cbbf7820
35 changed files with 3651 additions and 0 deletions

27
misc.c Normal file
View File

@@ -0,0 +1,27 @@
#include "krb5_locl.h"
krb5_error_code
krb5_get_lrealm(char **realm)
{
FILE *F;
char s[128];
char *p, *q;
F = fopen("/etc/krb5.conf", "r");
while(fgets(s, 128, F)){
if((p = strstr(s, "default_realm"))){
p = strchr(p, '=');
p++;
while(isspace(*p)) p++;
q = p;
while(isalnum(*p) || strchr("_.-", *p)) p++;
*p=0;
*realm = strdup(q);
fclose(F);
return 0;
}
}
fclose(F);
*realm = 0;
return 0;
}