/*
* Amanda, The Advanced Maryland Automatic Network Disk Archiver
* Copyright (c) 1991-1998 University of Maryland at College Park
+ * Copyright (c) 2007-2012 Zmanda, Inc. All Rights Reserved.
* All Rights Reserved.
*
* Permission to use, copy, modify, distribute, and sell this software and its
property_t *property_data;
proplist_t property;
script_t *script;
- level_t *alevel;
+ am_level_t *alevel;
char *encoding;
char *raw;
} amgxml_t;
free_sl(dle->exclude_list);
free_sl(dle->include_file);
free_sl(dle->include_list);
+ if (dle->property)
+ g_hash_table_destroy(dle->property);
if (dle->application_property)
g_hash_table_destroy(dle->application_property);
for(scriptlist = dle->scriptlist; scriptlist != NULL;
dle->include_list = NULL;
dle->exclude_optional = 0;
dle->include_optional = 0;
+ dle->property = NULL;
dle->application_property = NULL;
dle->scriptlist = NULL;
dle->data_path = DATA_PATH_AMANDA;
data_user->has_optional = 0;
data_user->property_name = NULL;
data_user->property_data = NULL;
- data_user->property = NULL;
+ data_user->property =
+ g_hash_table_new_full(g_str_hash, g_str_equal, &g_free, &free_property_t);
data_user->script = NULL;
data_user->alevel = NULL;
+ data_user->dle->property = data_user->property;
data_user->encoding = NULL;
data_user->raw = NULL;
} else if(strcmp(element_name, "disk" ) == 0 ||
if (strcmp(element_name, "exclude") == 0 || strcmp(element_name, "include") == 0)
data_user->has_optional = 0;
if (strcmp(element_name, "level") == 0) {
- data_user->alevel = g_new0(level_t, 1);
+ data_user->alevel = g_new0(am_level_t, 1);
}
} else if (strcmp(element_name, "server") == 0) {
if (strcmp(last_element_name, "level") != 0) {
return;
}
} else if(strcmp(element_name, "property") == 0) {
- if (strcmp(last_element_name, "backup-program") != 0 &&
- strcmp(last_element_name, "script") != 0) {
+ if (!last_element ||
+ (strcmp(last_element_name, "backup-program") != 0 &&
+ strcmp(last_element_name, "script") != 0 &&
+ strcmp(last_element_name, "dle") != 0)) {
g_set_error(gerror, G_MARKUP_ERROR, G_MARKUP_ERROR_INVALID_CONTENT,
"XML: Invalid %s element", element_name);
return;
if (dle->estimatelist == NULL)
dle->estimatelist = g_slist_append(dle->estimatelist, ES_CLIENT);
/* Add check of required field */
+ data_user->property = NULL;
data_user->dle = NULL;
} else if (strcmp(element_name, "backup-program") == 0) {
if (dle->program == NULL) {
return;
}
dle->application_property = data_user->property;
- data_user->property = NULL;
+ data_user->property = dle->property;
} else if (strcmp(element_name, "script") == 0) {
if (data_user->script->plugin == NULL) {
g_set_error(gerror, G_MARKUP_ERROR, G_MARKUP_ERROR_INVALID_CONTENT,
return;
}
data_user->script->property = data_user->property;
- data_user->property = NULL;
+ data_user->property = dle->property;
dle->scriptlist = g_slist_append(dle->scriptlist, data_user->script);
data_user->script = NULL;
} else if (strcmp(element_name, "level") == 0) {
GSList *last_element2;
char *last_element2_name;
dle_t *dle = data_user->dle;
- int i;
if (!last_element) {
g_set_error(gerror, G_MARKUP_ERROR, G_MARKUP_ERROR_INVALID_CONTENT,
}
last_element_name = last_element->data;
- tt = malloc(text_len + 1);
+ tt = malloc(text_len + 8 + 1);
strncpy(tt,text,text_len);
tt[text_len] = '\0';
error("bad list");
}
} else if(strcmp(last_element_name, "optional") == 0) {
- i = atoi(tt);
last_element2 = g_slist_nth(data_user->element_names, 1);
if (!last_element2) {
error("XML: optional");