summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJeremy Allison <jra@samba.org>2011-12-01 13:47:12 -0800
committerJeremy Allison <jra@samba.org>2011-12-02 00:23:13 +0100
commit30d4484bf95eecc0e2c9e94d26ae41ee38bbba97 (patch)
tree1d77beae5b1aa13158d756ef9a64c43234069aca
parentaf76d2588c9aab9ed0eb71ab216ea55faaa40cf2 (diff)
downloadsamba-30d4484bf95eecc0e2c9e94d26ae41ee38bbba97.tar.gz
samba-30d4484bf95eecc0e2c9e94d26ae41ee38bbba97.tar.bz2
samba-30d4484bf95eecc0e2c9e94d26ae41ee38bbba97.zip
Add the "backup" toggle command to smbclient. In order for this to be
really useful we need to change to using NTCreateX opens by default in cli_open() and fall back to old OpenX calls instead of doing it the other way around. Autobuild-User: Jeremy Allison <jra@samba.org> Autobuild-Date: Fri Dec 2 00:23:13 CET 2011 on sn-devel-104
-rw-r--r--docs-xml/manpages-3/smbclient.1.xml11
-rw-r--r--source3/client/client.c14
2 files changed, 25 insertions, 0 deletions
diff --git a/docs-xml/manpages-3/smbclient.1.xml b/docs-xml/manpages-3/smbclient.1.xml
index fe1e011b03..c79d9dfbf8 100644
--- a/docs-xml/manpages-3/smbclient.1.xml
+++ b/docs-xml/manpages-3/smbclient.1.xml
@@ -559,6 +559,17 @@
</varlistentry>
<varlistentry>
+ <term>backup</term>
+ <listitem><para>Toggle the state of the "backup intent" flag
+ sent to the server on directory listings and file opens. If
+ the "backup intent" flag is true, the server will try and
+ bypass some file system checks if the user has been granted
+ SE_BACKUP or SE_RESTORE privilages. This state is useful when
+ performing a backup or restore operation.
+ </para></listitem>
+ </varlistentry>
+
+ <varlistentry>
<term>blocksize &lt;number&gt;</term>
<listitem><para>Sets the blocksize parameter for a tar operation. The default is 20.
Causes tar file to be written out in blocksize*TBLOCK (normally 512 byte) units.
diff --git a/source3/client/client.c b/source3/client/client.c
index 22f861bb02..47d44705d2 100644
--- a/source3/client/client.c
+++ b/source3/client/client.c
@@ -88,6 +88,7 @@ static bool prompt = true;
static bool recurse = false;
static bool showacls = false;
bool lowercase = false;
+static bool backup_intent = false;
static struct sockaddr_storage dest_ss;
static char dest_ss_str[INET6_ADDRSTRLEN];
@@ -3923,6 +3924,18 @@ static int cmd_archive(void)
}
/****************************************************************************
+ Toggle the backup_intent state.
+****************************************************************************/
+
+static int cmd_backup(void)
+{
+ backup_intent = !backup_intent;
+ cli_set_backup_intent(cli, backup_intent);
+ DEBUG(2,("backup intent is now %s\n",backup_intent?"on":"off"));
+ return 1;
+}
+
+/****************************************************************************
Toggle the lowercaseflag.
****************************************************************************/
@@ -4519,6 +4532,7 @@ static struct {
{COMPL_NONE,COMPL_NONE}},
{"altname",cmd_altname,"<file> show alt name",{COMPL_NONE,COMPL_NONE}},
{"archive",cmd_archive,"<level>\n0=ignore archive bit\n1=only get archive files\n2=only get archive files and reset archive bit\n3=get all files and reset archive bit",{COMPL_NONE,COMPL_NONE}},
+ {"backup",cmd_backup,"toggle backup intent state",{COMPL_NONE,COMPL_NONE}},
{"blocksize",cmd_block,"blocksize <number> (default 20)",{COMPL_NONE,COMPL_NONE}},
{"cancel",cmd_cancel,"<jobid> cancel a print queue entry",{COMPL_NONE,COMPL_NONE}},
{"case_sensitive",cmd_setcase,"toggle the case sensitive flag to server",{COMPL_NONE,COMPL_NONE}},