diff options
author | Christian Ambach <ambi@samba.org> | 2012-11-15 15:19:07 +0100 |
---|---|---|
committer | Andrew Bartlett <abartlet@samba.org> | 2013-02-04 12:19:30 +0100 |
commit | de676555ab882bd110a2649555645d58abe2bfeb (patch) | |
tree | 0b171d315119375a973562fbf1552a6067118b50 /source3/torture | |
parent | 06219913abc4f1c3912b377b4a9521a11ad45886 (diff) | |
download | samba-de676555ab882bd110a2649555645d58abe2bfeb.tar.gz samba-de676555ab882bd110a2649555645d58abe2bfeb.tar.bz2 samba-de676555ab882bd110a2649555645d58abe2bfeb.zip |
s3:torture/vfstest implement sys_acl_blob_get_file
Signed-off-by: Christian Ambach <ambi@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Diffstat (limited to 'source3/torture')
-rw-r--r-- | source3/torture/cmd_vfs.c | 32 |
1 files changed, 32 insertions, 0 deletions
diff --git a/source3/torture/cmd_vfs.c b/source3/torture/cmd_vfs.c index 64b1b50211..eef9c40c8e 100644 --- a/source3/torture/cmd_vfs.c +++ b/source3/torture/cmd_vfs.c @@ -1613,6 +1613,36 @@ static NTSTATUS cmd_sys_acl_get_file(struct vfs_state *vfs, TALLOC_CTX *mem_ctx, return NT_STATUS_OK; } +static NTSTATUS cmd_sys_acl_blob_get_file(struct vfs_state *vfs, + TALLOC_CTX *mem_ctx, + int argc, const char **argv) +{ + char *description; + DATA_BLOB blob; + int ret; + size_t i; + + if (argc != 2) { + printf("Usage: sys_acl_get_file <path>\n"); + return NT_STATUS_OK; + } + + ret = SMB_VFS_SYS_ACL_BLOB_GET_FILE(vfs->conn, argv[1], talloc_tos(), + &description, &blob); + if (ret != 0) { + printf("sys_acl_blob_get_file failed (%s)\n", strerror(errno)); + return map_nt_error_from_unix(errno); + } + printf("Description: %s\n", description); + for (i = 0; i < blob.length; i++) { + printf("%.2x ", blob.data[i]); + } + printf("\n"); + + return NT_STATUS_OK; +} + + static NTSTATUS cmd_sys_acl_delete_def_file(struct vfs_state *vfs, TALLOC_CTX *mem_ctx, int argc, const char **argv) { @@ -1691,6 +1721,8 @@ struct cmd_set vfs_commands[] = { { "chmod_acl", cmd_chmod_acl, "VFS chmod_acl()", "chmod_acl <path> <mode>" }, { "sys_acl_get_file", cmd_sys_acl_get_file, "VFS sys_acl_get_file()", "sys_acl_get_file <path>" }, { "sys_acl_get_fd", cmd_sys_acl_get_fd, "VFS sys_acl_get_fd()", "sys_acl_get_fd <fd>" }, + { "sys_acl_blob_get_file", cmd_sys_acl_blob_get_file, + "VFS sys_acl_blob_get_file()", "sys_acl_blob_get_file <path>" }, { "sys_acl_delete_def_file", cmd_sys_acl_delete_def_file, "VFS sys_acl_delete_def_file()", "sys_acl_delete_def_file <path>" }, |