char *p;
proxy_record tmp_record;
time_t current_time;
+ int line_num = 0;
assert(record != NULL);
memset(&tmp_record, 0, sizeof(tmp_record));
current_time = time(NULL);
while (fgets(line, sizeof(line), fd) != NULL) {
+ line_num++;
free_record(&tmp_record);
p = strchr(line, '\n');
if (p)
*p = '\0';
ret = decode_record(line, &tmp_record);
- if (ret)
- return ret; /* XXX continue */
+ if (ret) {
+ edg_wlpr_Log(LOG_ERR, "Skipping invalid entry at line %d", line_num);
+ continue;
+ }
if (record->suffix >= 0) {
if (record->suffix == tmp_record.suffix) {
record->suffix = tmp_record.suffix;
* parameters (currently myproxy location) provided by user */
char *server = record->myproxy_server;
- memset(record, sizeof(*record), 0);
+ memset(record, 0, sizeof(*record));
record->suffix = tmp_record.suffix;
- if (record->myproxy_server)
- free(record->myproxy_server);
record->myproxy_server = server;
free_record(&tmp_record);
return 0;
proxy_record tmp_record;
char tmp_file[FILENAME_MAX];
char meta_file[FILENAME_MAX];
+ int line_num = 0;
assert (record != NULL);
goto end;
}
while (fgets(line, sizeof(line), fd) != NULL) {
+ line_num++;
free_record(&tmp_record);
p = strchr(line, '\n');
if (p)
*p = '\0';
ret = decode_record(line, &tmp_record);
- if (ret)
- goto end;
+ if (ret) {
+ edg_wlpr_Log(LOG_ERR, "Removing invalid entry at line %d in %s", line_num, basename);
+ continue;
+ }
if (record->suffix == tmp_record.suffix &&
record->unique == tmp_record.unique) {
tmp_record.next_renewal = record->next_renewal;