Merge commit 'upstream/2.6.1p2'
[debian/amanda] / server-src / dumper.c
index af14723c5dca9a547aba0c046edfc0f05e39dcc2..ae04bb19a06c3449b16abbfe8693cd5450f74022 100644 (file)
@@ -260,9 +260,8 @@ xml_check_options(
     char *errmsg = NULL;
     dle_t *dle;
 
-    char *uoptionstr = unquote_string(optionstr);
-    o = oo = vstralloc("<dle>", strchr(uoptionstr,'<'), "</dle>", NULL);
-  
+    o = oo = vstralloc("<dle>", strchr(optionstr,'<'), "</dle>", NULL);
+
     dle = amxml_parse_node_CHAR(o, &errmsg);
     if (dle == NULL) {
        error("amxml_parse_node_CHAR failed: %s\n", errmsg);
@@ -1865,6 +1864,9 @@ bad_nak:
                char ch;
                *p++ = '\0';
                if(strncmp_const_skip(tok, "features=", tok, ch) == 0) {
+                   char *u = strchr(tok, ';');
+                   if (u)
+                      *u = '\0';
                    am_release_feature_set(their_features);
                    if((their_features = am_string_to_feature(tok)) == NULL) {
                        errstr = newvstrallocf(errstr,
@@ -1872,6 +1874,8 @@ bad_nak:
                                              tok);
                        goto parse_error;
                    }
+                   if (u)
+                      *u = ';';
                }
                tok = p;
            }
@@ -2048,9 +2052,8 @@ startup_dump(
 
     amfree(dle_str);
     if (am_has_feature(their_features, fe_req_xml)) {
-       char *o, *p = NULL;
+       char *p = NULL;
        char *pclean;
-       o = unquote_string(options+1);
        vstrextend(&p, "<dle>\n", NULL);
        if (*application_api != '\0') {
            vstrextend(&p, "  <program>APPLICATION</program>\n", NULL);
@@ -2063,8 +2066,7 @@ startup_dump(
                       NULL);
        }
        vstrextend(&p, "  <level>", level_string, "</level>\n", NULL);
-       vstrextend(&p, o, "</dle>\n", NULL);
-       amfree(o);
+       vstrextend(&p, options+1, "</dle>\n", NULL);
        pclean = clean_dle_str_for_client(p);
        vstrextend(&req, pclean, NULL);
        amfree(pclean);
@@ -2087,7 +2089,7 @@ startup_dump(
                   " ", dumpdate,
                   " OPTIONS ", options,
                   /* compat: if authopt=krb4, send krb4-auth */
-                  (strcasecmp(authopt, "krb4") ? "" : "krb4-auth"),
+                  (authopt && strcasecmp(authopt, "krb4") ? "" : "krb4-auth"),
                   "\n",
                   NULL);
     }