remove unused etypes code, and add parsing of the generation field
git-svn-id: svn://svn.h5l.se/heimdal/trunk/heimdal@10470 ec53bebd-3082-4978-b11e-865c3cabbd6b
This commit is contained in:
@@ -47,7 +47,7 @@ struct entry {
|
|||||||
char *valid_end;
|
char *valid_end;
|
||||||
char *pw_end;
|
char *pw_end;
|
||||||
char *flags;
|
char *flags;
|
||||||
char *etypes;
|
char *generation;
|
||||||
};
|
};
|
||||||
|
|
||||||
static char *
|
static char *
|
||||||
@@ -282,24 +282,30 @@ parse_hdbflags2int(HDBFlags *f, const char *s)
|
|||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
#if 0
|
static int
|
||||||
static void
|
parse_generation(char *str, GENERATION **gen)
|
||||||
parse_etypes(char *str, unsigned **val, unsigned *len)
|
|
||||||
{
|
{
|
||||||
unsigned v;
|
char *p;
|
||||||
|
int v;
|
||||||
*val = NULL;
|
|
||||||
*len = 0;
|
if(strcmp(str, "-") == 0 || *str == '\0')
|
||||||
while(sscanf(str, "%u", &v) == 1) {
|
*gen = NULL;
|
||||||
*val = realloc(*val, (*len+1) * sizeof(**val));
|
*gen = calloc(1, sizeof(**gen));
|
||||||
(*val)[(*len)++] = v;
|
|
||||||
str = strchr(str, ':');
|
p = strsep(&str, ":");
|
||||||
if(str == NULL)
|
if(parse_time_string(&(*gen)->time, p) != 1)
|
||||||
break;
|
return -1;
|
||||||
str++;
|
p = strsep(&str, ":");
|
||||||
}
|
if(sscanf(p, "%d", &v) != 1)
|
||||||
|
return -1;
|
||||||
|
(*gen)->usec = v;
|
||||||
|
p = strsep(&str, ":");
|
||||||
|
if(sscanf(p, "%d", &v) != 1)
|
||||||
|
return -1;
|
||||||
|
(*gen)->gen = v - 1; /* XXX gets bumped in _hdb_store */
|
||||||
|
return 0;
|
||||||
}
|
}
|
||||||
#endif
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Parse the dump file in `filename' and create the database (merging
|
* Parse the dump file in `filename' and create the database (merging
|
||||||
@@ -382,7 +388,7 @@ doit(const char *filename, int merge)
|
|||||||
e.flags = p;
|
e.flags = p;
|
||||||
p = skip_next(p);
|
p = skip_next(p);
|
||||||
|
|
||||||
e.etypes = p;
|
e.generation = p;
|
||||||
p = skip_next(p);
|
p = skip_next(p);
|
||||||
|
|
||||||
memset(&ent, 0, sizeof(ent));
|
memset(&ent, 0, sizeof(ent));
|
||||||
@@ -454,14 +460,13 @@ doit(const char *filename, int merge)
|
|||||||
hdb_free_entry (context, &ent);
|
hdb_free_entry (context, &ent);
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
#if 0
|
|
||||||
ALLOC(ent.etypes);
|
if(parse_generation(e.generation, &ent.generation) == -1) {
|
||||||
parse_etypes(e.etypes, &ent.etypes->val, &ent.etypes->len);
|
fprintf (stderr, "%s:%d:error parsing generation (%s)\n",
|
||||||
if(ent.etypes->len == 0) {
|
filename, line, e.generation);
|
||||||
free(ent.etypes);
|
hdb_free_entry (context, &ent);
|
||||||
ent.etypes = NULL;
|
continue;
|
||||||
}
|
}
|
||||||
#endif
|
|
||||||
|
|
||||||
ret = db->store(context, db, HDB_F_REPLACE, &ent);
|
ret = db->store(context, db, HDB_F_REPLACE, &ent);
|
||||||
hdb_free_entry (context, &ent);
|
hdb_free_entry (context, &ent);
|
||||||
|
Reference in New Issue
Block a user