+ amfree(dle_str);
+ if (am_has_feature(their_features, fe_req_xml)) {
+ char *p = NULL;
+ char *pclean;
+ vstrextend(&p, "<dle>\n", NULL);
+ if (*application_api != '\0') {
+ vstrextend(&p, " <program>APPLICATION</program>\n", NULL);
+ } else {
+ vstrextend(&p, " <program>", progname, "</program>\n", NULL);
+ }
+ vstrextend(&p, " ", b64disk, "\n", NULL);
+ if (device && has_device) {
+ vstrextend(&p, " ", b64device, "\n",
+ NULL);
+ }
+ vstrextend(&p, " <level>", level_string, "</level>\n", NULL);
+ vstrextend(&p, options+1, "</dle>\n", NULL);
+ pclean = clean_dle_str_for_client(p);
+ vstrextend(&req, pclean, NULL);
+ amfree(pclean);
+ dle_str = p;
+ } else if (*application_api != '\0') {
+ errstr = newvstrallocf(errstr,
+ _("[does not support application-api]"));
+ amfree(req);
+ return 2;
+ } else {
+ authopt = strstr(options, "auth=");
+ if (auth == NULL) {
+ auth = "BSD";
+ }
+ vstrextend(&req,
+ progname,
+ " ", qdiskname,
+ " ", device && has_device ? device : "",
+ " ", level_string,
+ " ", dumpdate,
+ " OPTIONS ", options,
+ /* compat: if authopt=krb4, send krb4-auth */
+ (authopt && strcasecmp(authopt, "krb4") ? "" : "krb4-auth"),
+ "\n",
+ NULL);
+ }
+
+ dbprintf(_("send request:\n----\n%s\n----\n\n"), req);
+ secdrv = security_getdriver(auth);