2 * Unix SMB/CIFS implementation.
4 * File Server Remote VSS Protocol (FSRVP) client
6 * Copyright (C) David Disseldorp 2012
8 * This program is free software; you can redistribute it and/or modify
9 * it under the terms of the GNU General Public License as published by
10 * the Free Software Foundation; either version 3 of the License, or
11 * (at your option) any later version.
13 * This program is distributed in the hope that it will be useful,
14 * but WITHOUT ANY WARRANTY; without even the implied warranty of
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 * GNU General Public License for more details.
18 * You should have received a copy of the GNU General Public License
19 * along with this program. If not, see <http://www.gnu.org/licenses/>.
23 #include "rpcclient.h"
24 #include "../librpc/gen_ndr/ndr_fsrvp.h"
25 #include "../librpc/gen_ndr/ndr_fsrvp_c.h"
27 struct fss_context_map
{
32 struct fss_context_map ctx_map
[] = {
34 .ctx_val
= FSRVP_CTX_BACKUP
,
36 .ctx_desc
= "auto-release, non-persistent shadow-copy.",
39 .ctx_val
= FSRVP_CTX_FILE_SHARE_BACKUP
,
40 .ctx_str
= "file_share_backup",
41 .ctx_desc
= "auto-release, non-persistent shadow-copy created "
42 "without writer involvement.",
45 .ctx_val
= FSRVP_CTX_NAS_ROLLBACK
,
46 .ctx_str
= "nas_rollback",
47 .ctx_desc
= "non-auto-release, persistent shadow-copy created "
48 "without writer involvement.",
51 .ctx_val
= FSRVP_CTX_APP_ROLLBACK
,
52 .ctx_str
= "app_rollback",
53 .ctx_desc
= "non-auto-release, persistent shadow-copy.",
58 static bool map_fss_ctx_str(const char *ctx_str
,
63 for (i
= 0; ctx_map
[i
].ctx_str
!= NULL
; i
++) {
64 if (!strcmp(ctx_map
[i
].ctx_str
, ctx_str
)) {
65 *ctx_val
= ctx_map
[i
].ctx_val
;
72 static void cmd_fss_is_path_sup_usage(const char *script_name
)
74 printf("usage: %s [share_name]\n", script_name
);
77 static NTSTATUS
cmd_fss_is_path_sup(struct rpc_pipe_client
*cli
,
78 TALLOC_CTX
*mem_ctx
, int argc
,
82 struct fss_IsPathSupported r
;
83 struct dcerpc_binding_handle
*b
= cli
->binding_handle
;
86 cmd_fss_is_path_sup_usage(argv
[0]);
87 return NT_STATUS_UNSUCCESSFUL
;
91 r
.in
.ShareName
= talloc_asprintf(mem_ctx
, "%s\\%s\\",
92 cli
->srv_name_slash
, argv
[1]);
93 if (r
.in
.ShareName
== NULL
) {
94 return NT_STATUS_NO_MEMORY
;
97 status
= dcerpc_fss_IsPathSupported_r(b
, mem_ctx
, &r
);
98 if (!NT_STATUS_IS_OK(status
)) {
99 DEBUG(0, ("IsPathSupported failed with UNC %s\n",
101 return NT_STATUS_UNSUCCESSFUL
;
102 } else if (r
.out
.result
) {
103 DEBUG(0, ("failed IsPathSupported response: 0x%x\n",
105 return NT_STATUS_UNSUCCESSFUL
;
107 printf("UNC %s %s shadow copy requests\n", r
.in
.ShareName
,
108 *r
.out
.SupportedByThisProvider
? "supports" : "does not support");
113 static void cmd_fss_get_sup_version_usage(const char *script_name
)
115 printf("usage: %s\n", script_name
);
118 static NTSTATUS
cmd_fss_get_sup_version(struct rpc_pipe_client
*cli
,
119 TALLOC_CTX
*mem_ctx
, int argc
,
123 struct fss_GetSupportedVersion r
;
124 struct dcerpc_binding_handle
*b
= cli
->binding_handle
;
127 cmd_fss_get_sup_version_usage(argv
[0]);
128 return NT_STATUS_UNSUCCESSFUL
;
132 status
= dcerpc_fss_GetSupportedVersion_r(b
, mem_ctx
, &r
);
133 if (!NT_STATUS_IS_OK(status
) || (r
.out
.result
!= 0)) {
134 DEBUG(0, ("GetSupportedVersion failed: %s result: 0x%x\n",
135 nt_errstr(status
), r
.out
.result
));
136 return NT_STATUS_UNSUCCESSFUL
;
138 printf("server %s supports FSRVP versions from %u to %u\n",
139 cli
->desthost
, *r
.out
.MinVersion
, *r
.out
.MaxVersion
);
144 static void cmd_fss_create_expose_usage(const char *script_name
)
148 printf("usage: %s [fss_context] [ro|rw] [share1] <share2> ...\n"
149 "[fss_context] values:\n", script_name
);
150 for (i
= 0; ctx_map
[i
].ctx_str
!= NULL
; i
++) {
151 printf("\t%s: %s\n", ctx_map
[i
].ctx_str
, ctx_map
[i
].ctx_desc
);
155 static NTSTATUS
cmd_fss_create_expose_parse(TALLOC_CTX
*mem_ctx
, int argc
,
157 const char *desthost
,
158 uint32_t *fss_ctx_val
,
160 struct fssagent_share_mapping_1
**maps
)
162 int num_non_share_args
= 3;
165 struct fssagent_share_mapping_1
*map_array
;
168 return NT_STATUS_INVALID_PARAMETER
;
171 if (!map_fss_ctx_str(argv
[1], fss_ctx_val
)) {
172 return NT_STATUS_INVALID_PARAMETER
;
175 if (!strcmp(argv
[2], "rw")) {
176 /* shadow-copy is created as read-write */
177 *fss_ctx_val
|= ATTR_AUTO_RECOVERY
;
178 } else if (strcmp(argv
[2], "ro")) {
179 return NT_STATUS_INVALID_PARAMETER
;
182 num_share_args
= argc
- num_non_share_args
;
183 map_array
= talloc_array(mem_ctx
, struct fssagent_share_mapping_1
,
185 if (map_array
== NULL
) {
186 return NT_STATUS_NO_MEMORY
;
189 for (i
= 0; i
< num_share_args
; i
++) {
191 * A trailing slash should to be present in the request UNC,
192 * otherwise Windows Server 2012 FSRVP servers don't append
193 * a '$' to exposed hidden share shadow-copies. E.g.
194 * AddToShadowCopySet(UNC=\\server\hidden$)
195 * CommitShadowCopySet()
196 * ExposeShadowCopySet()
197 * -> new share = \\server\hidden$@{ShadowCopy.ShadowCopyId}
199 * AddToShadowCopySet(UNC=\\server\hidden$\)
200 * CommitShadowCopySet()
201 * ExposeShadowCopySet()
202 * -> new share = \\server\hidden$@{ShadowCopy.ShadowCopyId}$
204 map_array
[i
].ShareNameUNC
= talloc_asprintf(mem_ctx
,
207 argv
[i
+ num_non_share_args
]);
208 if (map_array
[i
].ShareNameUNC
== NULL
) {
209 return NT_STATUS_NO_MEMORY
;
212 *num_maps
= num_share_args
;
218 static NTSTATUS
cmd_fss_abort(TALLOC_CTX
*mem_ctx
,
219 struct dcerpc_binding_handle
*b
,
220 struct GUID
*sc_set_id
)
223 struct fss_AbortShadowCopySet r_scset_abort
;
225 ZERO_STRUCT(r_scset_abort
);
226 r_scset_abort
.in
.ShadowCopySetId
= *sc_set_id
;
227 status
= dcerpc_fss_AbortShadowCopySet_r(b
, mem_ctx
, &r_scset_abort
);
228 if (!NT_STATUS_IS_OK(status
) || (r_scset_abort
.out
.result
!= 0)) {
229 DEBUG(0, ("AbortShadowCopySet failed: %s result: 0x%x\n",
230 nt_errstr(status
), r_scset_abort
.out
.result
));
231 return NT_STATUS_UNSUCCESSFUL
;
236 static NTSTATUS
cmd_fss_create_expose(struct rpc_pipe_client
*cli
,
237 TALLOC_CTX
*mem_ctx
, int argc
,
241 struct fss_GetSupportedVersion r_version_get
;
242 struct fss_SetContext r_context_set
;
243 struct fss_StartShadowCopySet r_scset_start
;
244 struct fss_PrepareShadowCopySet r_scset_prep
;
245 struct fss_CommitShadowCopySet r_scset_commit
;
246 struct fss_ExposeShadowCopySet r_scset_expose
;
247 struct dcerpc_binding_handle
*b
= cli
->binding_handle
;
250 uint32_t fss_ctx_val
;
252 struct fssagent_share_mapping_1
*req_maps
;
255 tmp_ctx
= talloc_new(mem_ctx
);
256 if (tmp_ctx
== NULL
) {
257 return NT_STATUS_NO_MEMORY
;
260 status
= cmd_fss_create_expose_parse(tmp_ctx
, argc
, argv
, cli
->desthost
,
261 &fss_ctx_val
, &num_maps
, &req_maps
);
262 if (!NT_STATUS_IS_OK(status
)) {
263 cmd_fss_create_expose_usage(argv
[0]);
268 * PrepareShadowCopySet & CommitShadowCopySet often exceed the default
269 * 60 second dcerpc request timeout against Windows Server "8" Beta.
270 * ACHTUNG! dcerpc_binding_handle_set_timeout() value is interpreted as
271 * seconds on a source4 transport and as msecs here.
273 dcerpc_binding_handle_set_timeout(b
, 240 * 1000);
275 for (i
= 0; i
< num_maps
; i
++) {
276 struct fss_IsPathSupported r_pathsupport_get
;
277 r_pathsupport_get
.in
.ShareName
= req_maps
[i
].ShareNameUNC
;
278 status
= dcerpc_fss_IsPathSupported_r(b
, tmp_ctx
, &r_pathsupport_get
);
279 if (!NT_STATUS_IS_OK(status
) || (r_pathsupport_get
.out
.result
!= 0)) {
280 DEBUG(0, ("IsPathSupported failed: %s result: 0x%x\n",
281 nt_errstr(status
), r_pathsupport_get
.out
.result
));
284 if (!r_pathsupport_get
.out
.SupportedByThisProvider
) {
285 printf("path %s does not supported shadow-copies\n",
286 req_maps
[i
].ShareNameUNC
);
287 status
= NT_STATUS_NOT_SUPPORTED
;
292 ZERO_STRUCT(r_version_get
);
293 status
= dcerpc_fss_GetSupportedVersion_r(b
, tmp_ctx
, &r_version_get
);
294 if (!NT_STATUS_IS_OK(status
) || (r_version_get
.out
.result
!= 0)) {
295 DEBUG(0, ("GetSupportedVersion failed: %s result: 0x%x\n",
296 nt_errstr(status
), r_version_get
.out
.result
));
300 ZERO_STRUCT(r_context_set
);
301 r_context_set
.in
.Context
= fss_ctx_val
;
302 status
= dcerpc_fss_SetContext_r(b
, tmp_ctx
, &r_context_set
);
303 if (!NT_STATUS_IS_OK(status
) || (r_context_set
.out
.result
!= 0)) {
304 DEBUG(0, ("SetContext failed: %s result: 0x%x\n",
305 nt_errstr(status
), r_context_set
.out
.result
));
309 ZERO_STRUCT(r_scset_start
);
310 r_scset_start
.in
.ClientShadowCopySetId
= GUID_random();
311 status
= dcerpc_fss_StartShadowCopySet_r(b
, tmp_ctx
, &r_scset_start
);
312 if (!NT_STATUS_IS_OK(status
) || (r_scset_start
.out
.result
!= 0)) {
313 DEBUG(0, ("StartShadowCopySet failed: %s result: 0x%x\n",
314 nt_errstr(status
), r_scset_start
.out
.result
));
317 printf("%s: shadow-copy set created\n",
318 GUID_string(tmp_ctx
, r_scset_start
.out
.pShadowCopySetId
));
320 for (i
= 0; i
< num_maps
; i
++) {
321 struct fss_AddToShadowCopySet r_scset_add
;
322 r_scset_add
.in
.ClientShadowCopyId
= GUID_random();
323 r_scset_add
.in
.ShadowCopySetId
= *r_scset_start
.out
.pShadowCopySetId
;
324 r_scset_add
.in
.ShareName
= req_maps
[i
].ShareNameUNC
;
325 status
= dcerpc_fss_AddToShadowCopySet_r(b
, tmp_ctx
, &r_scset_add
);
326 if (!NT_STATUS_IS_OK(status
) || (r_scset_add
.out
.result
!= 0)) {
327 DEBUG(0, ("AddToShadowCopySet failed: %s result: 0x%x\n",
328 nt_errstr(status
), r_scset_add
.out
.result
));
329 goto err_sc_set_abort
;
331 printf("%s(%s): %s shadow-copy added to set\n",
332 GUID_string(tmp_ctx
, r_scset_start
.out
.pShadowCopySetId
),
333 GUID_string(tmp_ctx
, r_scset_add
.out
.pShadowCopyId
),
334 r_scset_add
.in
.ShareName
);
335 req_maps
[i
].ShadowCopySetId
= *r_scset_start
.out
.pShadowCopySetId
;
336 req_maps
[i
].ShadowCopyId
= *r_scset_add
.out
.pShadowCopyId
;
339 start_time
= time_mono(NULL
);
340 ZERO_STRUCT(r_scset_prep
);
341 r_scset_prep
.in
.ShadowCopySetId
= *r_scset_start
.out
.pShadowCopySetId
;
342 r_scset_prep
.in
.TimeOutInMilliseconds
= (240 * 1000);
343 status
= dcerpc_fss_PrepareShadowCopySet_r(b
, tmp_ctx
, &r_scset_prep
);
344 if (!NT_STATUS_IS_OK(status
) || (r_scset_prep
.out
.result
!= 0)) {
345 DEBUG(0, ("PrepareShadowCopySet failed: %s result: 0x%x\n",
346 nt_errstr(status
), r_scset_prep
.out
.result
));
347 goto err_sc_set_abort
;
349 printf("%s: prepare completed in %llu secs\n",
350 GUID_string(tmp_ctx
, r_scset_start
.out
.pShadowCopySetId
),
351 (long long unsigned int)(time_mono(NULL
) - start_time
));
353 start_time
= time_mono(NULL
);
354 ZERO_STRUCT(r_scset_commit
);
355 r_scset_commit
.in
.ShadowCopySetId
= *r_scset_start
.out
.pShadowCopySetId
;
356 r_scset_commit
.in
.TimeOutInMilliseconds
= (180 * 1000); /* win8 */
357 status
= dcerpc_fss_CommitShadowCopySet_r(b
, tmp_ctx
, &r_scset_commit
);
358 if (!NT_STATUS_IS_OK(status
) || (r_scset_commit
.out
.result
!= 0)) {
359 DEBUG(0, ("CommitShadowCopySet failed: %s result: 0x%x\n",
360 nt_errstr(status
), r_scset_commit
.out
.result
));
361 goto err_sc_set_abort
;
363 printf("%s: commit completed in %llu secs\n",
364 GUID_string(tmp_ctx
, r_scset_start
.out
.pShadowCopySetId
),
365 (long long unsigned int)(time_mono(NULL
) - start_time
));
367 ZERO_STRUCT(r_scset_expose
);
368 r_scset_expose
.in
.ShadowCopySetId
= *r_scset_start
.out
.pShadowCopySetId
;
369 r_scset_expose
.in
.TimeOutInMilliseconds
= (120 * 1000); /* win8 */
370 status
= dcerpc_fss_ExposeShadowCopySet_r(b
, tmp_ctx
, &r_scset_expose
);
371 if (!NT_STATUS_IS_OK(status
) || (r_scset_expose
.out
.result
!= 0)) {
372 DEBUG(0, ("ExposeShadowCopySet failed: %s result: 0x%x\n",
373 nt_errstr(status
), r_scset_expose
.out
.result
));
377 for (i
= 0; i
< num_maps
; i
++) {
378 struct fss_GetShareMapping r_sharemap_get
;
379 struct fssagent_share_mapping_1
*map
;
380 r_sharemap_get
.in
.ShadowCopyId
= req_maps
[i
].ShadowCopyId
;
381 r_sharemap_get
.in
.ShadowCopySetId
= req_maps
[i
].ShadowCopySetId
;
382 r_sharemap_get
.in
.ShareName
= req_maps
[i
].ShareNameUNC
;
383 r_sharemap_get
.in
.Level
= 1;
384 status
= dcerpc_fss_GetShareMapping_r(b
, tmp_ctx
, &r_sharemap_get
);
385 if (!NT_STATUS_IS_OK(status
) || (r_sharemap_get
.out
.result
!= 0)) {
386 DEBUG(0, ("GetShareMapping failed: %s result: 0x%x\n",
387 nt_errstr(status
), r_sharemap_get
.out
.result
));
390 map
= r_sharemap_get
.out
.ShareMapping
->ShareMapping1
;
391 printf("%s(%s): share %s exposed as a snapshot of %s\n",
392 GUID_string(tmp_ctx
, &map
->ShadowCopySetId
),
393 GUID_string(tmp_ctx
, &map
->ShadowCopyId
),
394 map
->ShadowCopyShareName
, map
->ShareNameUNC
);
397 talloc_free(tmp_ctx
);
401 cmd_fss_abort(tmp_ctx
, b
, r_scset_start
.out
.pShadowCopySetId
);
403 talloc_free(tmp_ctx
);
407 static void cmd_fss_delete_usage(const char *script_name
)
409 printf("usage: %s [base_share] [shadow_copy_set_id] [shadow_copy_id]\n",
413 static NTSTATUS
cmd_fss_delete(struct rpc_pipe_client
*cli
,
414 TALLOC_CTX
*mem_ctx
, int argc
,
417 struct dcerpc_binding_handle
*b
= cli
->binding_handle
;
418 struct fss_DeleteShareMapping r_sharemap_del
;
419 const char *sc_set_id
;
425 cmd_fss_delete_usage(argv
[0]);
426 return NT_STATUS_UNSUCCESSFUL
;
431 tmp_ctx
= talloc_new(mem_ctx
);
432 if (tmp_ctx
== NULL
) {
433 return NT_STATUS_NO_MEMORY
;
436 ZERO_STRUCT(r_sharemap_del
);
437 r_sharemap_del
.in
.ShareName
= talloc_asprintf(tmp_ctx
, "\\\\%s\\%s\\",
438 cli
->desthost
, argv
[1]);
439 if (r_sharemap_del
.in
.ShareName
== NULL
) {
440 status
= NT_STATUS_NO_MEMORY
;
443 status
= GUID_from_string(sc_set_id
, &r_sharemap_del
.in
.ShadowCopySetId
);
444 if (!NT_STATUS_IS_OK(status
)) {
445 DEBUG(0, ("Invalid shadow_copy_set_id parameter\n"));
448 status
= GUID_from_string(sc_id
, &r_sharemap_del
.in
.ShadowCopyId
);
449 if (!NT_STATUS_IS_OK(status
)) {
450 DEBUG(0, ("Invalid shadow_copy_id parameter\n"));
453 status
= dcerpc_fss_DeleteShareMapping_r(b
, tmp_ctx
, &r_sharemap_del
);
454 if (!NT_STATUS_IS_OK(status
)) {
455 DEBUG(0, ("DeleteShareMapping failed\n"));
457 } else if (r_sharemap_del
.out
.result
!= 0) {
458 DEBUG(0, ("failed DeleteShareMapping response: 0x%x\n",
459 r_sharemap_del
.out
.result
));
460 status
= NT_STATUS_UNSUCCESSFUL
;
464 printf("%s(%s): %s shadow-copy deleted\n",
465 sc_set_id
, sc_id
, r_sharemap_del
.in
.ShareName
);
468 talloc_free(tmp_ctx
);
472 static void cmd_fss_is_shadow_copied_usage(const char *script_name
)
474 printf("usage: %s [share_name]\n", script_name
);
477 static NTSTATUS
cmd_fss_is_shadow_copied(struct rpc_pipe_client
*cli
,
478 TALLOC_CTX
*mem_ctx
, int argc
,
482 struct fss_IsPathShadowCopied r
;
483 struct dcerpc_binding_handle
*b
= cli
->binding_handle
;
486 cmd_fss_is_shadow_copied_usage(argv
[0]);
487 return NT_STATUS_UNSUCCESSFUL
;
491 r
.in
.ShareName
= talloc_asprintf(mem_ctx
, "%s\\%s\\",
492 cli
->srv_name_slash
, argv
[1]);
493 if (r
.in
.ShareName
== NULL
) {
494 return NT_STATUS_NO_MEMORY
;
497 status
= dcerpc_fss_IsPathShadowCopied_r(b
, mem_ctx
, &r
);
498 if (!NT_STATUS_IS_OK(status
)) {
499 DEBUG(0, ("IsPathShadowCopied failed with UNC %s\n",
501 return NT_STATUS_UNSUCCESSFUL
;
502 } else if (r
.out
.result
) {
503 DEBUG(0, ("failed IsPathShadowCopied response: 0x%x\n",
505 return NT_STATUS_UNSUCCESSFUL
;
507 printf("UNC %s %s an associated shadow-copy with compatibility 0x%x\n",
509 *r
.out
.ShadowCopyPresent
? "has" : "does not have",
510 *r
.out
.ShadowCopyCompatibility
);
515 static void cmd_fss_get_mapping_usage(const char *script_name
)
517 printf("usage: %s [base_share] [shadow_copy_set_id] [shadow_copy_id]\n",
521 static NTSTATUS
cmd_fss_get_mapping(struct rpc_pipe_client
*cli
,
522 TALLOC_CTX
*mem_ctx
, int argc
,
525 struct dcerpc_binding_handle
*b
= cli
->binding_handle
;
526 struct fss_GetShareMapping r_sharemap_get
;
527 const char *sc_set_id
;
529 struct fssagent_share_mapping_1
*map
;
534 cmd_fss_get_mapping_usage(argv
[0]);
535 return NT_STATUS_UNSUCCESSFUL
;
540 tmp_ctx
= talloc_new(mem_ctx
);
541 if (tmp_ctx
== NULL
) {
542 return NT_STATUS_NO_MEMORY
;
545 ZERO_STRUCT(r_sharemap_get
);
546 r_sharemap_get
.in
.ShareName
= talloc_asprintf(tmp_ctx
, "\\\\%s\\%s\\",
547 cli
->desthost
, argv
[1]);
548 if (r_sharemap_get
.in
.ShareName
== NULL
) {
549 status
= NT_STATUS_NO_MEMORY
;
552 status
= GUID_from_string(sc_set_id
, &r_sharemap_get
.in
.ShadowCopySetId
);
553 if (!NT_STATUS_IS_OK(status
)) {
554 DEBUG(0, ("Invalid shadow_copy_set_id parameter\n"));
557 status
= GUID_from_string(sc_id
, &r_sharemap_get
.in
.ShadowCopyId
);
558 if (!NT_STATUS_IS_OK(status
)) {
559 DEBUG(0, ("Invalid shadow_copy_id parameter\n"));
562 r_sharemap_get
.in
.Level
= 1;
563 status
= dcerpc_fss_GetShareMapping_r(b
, tmp_ctx
, &r_sharemap_get
);
564 if (!NT_STATUS_IS_OK(status
)) {
565 DEBUG(0, ("GetShareMapping failed\n"));
567 } else if (r_sharemap_get
.out
.result
!= 0) {
568 DEBUG(0, ("failed GetShareMapping response: 0x%x\n",
569 r_sharemap_get
.out
.result
));
570 status
= NT_STATUS_UNSUCCESSFUL
;
574 map
= r_sharemap_get
.out
.ShareMapping
->ShareMapping1
;
575 printf("%s(%s): share %s is a shadow-copy of %s at %s\n",
576 GUID_string(tmp_ctx
, &map
->ShadowCopySetId
),
577 GUID_string(tmp_ctx
, &map
->ShadowCopyId
),
578 map
->ShadowCopyShareName
, map
->ShareNameUNC
,
579 nt_time_string(tmp_ctx
, map
->tstamp
));
582 talloc_free(tmp_ctx
);
586 static void cmd_fss_recov_complete_usage(const char *script_name
)
588 printf("usage: %s [shadow_copy_set_id]\n", script_name
);
591 static NTSTATUS
cmd_fss_recov_complete(struct rpc_pipe_client
*cli
,
592 TALLOC_CTX
*mem_ctx
, int argc
,
596 struct fss_RecoveryCompleteShadowCopySet r
;
597 struct dcerpc_binding_handle
*b
= cli
->binding_handle
;
598 const char *sc_set_id
;
601 cmd_fss_recov_complete_usage(argv
[0]);
602 return NT_STATUS_UNSUCCESSFUL
;
607 status
= GUID_from_string(sc_set_id
, &r
.in
.ShadowCopySetId
);
608 if (!NT_STATUS_IS_OK(status
)) {
609 DEBUG(0, ("Invalid shadow_copy_set_id\n"));
610 return NT_STATUS_INVALID_PARAMETER
;
613 status
= dcerpc_fss_RecoveryCompleteShadowCopySet_r(b
, mem_ctx
, &r
);
614 if (!NT_STATUS_IS_OK(status
) || (r
.out
.result
!= 0)) {
615 DEBUG(0, ("RecoveryCompleteShadowCopySet failed: %s "
616 "result: 0x%x\n", nt_errstr(status
), r
.out
.result
));
619 printf("%s: shadow-copy set marked recovery complete\n", sc_set_id
);
624 /* List of commands exported by this module */
625 struct cmd_set fss_commands
[] = {
630 .name
= "fss_is_path_sup",
631 .returntype
= RPC_RTYPE_NTSTATUS
,
632 .ntfn
= cmd_fss_is_path_sup
,
633 .table
= &ndr_table_FileServerVssAgent
,
635 .description
= "Check whether a share supports shadow-copy "
640 .name
= "fss_get_sup_version",
641 .returntype
= RPC_RTYPE_NTSTATUS
,
642 .ntfn
= cmd_fss_get_sup_version
,
643 .table
= &ndr_table_FileServerVssAgent
,
645 .description
= "Get supported FSRVP version from server",
649 .name
= "fss_create_expose",
650 .returntype
= RPC_RTYPE_NTSTATUS
,
651 .ntfn
= cmd_fss_create_expose
,
652 .table
= &ndr_table_FileServerVssAgent
,
654 .description
= "Request shadow-copy creation and exposure",
658 .name
= "fss_delete",
659 .returntype
= RPC_RTYPE_NTSTATUS
,
660 .ntfn
= cmd_fss_delete
,
661 .table
= &ndr_table_FileServerVssAgent
,
663 .description
= "Request shadow-copy share deletion",
667 .name
= "fss_has_shadow_copy",
668 .returntype
= RPC_RTYPE_NTSTATUS
,
669 .ntfn
= cmd_fss_is_shadow_copied
,
670 .table
= &ndr_table_FileServerVssAgent
,
672 .description
= "Check for an associated share shadow-copy",
676 .name
= "fss_get_mapping",
677 .returntype
= RPC_RTYPE_NTSTATUS
,
678 .ntfn
= cmd_fss_get_mapping
,
679 .table
= &ndr_table_FileServerVssAgent
,
681 .description
= "Get shadow-copy share mapping information",
685 .name
= "fss_recovery_complete",
686 .returntype
= RPC_RTYPE_NTSTATUS
,
687 .ntfn
= cmd_fss_recov_complete
,
688 .table
= &ndr_table_FileServerVssAgent
,
690 .description
= "Flag read-write snapshot as recovery complete, "
691 "allowing further shadow-copy requests",