- return rval_dle_str;
-}
-
-typedef struct {
- am_feature_t *features;
- char *result;
-} xml_app_t;
-
-/* A GHFunc (callback for g_hash_table_foreach) */
-static void xml_property(
- gpointer key_p,
- gpointer value_p,
- gpointer user_data_p)
-{
- char *property_s = key_p;
- char *b64property;
- property_t *property = value_p;
- char *b64value_data;
- xml_app_t *xml_app = user_data_p;
- GSList *value;
-
- b64property = amxml_format_tag("name", property_s);
- vstrextend(&xml_app->result, " <property>\n",
- " ", b64property, "\n", NULL);
- // TODO if client have fe_xml_property_priority
- if (property->priority &&
- am_has_feature(xml_app->features, fe_xml_property_priority)) {
- vstrextend(&xml_app->result, " <priority>yes</priority>\n", NULL);
- }
- for(value = property->values; value != NULL; value = value->next) {
- b64value_data = amxml_format_tag("value", value->data);
- vstrextend(&xml_app->result, " ", b64value_data, "\n", NULL);
- amfree(b64value_data);
+ if (!am_has_feature(their_features, fe_dumptype_property)) {
+#define SC "</property>\n"
+#define SC_LEN strlen(SC)
+ /* remove all dle properties, they are before backup-program or script
+ properties */
+ hack1 = rval_dle_str;
+ pend = strstr(rval_dle_str, "<backup-program>");
+ pscript = strstr(rval_dle_str, "<script>");
+ if (pscript && pscript < pend)
+ pend = pscript;
+ if (!pend) /* the complete string */
+ pend = rval_dle_str + strlen(rval_dle_str);
+ while (hack1) {
+ pproperty = strstr(hack1, " <property>");
+ if (pproperty && pproperty < pend) { /* remove it */
+ eproperty = strstr(pproperty, SC);
+ len = eproperty + SC_LEN - pproperty;
+ memmove(pproperty, eproperty + SC_LEN, strlen(eproperty + SC_LEN) + 1);
+ pend -= len;
+ hack1 = pproperty;
+ } else {
+ hack1 = NULL;
+ }
+ }
+ } else {