X-Git-Url: https://git.gag.com/?a=blobdiff_plain;f=ndmp-src%2Fndmjob_args.c;fp=ndmp-src%2Fndmjob_args.c;h=f31f59797e1984eeebd3533850bfdf5627525f30;hb=109540caa4e37a3663b3dcfb9a205b9609e3f561;hp=dc0e473a253ef53f975bd39c64549c3efd1a2974;hpb=4c9eba1feb11adf189bceb4001c425e641f0b56a;p=debian%2Famanda diff --git a/ndmp-src/ndmjob_args.c b/ndmp-src/ndmjob_args.c index dc0e473..f31f597 100644 --- a/ndmp-src/ndmjob_args.c +++ b/ndmp-src/ndmjob_args.c @@ -117,6 +117,7 @@ char *help_text[] = { " -o use-eject=N", " -- use eject when unloading tapes (default 0)", " -o tape-tcp=hostname:port -- send the data directly to that tcp port.", + " -o D-agent-fd= -- file descriptor to read the -D agent.", "CONTROL of ROBOT agent parameters", " -R AGENT -- robot agent if different than -T (see AGENT below)", " -m MEDIA -- add entry to media table (see below)", @@ -660,6 +661,22 @@ handle_long_option (char *str) o_config_file = value; } else if (strcmp (name, "tape-tcp") == 0 && value) { o_tape_tcp = value; + } else if (strcmp (name, "D-agent-fd") == 0 && value) { + char d_agent[1025]; + int fd = atoi(value); + int size; + + if (AGENT_GIVEN(D_data_agent)) { + error_byebye ("more than one of -D or -D-agent-fd"); + } + + size = full_read(fd, d_agent, 1024); + d_agent[size] = '\0'; + if (size > 0 && d_agent[size-1] == '\n') + d_agent[size-1] = '\0'; + if (ndmagent_from_str (&D_data_agent, d_agent)) { + error_byebye ("bad -D-agent-fd argument"); + } } else if (strcmp (name, "tape-limit") == 0) { if (!value) { error_byebye ("tape-limit argument is required");