- DEBUG(0,("FSCTL_GET_SHADOW_COPY_DATA: "
- "connectpath %s, failed.\n",
- smbreq->conn->connectpath));
- status = map_nt_error_from_unix(errno);
- }
- TALLOC_FREE(shadow_data);
- tevent_req_nterror(req, status);
- return tevent_req_post(req, ev);
- }
-
- labels_data_count =
- (shadow_data->num_volumes*2*sizeof(SHADOW_COPY_LABEL))
- + 2;
-
- if (labels) {
- data_count = 12+labels_data_count+4;
- } else {
- data_count = 16;
- }
-
- if (labels && (in_max_output < data_count)) {
- DEBUG(0, ("FSCTL_GET_SHADOW_COPY_DATA: "
- "in_max_output(%u) too small (%u) bytes "
- "needed!\n", in_max_output, data_count));
- TALLOC_FREE(shadow_data);
- tevent_req_nterror(req, NT_STATUS_BUFFER_TOO_SMALL);
- return tevent_req_post(req, ev);
- }
-
- state->out_output = data_blob_talloc(state, NULL, data_count);
- if (tevent_req_nomem(state->out_output.data, req)) {
- return tevent_req_post(req, ev);
- }
-
- pdata = (char *)state->out_output.data;
-
- /* num_volumes 4 bytes */
- SIVAL(pdata, 0, shadow_data->num_volumes);
-
- if (labels) {
- /* num_labels 4 bytes */
- SIVAL(pdata, 4, shadow_data->num_volumes);
- }
-
- /* needed_data_count 4 bytes */
- SIVAL(pdata, 8, labels_data_count+4);
-
- pdata += 12;
-
- DEBUG(10,("FSCTL_GET_SHADOW_COPY_DATA: %u volumes for "
- "path[%s].\n",
- shadow_data->num_volumes, fsp_str_dbg(fsp)));
- if (labels && shadow_data->labels) {
- for (i=0; i<shadow_data->num_volumes; i++) {
- srvstr_push(pdata, smbreq->flags2,
- pdata, shadow_data->labels[i],
- 2*sizeof(SHADOW_COPY_LABEL),
- STR_UNICODE|STR_TERMINATE);
- pdata += 2*sizeof(SHADOW_COPY_LABEL);
- DEBUGADD(10, ("Label[%u]: '%s'\n", i,
- shadow_data->labels[i]));