(doit): print an error and bail out if storing an entry in the
database fails. The most likely reason for it failing is out-of-space. git-svn-id: svn://svn.h5l.se/heimdal/trunk/heimdal@9447 ec53bebd-3082-4978-b11e-865c3cabbd6b
This commit is contained in:
@@ -340,7 +340,9 @@ doit(const char *filename, int merge)
|
|||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
line = 0;
|
line = 0;
|
||||||
while(fgets(s, sizeof(s), f)){
|
ret = 0;
|
||||||
|
while(fgets(s, sizeof(s), f) != NULL) {
|
||||||
|
ret = 0;
|
||||||
line++;
|
line++;
|
||||||
e.principal = s;
|
e.principal = s;
|
||||||
for(p = s; *p; p++){
|
for(p = s; *p; p++){
|
||||||
@@ -461,12 +463,16 @@ doit(const char *filename, int merge)
|
|||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
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);
|
||||||
|
if (ret) {
|
||||||
|
krb5_warn(context, ret, "db_store");
|
||||||
|
break;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
db->close(context, db);
|
db->close(context, db);
|
||||||
fclose(f);
|
fclose(f);
|
||||||
return 0;
|
return ret != 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user