summaryrefslogtreecommitdiff
path: root/source3/torture
diff options
context:
space:
mode:
authorVolker Lendecke <vl@samba.org>2012-02-02 19:36:00 +0100
committerVolker Lendecke <vl@samba.org>2012-02-02 20:35:27 +0100
commitdbe9ff29996287e6b91b69cd56d61e0a83f551a7 (patch)
tree874208910ef12411d301ae172db590afaf54a7fe /source3/torture
parent0a000f1ca7282f865e5e92ce508a67573fda6c76 (diff)
downloadsamba-dbe9ff29996287e6b91b69cd56d61e0a83f551a7.tar.gz
samba-dbe9ff29996287e6b91b69cd56d61e0a83f551a7.tar.bz2
samba-dbe9ff29996287e6b91b69cd56d61e0a83f551a7.zip
s3-vfstest: Add setxattr
Diffstat (limited to 'source3/torture')
-rw-r--r--source3/torture/cmd_vfs.c27
1 files changed, 27 insertions, 0 deletions
diff --git a/source3/torture/cmd_vfs.c b/source3/torture/cmd_vfs.c
index 786eeb8ced..9e1c62db10 100644
--- a/source3/torture/cmd_vfs.c
+++ b/source3/torture/cmd_vfs.c
@@ -1228,6 +1228,31 @@ static NTSTATUS cmd_listxattr(struct vfs_state *vfs, TALLOC_CTX *mem_ctx,
return NT_STATUS_OK;
}
+static NTSTATUS cmd_setxattr(struct vfs_state *vfs, TALLOC_CTX *mem_ctx,
+ int argc, const char **argv)
+{
+ ssize_t ret;
+ int flags = 0;
+
+ if ((argc < 4) || (argc > 5)) {
+ printf("Usage: setxattr <path> <xattr> <value> [flags]\n");
+ return NT_STATUS_OK;
+ }
+
+ if (argc == 5) {
+ flags = atoi(argv[4]);
+ }
+
+ ret = SMB_VFS_SETXATTR(vfs->conn, argv[1], argv[2],
+ argv[3], strlen(argv[3]), flags);
+ if (ret == -1) {
+ int err = errno;
+ printf("setxattr returned (%s)\n", strerror(err));
+ return map_nt_error_from_unix(err);
+ }
+ return NT_STATUS_OK;
+}
+
struct cmd_set vfs_commands[] = {
{ "VFS Commands" },
@@ -1272,5 +1297,7 @@ struct cmd_set vfs_commands[] = {
"getxattr <path> <name>" },
{ "listxattr", cmd_listxattr, "VFS listxattr()",
"listxattr <path>" },
+ { "setxattr", cmd_setxattr, "VFS setxattr()",
+ "setxattr <path> <name> <value> [<flags>]" },
{ NULL }
};