From: Volker Lendecke Date: Mon, 29 Nov 2010 17:09:49 +0000 (+0100) Subject: s3: Add shadow copy info to smbclient allinfo X-Git-Url: http://git.samba.org/?p=obnox%2Fsamba-ctdb.git;a=commitdiff_plain;h=8e7604d69e44877f453fa198d1e707e5747bc76b s3: Add shadow copy info to smbclient allinfo Autobuild-User: Volker Lendecke Autobuild-Date: Tue Nov 30 12:23:50 CET 2010 on sn-devel-104 --- diff --git a/source3/client/client.c b/source3/client/client.c index 71c3f44aee..dd9ad165e0 100644 --- a/source3/client/client.c +++ b/source3/client/client.c @@ -1537,9 +1537,13 @@ static int do_allinfo(const char *name) uint16_t mode; SMB_INO_T ino; NTTIME tmp; + int fnum; unsigned int num_streams; struct stream_struct *streams; + int num_snapshots; + char **snapshots; unsigned int i; + NTSTATUS status; if (!NT_STATUS_IS_OK(cli_qpathinfo_alt_name(cli, name, altname))) { d_printf("%s getting alt name for %s\n", @@ -1579,6 +1583,48 @@ static int do_allinfo(const char *name) (unsigned long long)streams[i].size); } + fnum = cli_open(cli, name, O_RDONLY, DENY_NONE); + if (fnum == -1) { + /* + * Ignore failure, it does not hurt if we can't list + * snapshots + */ + return 0; + } + status = cli_shadow_copy_data(talloc_tos(), cli, fnum, + true, &snapshots, &num_snapshots); + if (!NT_STATUS_IS_OK(status)) { + cli_close(cli, fnum); + return 0; + } + + for (i=0; i